diff --git a/go.mod b/go.mod index 9a37d56b8..f3c18459c 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,10 @@ module github.com/terraform-providers/terraform-provider-nsxt require ( github.com/google/uuid v1.1.1 github.com/hashicorp/go-version v1.2.0 - github.com/hashicorp/terraform-plugin-sdk v1.1.0 + github.com/hashicorp/terraform-plugin-sdk v1.12.0 github.com/vmware/go-vmware-nsxt v0.0.0-20191219213550-f4221331f638 github.com/vmware/vsphere-automation-sdk-go/lib v0.3.1 github.com/vmware/vsphere-automation-sdk-go/runtime v0.3.1 github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.4.0 + github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm v0.2.0 ) diff --git a/go.sum b/go.sum index 66a523a10..c510acfd2 100644 --- a/go.sum +++ b/go.sum @@ -16,29 +16,31 @@ github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0 github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.19.39 h1:pIez14zQWSd/TER2Scohm7aCEG2TgoyXSOX6srOKt6o= -github.com/aws/aws-sdk-go v1.19.39/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ= +github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 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/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gibson042/canonicaljson-go v1.0.3 h1:EAyF8L74AWabkyUmrvEFHEt/AGFQeD6RfwbAuf0j1bI= github.com/gibson042/canonicaljson-go v1.0.3/go.mod h1:DsLpJTThXyGNO+KZlI85C1/KDcImpP67k/RKVjcaEqo= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= @@ -51,14 +53,17 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -67,10 +72,7 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -81,7 +83,6 @@ github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUC github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= 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-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1 h1:4OtAfUGbnKC6yS48p0CtMX2oFYtzFZVv6rok3cRWgnE= @@ -98,21 +99,23 @@ github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= -github.com/hashicorp/hcl2 v0.0.0-20190821123243-0c888d1241f6 h1:JImQpEeUQ+0DPFMaWzLA0GdUNPaUlCXLpfiqkSZBUfc= -github.com/hashicorp/hcl2 v0.0.0-20190821123243-0c888d1241f6/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= -github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= -github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= +github.com/hashicorp/hcl/v2 v2.0.0 h1:efQznTz+ydmQXq3BOnRa3AXzvCeTq1P4dKj/z5GLlY8= +github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-config-inspect v0.0.0-20190821133035-82a99dc22ef4 h1:fTkL0YwjohGyN7AqsDhz6bwcGBpT+xBqi3Qhpw58Juw= -github.com/hashicorp/terraform-config-inspect v0.0.0-20190821133035-82a99dc22ef4/go.mod h1:JDmizlhaP5P0rYTTZB0reDMefAiJyfWPEtugV4in1oI= -github.com/hashicorp/terraform-plugin-sdk v1.1.0 h1:fFn2JYcwTnIuRKgc3pX2SJDsrc1FckfaJ8aStN1HInw= -github.com/hashicorp/terraform-plugin-sdk v1.1.0/go.mod h1:NuwtLpEpPsFaKJPJNGtMcn9vlhe6Ofe+Y6NqXhJgV2M= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= +github.com/hashicorp/terraform-json v0.4.0 h1:KNh29iNxozP5adfUFBJ4/fWd0Cu3taGgjHB38JYqOF4= +github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= +github.com/hashicorp/terraform-plugin-sdk v1.12.0 h1:HPp65ShSsKUMPf6jD50UQn/xAjyrGVO4FxI63bvu+pc= +github.com/hashicorp/terraform-plugin-sdk v1.12.0/go.mod h1:HiWIPD/T9HixIhQUwaSoDQxo4BLFdmiBi/Qz5gjB8Q0= +github.com/hashicorp/terraform-plugin-test v1.3.0 h1:hU5LoxrOn9qvOo+LTKN6mSav2J+dAMprbdxJPEQvp4U= +github.com/hashicorp/terraform-plugin-test v1.3.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= +github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= +github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -123,11 +126,13 @@ 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/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -151,14 +156,12 @@ github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY7 github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI= github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -169,39 +172,25 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/vmihailenco/msgpack v3.3.3+incompatible h1:wapg9xDUZDzGCNFlwc5SqI1rvcciqcxEHac4CYj89xI= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= +github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmware/go-vmware-nsxt v0.0.0-20191219213550-f4221331f638 h1:IhIA83a2W1hu+0OqAfAqAuImpQQ4Ot4G/Kn8n04qrxg= github.com/vmware/go-vmware-nsxt v0.0.0-20191219213550-f4221331f638/go.mod h1:AzmozsuEImWQcg9Cfef9oMNoPQKcNaps6VkyJhzbSf0= -github.com/vmware/vsphere-automation-sdk-go/lib v0.1.1 h1:PmDaeuToX1QKKe9VWRJztAp2/IyjbbGZp6fEiff4Dr8= -github.com/vmware/vsphere-automation-sdk-go/lib v0.1.1/go.mod h1:BkjnHZykqeKKYDZEhyT4pxrEWprYqp4yC0xoCky6wjA= -github.com/vmware/vsphere-automation-sdk-go/lib v0.2.0 h1:noiASkafwxvCmmCtZK0f1pt06R8c+Fkt9TcZW7xpYy0= -github.com/vmware/vsphere-automation-sdk-go/lib v0.2.0/go.mod h1://FsAiCrr+T/Eq2Uxtq8UPVPbZWV7iLIvvXK17rsIxE= github.com/vmware/vsphere-automation-sdk-go/lib v0.3.1 h1:YIcvcshkKm/fbXOvheGfAlGlDTitQXUSMPnYON/uzyg= github.com/vmware/vsphere-automation-sdk-go/lib v0.3.1/go.mod h1:lzuoOgc7zhx3bfrKFRDBbaJX3wj4wSstWv4pTpryhJs= -github.com/vmware/vsphere-automation-sdk-go/runtime v0.1.1 h1:gsbyhqLBiYZQRs0EBPNijKkJNSGcvs1IlRmRi790o84= -github.com/vmware/vsphere-automation-sdk-go/runtime v0.1.1/go.mod h1:SRcvjNB5LycQEoeuwdwf9tSZ/glCmIBPfclZyk/+GLc= -github.com/vmware/vsphere-automation-sdk-go/runtime v0.2.0 h1:AM5AK9cyiJWFIfxrh1U/kuRFh+A2pymCEGiXqAkPzzw= -github.com/vmware/vsphere-automation-sdk-go/runtime v0.2.0/go.mod h1:M6pTKDrJrPlVG++lboLRf0bDYc3TJ2fsR+KOoWXfCns= github.com/vmware/vsphere-automation-sdk-go/runtime v0.3.1 h1:AhoRilMJ6hZbBDr4J9GSrAVpPBkLlZz8+FS84Pdbhc8= github.com/vmware/vsphere-automation-sdk-go/runtime v0.3.1/go.mod h1:kYY+E5osoSMD814W25lc8SqHqSo32hbCZr4pFRA5VgA= -github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.2.0 h1:pWAMR5S3jjJDF5DWeiIEB1c41F9+F/ga+EPmrTkFR+8= -github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.2.0/go.mod h1:5zUcOhT4aCd6V3Xs6mqXVxVGHoKQ/zr1iwCvbSZtUfo= -github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.3.0 h1:Ekf0/umhKdr4N0oURDFlkhZHVm6w0eXzbsn6yc/vL+4= -github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.3.0/go.mod h1:k9tf91B5Ah7gkaM2s+Z6nATmn6gKmgt8AqJ8RUiKLfo= github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.4.0 h1:umuvIi9YYb3TIS3uwtoTyEG1Fp1cfvNxTL0rolVU6eI= github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.4.0/go.mod h1:wZ/NNI0WCtAPnfrh2hq/IBjxXsWg0oxD4nnr6vitl/8= +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm v0.2.0 h1:kR4JXSzm6uru3LFJo8KwGIRE4LoUOAettSR5dBXMsDY= +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm v0.2.0/go.mod h1:3tkEEXZYDu1LI6rB00p+pdVW1cUzS/Dh78/Yh5ODjuI= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= +github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= -gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/lib v0.2.0 h1:+cZjFWuUvSjip24xfwvoZM7HfbDr+SaCO+Ivcy6QVO8= -gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/lib v0.2.0/go.mod h1:5XGjWzhK3FzCvd8UF2XJehkTou62buyRaprG78iyuPo= -gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/runtime v0.2.0 h1:PwLzRMlDmJ8W+/97TEueoqR31f266Z8CfhFjHXdPqlM= -gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/runtime v0.2.0/go.mod h1:QMfGHVgLbJkmt1F1bBajXXX5y1GTRY03XC0tLwfuYHo= -gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/services/nsxt v0.3.0 h1:9SI8iPVTtqS+Q076P5RE4G+QXV8gem2p9f9L8CFp8So= -gitlab.eng.vmware.com/golangsdk/vsphere-automation-sdk-go/services/nsxt v0.3.0/go.mod h1:04MIIof1zW95zy0e2mTFRKoUubFx8ztCJVPPrKd2cXQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -222,21 +211,16 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -250,17 +234,17 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -296,24 +280,21 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a h1:lRlI5zu6AFy3iU/F8YWyNrAmn/tPCnhiTxfwhWb76eU= +google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/nsxt/data_source_nsxt_edge_cluster_test.go b/nsxt/data_source_nsxt_edge_cluster_test.go index 33c361a4a..6bb7f6c2b 100644 --- a/nsxt/data_source_nsxt_edge_cluster_test.go +++ b/nsxt/data_source_nsxt_edge_cluster_test.go @@ -13,8 +13,8 @@ func TestAccDataSourceNsxtEdgeCluster_basic(t *testing.T) { edgeClusterName := getEdgeClusterName() testResourceName := "data.nsxt_edge_cluster.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/nsxt/data_source_nsxt_firewall_section_test.go b/nsxt/data_source_nsxt_firewall_section_test.go index 3c77fd36a..475346832 100644 --- a/nsxt/data_source_nsxt_firewall_section_test.go +++ b/nsxt/data_source_nsxt_firewall_section_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtFirewallSection_basic(t *testing.T) { - name := "terraform_test_firewall_section" + name := "terraform_ds_test_firewall_section" testResourceName := "data.nsxt_firewall_section.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtFirewallSectionDeleteByName(name) diff --git a/nsxt/data_source_nsxt_ip_pool_test.go b/nsxt/data_source_nsxt_ip_pool_test.go index 4170632b4..da79c7747 100644 --- a/nsxt/data_source_nsxt_ip_pool_test.go +++ b/nsxt/data_source_nsxt_ip_pool_test.go @@ -16,8 +16,8 @@ func TestAccDataSourceNsxtIPPool_basic(t *testing.T) { } testResourceName := "data.nsxt_ip_pool.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/nsxt/data_source_nsxt_logical_tier0_router_test.go b/nsxt/data_source_nsxt_logical_tier0_router_test.go index 683cee486..e7b754a87 100644 --- a/nsxt/data_source_nsxt_logical_tier0_router_test.go +++ b/nsxt/data_source_nsxt_logical_tier0_router_test.go @@ -13,8 +13,8 @@ func TestAccDataSourceNsxtLogicalTier0Router_basic(t *testing.T) { routerName := getTier0RouterName() testResourceName := "data.nsxt_logical_tier0_router.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/nsxt/data_source_nsxt_logical_tier1_router_test.go b/nsxt/data_source_nsxt_logical_tier1_router_test.go index 51dbd28d6..fd2fd6e78 100644 --- a/nsxt/data_source_nsxt_logical_tier1_router_test.go +++ b/nsxt/data_source_nsxt_logical_tier1_router_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtLogicalTier1Router_basic(t *testing.T) { - routerName := "terraform_test_tier1" + routerName := "terraform_ds_test_tier1" testResourceName := "data.nsxt_logical_tier1_router.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtTier1RouterDeleteByName(routerName) diff --git a/nsxt/data_source_nsxt_mac_pool_test.go b/nsxt/data_source_nsxt_mac_pool_test.go index 687171d46..f674ce6c0 100644 --- a/nsxt/data_source_nsxt_mac_pool_test.go +++ b/nsxt/data_source_nsxt_mac_pool_test.go @@ -13,8 +13,8 @@ func TestAccDataSourceNsxtMacPool_basic(t *testing.T) { macPoolName := getMacPoolName() testResourceName := "data.nsxt_mac_pool.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/nsxt/data_source_nsxt_ns_group_test.go b/nsxt/data_source_nsxt_ns_group_test.go index becdb8e95..362f1e6d9 100644 --- a/nsxt/data_source_nsxt_ns_group_test.go +++ b/nsxt/data_source_nsxt_ns_group_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtNsGroup_basic(t *testing.T) { - groupName := "terraform_test_ns_group" + groupName := "terraform_ds_test_ns_group" testResourceName := "data.nsxt_ns_group.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtNsGroupDeleteByName(groupName) diff --git a/nsxt/data_source_nsxt_ns_service_test.go b/nsxt/data_source_nsxt_ns_service_test.go index ad40ff954..600daa9d1 100644 --- a/nsxt/data_source_nsxt_ns_service_test.go +++ b/nsxt/data_source_nsxt_ns_service_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtNsService_basic(t *testing.T) { - serviceName := "terraform_test_ns_service" + serviceName := "terraform_ds_test_ns_service" testResourceName := "data.nsxt_ns_service.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtNsServiceDeleteByName(serviceName) @@ -46,7 +46,7 @@ func TestAccDataSourceNsxtNsService_systemOwned(t *testing.T) { serviceName := "WINS" testResourceName := "data.nsxt_ns_service.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ diff --git a/nsxt/data_source_nsxt_policy_certificate_test.go b/nsxt/data_source_nsxt_policy_certificate_test.go index 6fb1db691..0c9e24351 100644 --- a/nsxt/data_source_nsxt_policy_certificate_test.go +++ b/nsxt/data_source_nsxt_policy_certificate_test.go @@ -13,8 +13,12 @@ func TestAccDataSourceNsxtPolicyCertificate_basic(t *testing.T) { name := getTestCertificateName(false) testResourceName := "data.nsxt_policy_certificate.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_CERTIFICATE_NAME") }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccOnlyLocalManager(t) + testAccPreCheck(t) + testAccEnvDefined(t, "NSXT_TEST_CERTIFICATE_NAME") + }, Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/nsxt/data_source_nsxt_policy_edge_cluster.go b/nsxt/data_source_nsxt_policy_edge_cluster.go index fecedf7b5..c44e776f9 100644 --- a/nsxt/data_source_nsxt_policy_edge_cluster.go +++ b/nsxt/data_source_nsxt_policy_edge_cluster.go @@ -20,17 +20,44 @@ func dataSourceNsxtPolicyEdgeCluster() *schema.Resource { "display_name": getDataSourceDisplayNameSchema(), "description": getDataSourceDescriptionSchema(), "path": getPathSchema(), + "site_path": { + Type: schema.TypeString, + Description: "Path of the site this Edge cluster belongs to", + Optional: true, + ValidateFunc: validatePolicyPath(), + }, }, } } func dataSourceNsxtPolicyEdgeClusterRead(d *schema.ResourceData, m interface{}) error { // Read an edge cluster by name or id - connector := getPolicyConnector(m) - client := enforcement_points.NewDefaultEdgeClustersClient(connector) + objSitePath := d.Get("site_path").(string) objID := d.Get("id").(string) objName := d.Get("display_name").(string) + + if !isPolicyGlobalManager(m) && objSitePath != "" { + return globalManagerOnlyError() + } + if isPolicyGlobalManager(m) { + if objSitePath == "" { + return attributeRequiredGlobalManagerError("site_path", "nsxt_policy_edge_cluster") + } + + query := make(map[string]string) + globalPolicyEnforcementPointPath := getGlobalPolicyEnforcementPointPath(m, &objSitePath) + query["parent_path"] = globalPolicyEnforcementPointPath + _, err := policyDataSourceResourceReadWithValidation(d, getPolicyConnector(m), "PolicyEdgeCluster", query, false) + if err != nil { + return err + } + return nil + } + + // Local manager + connector := getPolicyConnector(m) + client := enforcement_points.NewDefaultEdgeClustersClient(connector) var obj model.PolicyEdgeCluster if objID != "" { // Get by id @@ -74,7 +101,6 @@ func dataSourceNsxtPolicyEdgeClusterRead(d *schema.ResourceData, m interface{}) return fmt.Errorf("edge cluster '%s' was not found", objName) } } - d.SetId(*obj.Id) d.Set("display_name", obj.DisplayName) d.Set("description", obj.Description) diff --git a/nsxt/data_source_nsxt_policy_edge_cluster_test.go b/nsxt/data_source_nsxt_policy_edge_cluster_test.go index 87c62ad20..89af392b8 100644 --- a/nsxt/data_source_nsxt_policy_edge_cluster_test.go +++ b/nsxt/data_source_nsxt_policy_edge_cluster_test.go @@ -13,8 +13,11 @@ func TestAccDataSourceNsxtPolicyEdgeCluster_basic(t *testing.T) { edgeClusterName := getEdgeClusterName() testResourceName := "data.nsxt_policy_edge_cluster.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccNSXGlobalManagerSitePrecheck(t) + }, Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -32,12 +35,27 @@ func TestAccDataSourceNsxtPolicyEdgeCluster_basic(t *testing.T) { } func testAccNsxtPolicyEdgeClusterReadTemplate(name string) string { + if testAccIsGlobalManager() { + return testAccNsxtGlobalPolicyEdgeClusterReadTemplate(name) + } return fmt.Sprintf(` data "nsxt_policy_edge_cluster" "test" { display_name = "%s" }`, name) } +func testAccNsxtGlobalPolicyEdgeClusterReadTemplate(name string) string { + return fmt.Sprintf(` +data "nsxt_policy_site" "test" { + display_name = "%s" +} + +data "nsxt_policy_edge_cluster" "test" { + display_name = "%s" + site_path = data.nsxt_policy_site.test.path +}`, getTestSiteName(), name) +} + func testAccNsxtPolicyNoEdgeClusterTemplate() string { return fmt.Sprintf(` `) } diff --git a/nsxt/data_source_nsxt_policy_edge_node.go b/nsxt/data_source_nsxt_policy_edge_node.go index 09f3d1adb..95ac3b4ff 100644 --- a/nsxt/data_source_nsxt_policy_edge_node.go +++ b/nsxt/data_source_nsxt_policy_edge_node.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/sites/enforcement_points/edge_clusters" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" + "strconv" "strings" ) @@ -34,17 +35,31 @@ func dataSourceNsxtPolicyEdgeNode() *schema.Resource { func dataSourceNsxtPolicyEdgeNodeRead(d *schema.ResourceData, m interface{}) error { // Read an edge node by name or id + edgeClusterPath := d.Get("edge_cluster_path").(string) + // Note - according to the documentation GetOkExists should be used + // for bool types, but in this case it works and GetOk doesn't + memberIndex, memberIndexSet := d.GetOkExists("member_index") + + if isPolicyGlobalManager(m) { + query := make(map[string]string) + query["parent_path"] = edgeClusterPath + if memberIndexSet { + query["member_index"] = strconv.Itoa(memberIndex.(int)) + } + _, err := policyDataSourceResourceReadWithValidation(d, getPolicyConnector(m), "PolicyEdgeNode", query, false) + if err != nil { + return err + } + return nil + } + + // Local manager connector := getPolicyConnector(m) client := edge_clusters.NewDefaultEdgeNodesClient(connector) - - edgeClusterPath := d.Get("edge_cluster_path").(string) + var obj model.PolicyEdgeNode edgeClusterID := getPolicyIDFromPath(edgeClusterPath) objID := d.Get("id").(string) - name, nameSet := d.GetOk("display_name") - objName := name.(string) - memberIndex, memberIndexSet := d.GetOk("member_index") - objMemberIndex := int64(memberIndex.(int)) - var obj model.PolicyEdgeNode + if objID != "" { // Get by id objGet, err := client.Get(defaultSite, getPolicyEnforcementPoint(m), edgeClusterID, objID) @@ -55,6 +70,9 @@ func dataSourceNsxtPolicyEdgeNodeRead(d *schema.ResourceData, m interface{}) err obj = objGet } else { // Get by full name/prefix + name, nameSet := d.GetOk("display_name") + objName := name.(string) + objMemberIndex := int64(memberIndex.(int)) includeMarkForDeleteObjectsParam := false objList, err := client.List(defaultSite, getPolicyEnforcementPoint(m), edgeClusterID, nil, &includeMarkForDeleteObjectsParam, nil, nil, nil, nil) if err != nil { diff --git a/nsxt/data_source_nsxt_policy_edge_node_test.go b/nsxt/data_source_nsxt_policy_edge_node_test.go index c3c04a4b9..e9e614f77 100644 --- a/nsxt/data_source_nsxt_policy_edge_node_test.go +++ b/nsxt/data_source_nsxt_policy_edge_node_test.go @@ -13,8 +13,11 @@ func TestAccDataSourceNsxtPolicyEdgeNode_basic(t *testing.T) { edgeClusterName := getEdgeClusterName() testResourceName := "data.nsxt_policy_edge_node.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccNSXGlobalManagerSitePrecheck(t) + }, Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -33,14 +36,12 @@ func TestAccDataSourceNsxtPolicyEdgeNode_basic(t *testing.T) { } func testAccNsxtPolicyEdgeNodeReadTemplate(name string) string { - return fmt.Sprintf(` -data "nsxt_policy_edge_cluster" "test" { - display_name = "%s" -} + return testAccNsxtPolicyEdgeClusterReadTemplate(name) + fmt.Sprintf(` + data "nsxt_policy_edge_node" "test" { edge_cluster_path = data.nsxt_policy_edge_cluster.test.path - member_index = 0 -}`, name) + member_index = 0 +}`) } func testAccNsxtPolicyNoEdgeNodeTemplate() string { diff --git a/nsxt/data_source_nsxt_policy_gateway_qos_profile.go b/nsxt/data_source_nsxt_policy_gateway_qos_profile.go index d8c14081a..4fcfdeb37 100644 --- a/nsxt/data_source_nsxt_policy_gateway_qos_profile.go +++ b/nsxt/data_source_nsxt_policy_gateway_qos_profile.go @@ -25,6 +25,13 @@ func dataSourceNsxtPolicyGatewayQosProfile() *schema.Resource { } func dataSourceNsxtPolicyGatewayQosProfileRead(d *schema.ResourceData, m interface{}) error { + if isPolicyGlobalManager(m) { + _, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "GatewayQosProfile", nil) + if err != nil { + return err + } + return nil + } connector := getPolicyConnector(m) client := infra.NewDefaultGatewayQosProfilesClient(connector) diff --git a/nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go b/nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go index 6cbc7cf65..fa2272e1e 100644 --- a/nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go +++ b/nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go @@ -7,17 +7,19 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" + gm_infra "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "testing" ) func TestAccDataSourceNsxtPolicyGatewayQosProfile_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_gateway_qos_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyGatewayQosProfileDeleteByName(name) @@ -48,7 +50,6 @@ func testAccDataSourceNsxtPolicyGatewayQosProfileCreate(name string) error { if err != nil { return fmt.Errorf("Error during test client initialization: %v", err) } - client := infra.NewDefaultGatewayQosProfilesClient(connector) displayName := name description := name @@ -60,7 +61,18 @@ func testAccDataSourceNsxtPolicyGatewayQosProfileCreate(name string) error { // Generate a random ID for the resource id := newUUID() - err = client.Patch(id, obj) + if testAccIsGlobalManager() { + gmObj, err := convertModelBindingType(obj, model.GatewayQosProfileBindingType(), gm_model.GatewayQosProfileBindingType()) + if err != nil { + return err + } + client := gm_infra.NewDefaultGatewayQosProfilesClient(connector) + err = client.Patch(id, gmObj.(gm_model.GatewayQosProfile)) + } else { + client := infra.NewDefaultGatewayQosProfilesClient(connector) + err = client.Patch(id, obj) + } + if err != nil { return handleCreateError("GatewayQosProfile", id, err) } @@ -72,21 +84,34 @@ func testAccDataSourceNsxtPolicyGatewayQosProfileDeleteByName(name string) error if err != nil { return fmt.Errorf("Error during test client initialization: %v", err) } - client := infra.NewDefaultGatewayQosProfilesClient(connector) - // Find the object by name - objList, err := client.List(nil, nil, nil, nil, nil, nil) - if err != nil { - return handleListError("GatewayQosProfile", err) - } - for _, objInList := range objList.Results { - if *objInList.DisplayName == name { - err := client.Delete(*objInList.Id) + // Find the object by name and delete it + if testAccIsGlobalManager() { + objID, err := testGetObjIDByName(name, "GatewayQosProfile") + if err == nil { + client := gm_infra.NewDefaultQosProfilesClient(connector) + err := client.Delete(objID) if err != nil { - return handleDeleteError("GatewayQosProfile", *objInList.Id, err) + return handleDeleteError("GatewayQosProfile", objID, err) } return nil } + } else { + client := infra.NewDefaultGatewayQosProfilesClient(connector) + // Find the object by name + objList, err := client.List(nil, nil, nil, nil, nil, nil) + if err != nil { + return handleListError("GatewayQosProfile", err) + } + for _, objInList := range objList.Results { + if *objInList.DisplayName == name { + err := client.Delete(*objInList.Id) + if err != nil { + return handleDeleteError("GatewayQosProfile", *objInList.Id, err) + } + return nil + } + } } return fmt.Errorf("Error while deleting GatewayQosProfile '%s': resource not found", name) } diff --git a/nsxt/data_source_nsxt_policy_ip_block_test.go b/nsxt/data_source_nsxt_policy_ip_block_test.go index be8a324ce..205a1446c 100644 --- a/nsxt/data_source_nsxt_policy_ip_block_test.go +++ b/nsxt/data_source_nsxt_policy_ip_block_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtPolicyIpBlock_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_ip_block.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyIPBlockDeleteByName(name) diff --git a/nsxt/data_source_nsxt_policy_ip_discovery_profile.go b/nsxt/data_source_nsxt_policy_ip_discovery_profile.go index 1723216a6..5d8485dde 100644 --- a/nsxt/data_source_nsxt_policy_ip_discovery_profile.go +++ b/nsxt/data_source_nsxt_policy_ip_discovery_profile.go @@ -25,6 +25,13 @@ func dataSourceNsxtPolicyIPDiscoveryProfile() *schema.Resource { } func dataSourceNsxtPolicyIPDiscoveryProfileRead(d *schema.ResourceData, m interface{}) error { + if isPolicyGlobalManager(m) { + _, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "IPDiscoveryProfile", nil) + if err != nil { + return err + } + return nil + } connector := getPolicyConnector(m) client := infra.NewDefaultIpDiscoveryProfilesClient(connector) diff --git a/nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go b/nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go index 6360bcf19..df6fd6779 100644 --- a/nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go +++ b/nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go @@ -6,33 +6,23 @@ package nsxt import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "testing" ) func TestAccDataSourceNsxtPolicyIPDiscoveryProfile_basic(t *testing.T) { - name := "terraform_test" + // Use existing system defined profile + name := "default-ip-discovery-profile" testResourceName := "data.nsxt_policy_ip_discovery_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: func(state *terraform.State) error { - return testAccDataSourceNsxtPolicyIPDiscoveryProfileDeleteByName(name) - }, Steps: []resource.TestStep{ { - PreConfig: func() { - if err := testAccDataSourceNsxtPolicyIPDiscoveryProfileCreate(name); err != nil { - panic(err) - } - }, Config: testAccNsxtPolicyIPDiscoveryProfileReadTemplate(name), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(testResourceName, "display_name", name), - resource.TestCheckResourceAttr(testResourceName, "description", name), + resource.TestCheckResourceAttr(testResourceName, "description", ""), resource.TestCheckResourceAttrSet(testResourceName, "path"), ), }, @@ -43,54 +33,6 @@ func TestAccDataSourceNsxtPolicyIPDiscoveryProfile_basic(t *testing.T) { }) } -func testAccDataSourceNsxtPolicyIPDiscoveryProfileCreate(name string) error { - connector, err := testAccGetPolicyConnector() - if err != nil { - return fmt.Errorf("Error during test client initialization: %v", err) - } - client := infra.NewDefaultIpDiscoveryProfilesClient(connector) - - displayName := name - description := name - obj := model.IPDiscoveryProfile{ - Description: &description, - DisplayName: &displayName, - } - - // Generate a random ID for the resource - id := newUUID() - - err = client.Patch(id, obj) - if err != nil { - return handleCreateError("IPDiscoveryProfile", id, err) - } - return nil -} - -func testAccDataSourceNsxtPolicyIPDiscoveryProfileDeleteByName(name string) error { - connector, err := testAccGetPolicyConnector() - if err != nil { - return fmt.Errorf("Error during test client initialization: %v", err) - } - client := infra.NewDefaultIpDiscoveryProfilesClient(connector) - - // Find the object by name - objList, err := client.List(nil, nil, nil, nil, nil, nil) - if err != nil { - return handleListError("IPDiscoveryProfile", err) - } - for _, objInList := range objList.Results { - if *objInList.DisplayName == name { - err := client.Delete(*objInList.Id) - if err != nil { - return handleDeleteError("IPDiscoveryProfile", *objInList.Id, err) - } - return nil - } - } - return fmt.Errorf("Error while deleting IPDiscoveryProfile '%s': resource not found", name) -} - func testAccNsxtPolicyIPDiscoveryProfileReadTemplate(name string) string { return fmt.Sprintf(` data "nsxt_policy_ip_discovery_profile" "test" { diff --git a/nsxt/data_source_nsxt_policy_ip_pool_test.go b/nsxt/data_source_nsxt_policy_ip_pool_test.go index f96783c48..8e381abe8 100644 --- a/nsxt/data_source_nsxt_policy_ip_pool_test.go +++ b/nsxt/data_source_nsxt_policy_ip_pool_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtPolicyIpPool_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_ip_pool.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyIPPoolDeleteByName(name) diff --git a/nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go b/nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go index fbbe50477..6db703689 100644 --- a/nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go +++ b/nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtPolicyIpv6DadProfile_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_ipv6_dad_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyIpv6DadProfileDeleteByName(name) diff --git a/nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go b/nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go index 33816331e..007975c61 100644 --- a/nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go +++ b/nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtPolicyIpv6NdraProfile_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_ipv6_ndra_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyIpv6NdraProfileDeleteByName(name) diff --git a/nsxt/data_source_nsxt_policy_lb_app_profile_test.go b/nsxt/data_source_nsxt_policy_lb_app_profile_test.go index 8ea25d96a..5b3944d14 100644 --- a/nsxt/data_source_nsxt_policy_lb_app_profile_test.go +++ b/nsxt/data_source_nsxt_policy_lb_app_profile_test.go @@ -15,11 +15,11 @@ import ( ) func TestAccDataSourceNsxtPolicyLBAppProfile_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_lb_app_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyLBAppProfileDeleteByName(name) diff --git a/nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go b/nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go index fda1a64e8..fdfabbbee 100644 --- a/nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go +++ b/nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtPolicyLBClientSslProfile_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_lb_client_ssl_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyLBClientSslProfileDeleteByName(name) diff --git a/nsxt/data_source_nsxt_policy_lb_monitor_test.go b/nsxt/data_source_nsxt_policy_lb_monitor_test.go index 7eeed7a30..92cc497a3 100644 --- a/nsxt/data_source_nsxt_policy_lb_monitor_test.go +++ b/nsxt/data_source_nsxt_policy_lb_monitor_test.go @@ -15,11 +15,11 @@ import ( ) func TestAccDataSourceNsxtPolicyLBMonitor_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_lb_monitor.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyLBMonitorDeleteByName(name) diff --git a/nsxt/data_source_nsxt_policy_lb_persistence_profile_test.go b/nsxt/data_source_nsxt_policy_lb_persistence_profile_test.go index 619f9ddd9..129edaf2f 100644 --- a/nsxt/data_source_nsxt_policy_lb_persistence_profile_test.go +++ b/nsxt/data_source_nsxt_policy_lb_persistence_profile_test.go @@ -12,8 +12,8 @@ import ( func TestAccDataSourceNsxtPolicyPolicyLbPersistenceProfile_basic(t *testing.T) { testResourceName := "data.nsxt_policy_lb_persistence_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go b/nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go index 1bd02c5f7..41fbe20c9 100644 --- a/nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go +++ b/nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtPolicyLBServerSslProfile_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_lb_server_ssl_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyLBServerSslProfileDeleteByName(name) diff --git a/nsxt/data_source_nsxt_policy_mac_discovery_profile.go b/nsxt/data_source_nsxt_policy_mac_discovery_profile.go index bd81747ad..0ce20357b 100644 --- a/nsxt/data_source_nsxt_policy_mac_discovery_profile.go +++ b/nsxt/data_source_nsxt_policy_mac_discovery_profile.go @@ -25,6 +25,15 @@ func dataSourceNsxtPolicyMacDiscoveryProfile() *schema.Resource { } func dataSourceNsxtPolicyMacDiscoveryProfileRead(d *schema.ResourceData, m interface{}) error { + if isPolicyGlobalManager(m) { + _, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "MacDiscoveryProfile", nil) + if err != nil { + return err + } + return nil + } + + // Local manager support: connector := getPolicyConnector(m) client := infra.NewDefaultMacDiscoveryProfilesClient(connector) diff --git a/nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go b/nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go index 65056b431..82cabf457 100644 --- a/nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go +++ b/nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go @@ -6,33 +6,23 @@ package nsxt import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "testing" ) func TestAccDataSourceNsxtPolicyMacDiscoveryProfile_basic(t *testing.T) { - name := "terraform_test" + // Use existing system defined profile + name := "default-mac-discovery-profile" testResourceName := "data.nsxt_policy_mac_discovery_profile.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: func(state *terraform.State) error { - return testAccDataSourceNsxtPolicyMacDiscoveryProfileDeleteByName(name) - }, Steps: []resource.TestStep{ { - PreConfig: func() { - if err := testAccDataSourceNsxtPolicyMacDiscoveryProfileCreate(name); err != nil { - panic(err) - } - }, Config: testAccNsxtPolicyMacDiscoveryProfileReadTemplate(name), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(testResourceName, "display_name", name), - resource.TestCheckResourceAttr(testResourceName, "description", name), + resource.TestCheckResourceAttr(testResourceName, "description", ""), resource.TestCheckResourceAttrSet(testResourceName, "path"), ), }, @@ -43,55 +33,29 @@ func TestAccDataSourceNsxtPolicyMacDiscoveryProfile_basic(t *testing.T) { }) } -func testAccDataSourceNsxtPolicyMacDiscoveryProfileCreate(name string) error { - connector, err := testAccGetPolicyConnector() - if err != nil { - return fmt.Errorf("Error during test client initialization: %v", err) - } - client := infra.NewDefaultMacDiscoveryProfilesClient(connector) - - displayName := name - description := name - boolFalse := false - obj := model.MacDiscoveryProfile{ - Description: &description, - DisplayName: &displayName, - MacLearningEnabled: &boolFalse, - UnknownUnicastFloodingEnabled: &boolFalse, - } - - // Generate a random ID for the resource - id := newUUID() - - err = client.Patch(id, obj) - if err != nil { - return handleCreateError("MacDiscoveryProfile", id, err) - } - return nil -} - -func testAccDataSourceNsxtPolicyMacDiscoveryProfileDeleteByName(name string) error { - connector, err := testAccGetPolicyConnector() - if err != nil { - return fmt.Errorf("Error during test client initialization: %v", err) - } - client := infra.NewDefaultMacDiscoveryProfilesClient(connector) +func TestAccDataSourceNsxtPolicyMacDiscoveryProfile_prefix(t *testing.T) { + // Use existing system defined profile + name := "default-mac-discovery-profile" + namePrefix := string(name[0:15]) + testResourceName := "data.nsxt_policy_mac_discovery_profile.test" - // Find the object by name - objList, err := client.List(nil, nil, nil, nil, nil, nil) - if err != nil { - return handleListError("MacDiscoveryProfile", err) - } - for _, objInList := range objList.Results { - if *objInList.DisplayName == name { - err := client.Delete(*objInList.Id) - if err != nil { - return fmt.Errorf("Error during MacDiscoveryProfile deletion: %v", err) - } - return nil - } - } - return fmt.Errorf("Error while deleting MacDiscoveryProfile '%s': resource not found", name) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicyMacDiscoveryProfileReadTemplate(namePrefix), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(testResourceName, "display_name", name), + resource.TestCheckResourceAttr(testResourceName, "description", ""), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + ), + }, + { + Config: testAccNsxtPolicyEmptyTemplate(), + }, + }, + }) } func testAccNsxtPolicyMacDiscoveryProfileReadTemplate(name string) string { diff --git a/nsxt/data_source_nsxt_policy_qos_profile.go b/nsxt/data_source_nsxt_policy_qos_profile.go index 2e20e9bb9..21f12e7f7 100644 --- a/nsxt/data_source_nsxt_policy_qos_profile.go +++ b/nsxt/data_source_nsxt_policy_qos_profile.go @@ -25,6 +25,14 @@ func dataSourceNsxtPolicyQosProfile() *schema.Resource { } func dataSourceNsxtPolicyQosProfileRead(d *schema.ResourceData, m interface{}) error { + if isPolicyGlobalManager(m) { + _, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "QoSProfile", nil) + if err != nil { + return err + } + return nil + } + connector := getPolicyConnector(m) client := infra.NewDefaultQosProfilesClient(connector) diff --git a/nsxt/data_source_nsxt_policy_qos_profile_test.go b/nsxt/data_source_nsxt_policy_qos_profile_test.go index 259d2a766..a84c2c084 100644 --- a/nsxt/data_source_nsxt_policy_qos_profile_test.go +++ b/nsxt/data_source_nsxt_policy_qos_profile_test.go @@ -7,17 +7,19 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" + gm_infra "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "testing" ) func TestAccDataSourceNsxtPolicyQosProfile_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_qos_profile.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyQosProfileDeleteByName(name) @@ -48,7 +50,6 @@ func testAccDataSourceNsxtPolicyQosProfileCreate(name string) error { if err != nil { return fmt.Errorf("Error during test client initialization: %v", err) } - client := infra.NewDefaultQosProfilesClient(connector) displayName := name description := name @@ -60,7 +61,19 @@ func testAccDataSourceNsxtPolicyQosProfileCreate(name string) error { // Generate a random ID for the resource id := newUUID() - err = client.Patch(id, obj) + if testAccIsGlobalManager() { + gmObj, err := convertModelBindingType(obj, model.QosProfileBindingType(), gm_model.QosProfileBindingType()) + if err != nil { + return err + } + + client := gm_infra.NewDefaultQosProfilesClient(connector) + err = client.Patch(id, gmObj.(gm_model.QosProfile)) + } else { + client := infra.NewDefaultQosProfilesClient(connector) + err = client.Patch(id, obj) + } + if err != nil { return handleCreateError("QosProfile", id, err) } @@ -72,21 +85,33 @@ func testAccDataSourceNsxtPolicyQosProfileDeleteByName(name string) error { if err != nil { return fmt.Errorf("Error during test client initialization: %v", err) } - client := infra.NewDefaultQosProfilesClient(connector) - // Find the object by name - objList, err := client.List(nil, nil, nil, nil, nil) - if err != nil { - return handleListError("QosProfile", err) - } - for _, objInList := range objList.Results { - if *objInList.DisplayName == name { - err := client.Delete(*objInList.Id) + // Find the object by name and delete it + if testAccIsGlobalManager() { + objID, err := testGetObjIDByName(name, "QosProfile") + if err == nil { + client := gm_infra.NewDefaultQosProfilesClient(connector) + err := client.Delete(objID) if err != nil { - return handleDeleteError("QosProfile", *objInList.Id, err) + return handleDeleteError("QosProfile", objID, err) } return nil } + } else { + client := infra.NewDefaultQosProfilesClient(connector) + objList, err := client.List(nil, nil, nil, nil, nil) + if err != nil { + return handleListError("QosProfile", err) + } + for _, objInList := range objList.Results { + if *objInList.DisplayName == name { + err := client.Delete(*objInList.Id) + if err != nil { + return handleDeleteError("QosProfile", *objInList.Id, err) + } + return nil + } + } } return fmt.Errorf("Error while deleting QosProfile '%s': resource not found", name) } diff --git a/nsxt/data_source_nsxt_policy_realization_info.go b/nsxt/data_source_nsxt_policy_realization_info.go index 1b04627c6..37f9107ef 100644 --- a/nsxt/data_source_nsxt_policy_realization_info.go +++ b/nsxt/data_source_nsxt_policy_realization_info.go @@ -7,7 +7,10 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + gm_realized_state "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/realized_state" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "time" ) @@ -39,6 +42,12 @@ func dataSourceNsxtPolicyRealizationInfo() *schema.Resource { Description: "The ID of the realized resource", Computed: true, }, + "site_path": { + Type: schema.TypeString, + Description: "Path of the site this resource belongs to", + Optional: true, + ValidateFunc: validatePolicyPath(), + }, }, } } @@ -46,11 +55,21 @@ func dataSourceNsxtPolicyRealizationInfo() *schema.Resource { func dataSourceNsxtPolicyRealizationInfoRead(d *schema.ResourceData, m interface{}) error { // Read the realization info by the path, and wait till it is valid connector := getPolicyConnector(m) - client := realized_state.NewDefaultRealizedEntitiesClient(connector) // Get the realization info of this resource path := d.Get("path").(string) entityType := d.Get("entity_type").(string) + objSitePath := d.Get("site_path").(string) + + // Site is mandatory got GM and irrelevant else + if !isPolicyGlobalManager(m) && objSitePath != "" { + return globalManagerOnlyError() + } + if isPolicyGlobalManager(m) { + if objSitePath == "" { + return attributeRequiredGlobalManagerError("site_path", "nsxt_policy_realization_info") + } + } // Dummy id, just because each data source needs one id := d.Get("id").(string) @@ -65,7 +84,21 @@ func dataSourceNsxtPolicyRealizationInfoRead(d *schema.ResourceData, m interface Target: targetStates, Refresh: func() (interface{}, string, error) { - realizationResult, realizationError := client.List(path, &policySite) + var realizationError error + var realizationResult model.GenericPolicyRealizedResourceListResult + if isPolicyGlobalManager(m) { + client := gm_realized_state.NewDefaultRealizedEntitiesClient(connector) + var gmResults gm_model.GenericPolicyRealizedResourceListResult + gmResults, realizationError = client.List(path, &objSitePath) + if realizationError == nil { + var lmResults interface{} + lmResults, realizationError = convertModelBindingType(gmResults, gm_model.GenericPolicyRealizedResourceListResultBindingType(), model.GenericPolicyRealizedResourceListResultBindingType()) + realizationResult = lmResults.(model.GenericPolicyRealizedResourceListResult) + } + } else { + client := realized_state.NewDefaultRealizedEntitiesClient(connector) + realizationResult, realizationError = client.List(path, &policySite) + } state := "UNKNOWN" if realizationError == nil { // Find the right entry diff --git a/nsxt/data_source_nsxt_policy_realization_info_test.go b/nsxt/data_source_nsxt_policy_realization_info_test.go index e99418bab..aa984a85f 100644 --- a/nsxt/data_source_nsxt_policy_realization_info_test.go +++ b/nsxt/data_source_nsxt_policy_realization_info_test.go @@ -12,12 +12,12 @@ import ( func TestAccDataSourceNsxtPolicyRealizationInfo_tier1DataSource(t *testing.T) { resourceDataType := "nsxt_policy_tier1_gateway" - resourceName := "terraform_test_tier1" + resourceName := "terraform_test_tier1_1" entityType := "" testResourceName := "data.nsxt_policy_realization_info.realization_info" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccOnlyLocalManager(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyTier1GatewayDeleteByName(resourceName) @@ -46,12 +46,12 @@ func TestAccDataSourceNsxtPolicyRealizationInfo_tier1DataSource(t *testing.T) { func TestAccDataSourceNsxtPolicyRealizationInfo_tier1DataSourceEntity(t *testing.T) { resourceDataType := "nsxt_policy_tier1_gateway" - resourceName := "terraform_test_tier1" + resourceName := "terraform_test_tier1_2" entityType := "RealizedLogicalRouter" testResourceName := "data.nsxt_policy_realization_info.realization_info" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccOnlyLocalManager(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyTier1GatewayDeleteByName(resourceName) @@ -80,12 +80,12 @@ func TestAccDataSourceNsxtPolicyRealizationInfo_tier1DataSourceEntity(t *testing func TestAccDataSourceNsxtPolicyRealizationInfo_tier1Resource(t *testing.T) { resourceType := "nsxt_policy_tier1_gateway" - resourceName := "terraform_test_tier1" + resourceName := "terraform_test_tier1_3" entityType := "RealizedLogicalRouter" testResourceName := "data.nsxt_policy_realization_info.realization_info" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0"); testAccOnlyLocalManager(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -107,8 +107,8 @@ func TestAccDataSourceNsxtPolicyRealizationInfo_tier1Resource(t *testing.T) { func TestAccDataSourceNsxtPolicyRealizationInfo_errorState(t *testing.T) { testResourceName := "data.nsxt_policy_realization_info.realization_info" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccOnlyLocalManager(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -124,6 +124,55 @@ func TestAccDataSourceNsxtPolicyRealizationInfo_errorState(t *testing.T) { }) } +func TestAccDataSourceNsxtPolicyRealizationInfo_gmServiceDataSource(t *testing.T) { + resourceDataType := "nsxt_policy_service" + resourceName := "DNS" + entityType := "" + testResourceName := "data.nsxt_policy_realization_info.realization_info" + site := getTestSiteName() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + testAccOnlyGlobalManager(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicyGMRealizationInfoReadDataSourceTemplate(resourceDataType, resourceName, entityType, site), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(testResourceName, "state", "REALIZED"), + resource.TestCheckResourceAttrSet(testResourceName, "entity_type"), + resource.TestCheckResourceAttrSet(testResourceName, "realized_id"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "site_path"), + ), + }, + { + Config: testAccNsxtPolicyNoRealizationInfoTemplate(), + }, + }, + }) +} + +func testAccNsxtPolicyGMRealizationInfoReadDataSourceTemplate(resourceDataType string, resourceName string, entityType string, site string) string { + return fmt.Sprintf(` +data "%s" "policy_resource" { + display_name = "%s" +} + +data "nsxt_policy_site" "test" { + display_name = "%s" +} + +data "nsxt_policy_realization_info" "realization_info" { + path = data.%s.policy_resource.path + entity_type = "%s" + site_path = data.nsxt_policy_site.test.path +}`, resourceDataType, resourceName, site, resourceDataType, entityType) +} + func testAccNsxtPolicyRealizationInfoReadDataSourceErrorTemplate() string { return fmt.Sprintf(` resource "nsxt_policy_ip_pool" "test" { diff --git a/nsxt/data_source_nsxt_policy_segment_realization_test.go b/nsxt/data_source_nsxt_policy_segment_realization_test.go index 903985c24..eb53c675c 100644 --- a/nsxt/data_source_nsxt_policy_segment_realization_test.go +++ b/nsxt/data_source_nsxt_policy_segment_realization_test.go @@ -12,8 +12,8 @@ import ( func testAccDataSourceNsxtPolicySegmentRealization(t *testing.T, vlan bool) { testResourceName := "data.nsxt_policy_segment_realization.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/nsxt/data_source_nsxt_policy_segment_security_profile.go b/nsxt/data_source_nsxt_policy_segment_security_profile.go index aadfe7ef7..6388115d4 100644 --- a/nsxt/data_source_nsxt_policy_segment_security_profile.go +++ b/nsxt/data_source_nsxt_policy_segment_security_profile.go @@ -25,6 +25,14 @@ func dataSourceNsxtPolicySegmentSecurityProfile() *schema.Resource { } func dataSourceNsxtPolicySegmentSecurityProfileRead(d *schema.ResourceData, m interface{}) error { + if isPolicyGlobalManager(m) { + _, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "SegmentSecurityProfile", nil) + if err != nil { + return err + } + return nil + } + connector := getPolicyConnector(m) client := infra.NewDefaultSegmentSecurityProfilesClient(connector) diff --git a/nsxt/data_source_nsxt_policy_segment_security_profile_test.go b/nsxt/data_source_nsxt_policy_segment_security_profile_test.go index d71d18802..384a8d953 100644 --- a/nsxt/data_source_nsxt_policy_segment_security_profile_test.go +++ b/nsxt/data_source_nsxt_policy_segment_security_profile_test.go @@ -6,33 +6,23 @@ package nsxt import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "testing" ) func TestAccDataSourceNsxtPolicySegmentSecurityProfile_basic(t *testing.T) { - name := "terraform_test" + // Use existing system defined profile + name := "default-segment-security-profile" testResourceName := "data.nsxt_policy_segment_security_profile.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: func(state *terraform.State) error { - return testAccDataSourceNsxtPolicySegmentSecurityProfileDeleteByName(name) - }, Steps: []resource.TestStep{ { - PreConfig: func() { - if err := testAccDataSourceNsxtPolicySegmentSecurityProfileCreate(name); err != nil { - panic(err) - } - }, Config: testAccNsxtPolicySegmentSecurityProfileReadTemplate(name), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(testResourceName, "display_name", name), - resource.TestCheckResourceAttr(testResourceName, "description", name), + resource.TestCheckResourceAttr(testResourceName, "description", ""), resource.TestCheckResourceAttrSet(testResourceName, "path"), ), }, @@ -43,54 +33,6 @@ func TestAccDataSourceNsxtPolicySegmentSecurityProfile_basic(t *testing.T) { }) } -func testAccDataSourceNsxtPolicySegmentSecurityProfileCreate(name string) error { - connector, err := testAccGetPolicyConnector() - if err != nil { - return fmt.Errorf("Error during test client initialization: %v", err) - } - client := infra.NewDefaultSegmentSecurityProfilesClient(connector) - - displayName := name - description := name - obj := model.SegmentSecurityProfile{ - Description: &description, - DisplayName: &displayName, - } - - // Generate a random ID for the resource - id := newUUID() - - err = client.Patch(id, obj) - if err != nil { - return handleCreateError("SegmentSecurityProfile", id, err) - } - return nil -} - -func testAccDataSourceNsxtPolicySegmentSecurityProfileDeleteByName(name string) error { - connector, err := testAccGetPolicyConnector() - if err != nil { - return fmt.Errorf("Error during test client initialization: %v", err) - } - client := infra.NewDefaultSegmentSecurityProfilesClient(connector) - - // Find the object by name - objList, err := client.List(nil, nil, nil, nil, nil, nil) - if err != nil { - return handleListError("SegmentSecurityProfile", err) - } - for _, objInList := range objList.Results { - if *objInList.DisplayName == name { - err := client.Delete(*objInList.Id) - if err != nil { - return handleDeleteError("SegmentSecurityProfile", *objInList.Id, err) - } - return nil - } - } - return fmt.Errorf("Error while deleting SegmentSecurityProfile '%s': resource not found", name) -} - func testAccNsxtPolicySegmentSecurityProfileReadTemplate(name string) string { return fmt.Sprintf(` data "nsxt_policy_segment_security_profile" "test" { diff --git a/nsxt/data_source_nsxt_policy_service.go b/nsxt/data_source_nsxt_policy_service.go index 720078dd7..df03e326c 100644 --- a/nsxt/data_source_nsxt_policy_service.go +++ b/nsxt/data_source_nsxt_policy_service.go @@ -50,6 +50,13 @@ func dataSourceNsxtPolicyServiceReadAllServices(connector *client.RestConnector) } func dataSourceNsxtPolicyServiceRead(d *schema.ResourceData, m interface{}) error { + if isPolicyGlobalManager(m) { + _, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "Service", nil) + if err != nil { + return err + } + return nil + } // Read a service by name or id connector := getPolicyConnector(m) client := infra.NewDefaultServicesClient(connector) diff --git a/nsxt/data_source_nsxt_policy_service_test.go b/nsxt/data_source_nsxt_policy_service_test.go index 697b69227..12084bf13 100644 --- a/nsxt/data_source_nsxt_policy_service_test.go +++ b/nsxt/data_source_nsxt_policy_service_test.go @@ -13,7 +13,7 @@ func TestAccDataSourceNsxtPolicyService_basic(t *testing.T) { serviceName := "DNS" testResourceName := "data.nsxt_policy_service.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccDataSourceNsxtPolicyService_byId(t *testing.T) { serviceID := "DNS" testResourceName := "data.nsxt_policy_service.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ @@ -60,7 +60,7 @@ func TestAccDataSourceNsxtPolicyService_byPrefix(t *testing.T) { servicePrefix := "Heart" testResourceName := "data.nsxt_policy_service.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ diff --git a/nsxt/data_source_nsxt_policy_site.go b/nsxt/data_source_nsxt_policy_site.go new file mode 100644 index 000000000..42cf44a89 --- /dev/null +++ b/nsxt/data_source_nsxt_policy_site.go @@ -0,0 +1,34 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: MPL-2.0 */ + +package nsxt + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceNsxtPolicySite() *schema.Resource { + return &schema.Resource{ + Read: dataSourceNsxtPolicySiteRead, + + Schema: map[string]*schema.Schema{ + "id": getDataSourceIDSchema(), + "display_name": getDataSourceDisplayNameSchema(), + "description": getDataSourceDescriptionSchema(), + "path": getPathSchema(), + }, + } +} + +func dataSourceNsxtPolicySiteRead(d *schema.ResourceData, m interface{}) error { + if !isPolicyGlobalManager(m) { + return globalManagerOnlyError() + } + + _, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "Site", nil) + if err != nil { + return err + } + + return nil +} diff --git a/nsxt/data_source_nsxt_policy_site_test.go b/nsxt/data_source_nsxt_policy_site_test.go new file mode 100644 index 000000000..f49f27604 --- /dev/null +++ b/nsxt/data_source_nsxt_policy_site_test.go @@ -0,0 +1,43 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: MPL-2.0 */ + +package nsxt + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "testing" +) + +func TestAccDataSourceNsxtPolicySite_basic(t *testing.T) { + name := getTestSiteName() + testResourceName := "data.nsxt_policy_site.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccOnlyGlobalManager(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicySiteReadTemplate(name), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(testResourceName, "display_name", name), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + ), + }, + { + Config: testAccNsxtPolicyEmptyTemplate(), + }, + }, + }) +} + +func testAccNsxtPolicySiteReadTemplate(name string) string { + return fmt.Sprintf(` +data "nsxt_policy_site" "test" { + display_name = "%s" +}`, name) +} diff --git a/nsxt/data_source_nsxt_policy_spoofguard_profile.go b/nsxt/data_source_nsxt_policy_spoofguard_profile.go index eb6cf6d78..165465a1f 100644 --- a/nsxt/data_source_nsxt_policy_spoofguard_profile.go +++ b/nsxt/data_source_nsxt_policy_spoofguard_profile.go @@ -25,6 +25,14 @@ func dataSourceNsxtPolicySpoofGuardProfile() *schema.Resource { } func dataSourceNsxtPolicySpoofGuardProfileRead(d *schema.ResourceData, m interface{}) error { + if isPolicyGlobalManager(m) { + _, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "SpoofGuardProfile", nil) + if err != nil { + return err + } + return nil + } + connector := getPolicyConnector(m) client := infra.NewDefaultSpoofguardProfilesClient(connector) diff --git a/nsxt/data_source_nsxt_policy_spoofguard_profile_test.go b/nsxt/data_source_nsxt_policy_spoofguard_profile_test.go index 7bedd7973..2e9bab794 100644 --- a/nsxt/data_source_nsxt_policy_spoofguard_profile_test.go +++ b/nsxt/data_source_nsxt_policy_spoofguard_profile_test.go @@ -6,33 +6,23 @@ package nsxt import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "testing" ) func TestAccDataSourceNsxtPolicySpoofGuardProfile_basic(t *testing.T) { - name := "terraform_test" + // Use existing system defined profile + name := "default-spoofguard-profile" testResourceName := "data.nsxt_policy_spoofguard_profile.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: func(state *terraform.State) error { - return testAccDataSourceNsxtPolicySpoofGuardProfileDeleteByName(name) - }, Steps: []resource.TestStep{ { - PreConfig: func() { - if err := testAccDataSourceNsxtPolicySpoofGuardProfileCreate(name); err != nil { - panic(err) - } - }, Config: testAccNsxtPolicySpoofGuardProfileReadTemplate(name), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(testResourceName, "display_name", name), - resource.TestCheckResourceAttr(testResourceName, "description", name), + resource.TestCheckResourceAttr(testResourceName, "description", ""), resource.TestCheckResourceAttrSet(testResourceName, "path"), ), }, @@ -43,54 +33,6 @@ func TestAccDataSourceNsxtPolicySpoofGuardProfile_basic(t *testing.T) { }) } -func testAccDataSourceNsxtPolicySpoofGuardProfileCreate(name string) error { - connector, err := testAccGetPolicyConnector() - if err != nil { - return fmt.Errorf("Error during test client initialization: %v", err) - } - client := infra.NewDefaultSpoofguardProfilesClient(connector) - - displayName := name - description := name - obj := model.SpoofGuardProfile{ - Description: &description, - DisplayName: &displayName, - } - - // Generate a random ID for the resource - id := newUUID() - - err = client.Patch(id, obj) - if err != nil { - return handleCreateError("SpoofGuardProfile", id, err) - } - return nil -} - -func testAccDataSourceNsxtPolicySpoofGuardProfileDeleteByName(name string) error { - connector, err := testAccGetPolicyConnector() - if err != nil { - return fmt.Errorf("Error during test client initialization: %v", err) - } - client := infra.NewDefaultSpoofguardProfilesClient(connector) - - // Find the object by name - objList, err := client.List(nil, nil, nil, nil, nil, nil) - if err != nil { - return handleListError("SpoofGuardProfiles", err) - } - for _, objInList := range objList.Results { - if *objInList.DisplayName == name { - err := client.Delete(*objInList.Id) - if err != nil { - return handleDeleteError("poofGuardProfile", *objInList.Id, err) - } - return nil - } - } - return fmt.Errorf("Error while deleting SpoofGuardProfile '%s': resource not found", name) -} - func testAccNsxtPolicySpoofGuardProfileReadTemplate(name string) string { return fmt.Sprintf(` data "nsxt_policy_spoofguard_profile" "test" { diff --git a/nsxt/data_source_nsxt_policy_tier0_gateway_test.go b/nsxt/data_source_nsxt_policy_tier0_gateway_test.go index ee7b47daf..25705179b 100644 --- a/nsxt/data_source_nsxt_policy_tier0_gateway_test.go +++ b/nsxt/data_source_nsxt_policy_tier0_gateway_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtPolicyTier0Gateway_basic(t *testing.T) { - routerName := "terraform_test_tier0" + routerName := "terraform_ds_test_tier0" testResourceName := "data.nsxt_policy_tier0_gateway.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyTier0DeleteByName(routerName) diff --git a/nsxt/data_source_nsxt_policy_tier1_gateway_test.go b/nsxt/data_source_nsxt_policy_tier1_gateway_test.go index 4355480a4..217659439 100644 --- a/nsxt/data_source_nsxt_policy_tier1_gateway_test.go +++ b/nsxt/data_source_nsxt_policy_tier1_gateway_test.go @@ -13,10 +13,10 @@ import ( ) func TestAccDataSourceNsxtPolicyTier1Gateway_basic(t *testing.T) { - routerName := "terraform_test_tier1" + routerName := "terraform_ds_test_tier1" testResourceName := "data.nsxt_policy_tier1_gateway.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { diff --git a/nsxt/data_source_nsxt_policy_transport_zone.go b/nsxt/data_source_nsxt_policy_transport_zone.go index 7ec449562..9db33156d 100644 --- a/nsxt/data_source_nsxt_policy_transport_zone.go +++ b/nsxt/data_source_nsxt_policy_transport_zone.go @@ -7,16 +7,18 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/sites/enforcement_points" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" + lm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "strings" ) var policyTransportZoneTransportTypes = [](string){ - model.PolicyTransportZone_TZ_TYPE_OVERLAY_STANDARD, - model.PolicyTransportZone_TZ_TYPE_OVERLAY_ENS, - model.PolicyTransportZone_TZ_TYPE_VLAN_BACKED, - model.PolicyTransportZone_TZ_TYPE_UNKNOWN, + lm_model.PolicyTransportZone_TZ_TYPE_OVERLAY_STANDARD, + lm_model.PolicyTransportZone_TZ_TYPE_OVERLAY_ENS, + lm_model.PolicyTransportZone_TZ_TYPE_VLAN_BACKED, + lm_model.PolicyTransportZone_TZ_TYPE_UNKNOWN, } func dataSourceNsxtPolicyTransportZone() *schema.Resource { @@ -41,11 +43,49 @@ func dataSourceNsxtPolicyTransportZone() *schema.Resource { Computed: true, ValidateFunc: validation.StringInSlice(policyTransportZoneTransportTypes, false), }, + "site_path": { + Type: schema.TypeString, + Description: "Path of the site this Transport Zone belongs to", + Optional: true, + ValidateFunc: validatePolicyPath(), + }, }, } } func dataSourceNsxtPolicyTransportZoneRead(d *schema.ResourceData, m interface{}) error { + objSitePath := d.Get("site_path").(string) + transportType := d.Get("transport_type").(string) + if !isPolicyGlobalManager(m) && objSitePath != "" { + return globalManagerOnlyError() + } + if isPolicyGlobalManager(m) { + if objSitePath == "" { + return attributeRequiredGlobalManagerError("site_path", "nsxt_policy_transport_zone") + } + query := make(map[string]string) + globalPolicyEnforcementPointPath := getGlobalPolicyEnforcementPointPath(m, &objSitePath) + query["parent_path"] = globalPolicyEnforcementPointPath + if transportType != "" { + query["tz_type"] = transportType + } + obj, err := policyDataSourceResourceRead(d, getPolicyConnector(m), "PolicyTransportZone", query) + if err != nil { + return err + } + converter := bindings.NewTypeConverter() + converter.SetMode(bindings.REST) + dataValue, errors := converter.ConvertToGolang(obj, gm_model.PolicyTransportZoneBindingType()) + if len(errors) > 0 { + return errors[0] + } + transportZoneResource := dataValue.(gm_model.PolicyTransportZone) + + d.Set("is_default", transportZoneResource.IsDefault) + d.Set("transport_type", transportZoneResource.TzType) + d.Set("parent_path", transportZoneResource.ParentPath) + return nil + } connector := getPolicyConnector(m) client := enforcement_points.NewDefaultTransportZonesClient(connector) @@ -54,8 +94,7 @@ func dataSourceNsxtPolicyTransportZoneRead(d *schema.ResourceData, m interface{} objName := d.Get("display_name").(string) defaultVal, isDefaultSet := d.GetOkExists("is_default") isDefault := isDefaultSet && defaultVal.(bool) - transportType := d.Get("transport_type").(string) - var obj model.PolicyTransportZone + var obj lm_model.PolicyTransportZone if objID != "" { // Get by id objGet, err := client.Get(defaultSite, getPolicyEnforcementPoint(m), objID) @@ -74,8 +113,8 @@ func dataSourceNsxtPolicyTransportZoneRead(d *schema.ResourceData, m interface{} return handleListError("TransportZone", err) } // go over the list to find the correct one (prefer a perfect match. If not - prefix match) - var perfectMatch []model.PolicyTransportZone - var prefixMatch []model.PolicyTransportZone + var perfectMatch []lm_model.PolicyTransportZone + var prefixMatch []lm_model.PolicyTransportZone for _, objInList := range objList.Results { if transportType != "" && transportType != *objInList.TzType { // no match for transport type diff --git a/nsxt/data_source_nsxt_policy_transport_zone_test.go b/nsxt/data_source_nsxt_policy_transport_zone_test.go index 6179da32e..dd51dfc09 100644 --- a/nsxt/data_source_nsxt_policy_transport_zone_test.go +++ b/nsxt/data_source_nsxt_policy_transport_zone_test.go @@ -13,8 +13,11 @@ func TestAccDataSourceNsxtPolicyTransportZone_basic(t *testing.T) { transportZoneName := getVlanTransportZoneName() testResourceName := "data.nsxt_policy_transport_zone.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccNSXGlobalManagerSitePrecheck(t) + }, Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -42,6 +45,9 @@ func TestAccDataSourceNsxtPolicyTransportZone_basic(t *testing.T) { } func testAccNSXPolicyTransportZoneReadTemplate(transportZoneName string) string { + if testAccIsGlobalManager() { + return testAccNSXGlobalPolicyTransportZoneReadTemplate(transportZoneName) + } return fmt.Sprintf(` data "nsxt_policy_transport_zone" "test" { display_name = "%s" @@ -49,9 +55,37 @@ data "nsxt_policy_transport_zone" "test" { } func testAccNSXPolicyTransportZoneWithTransportTypeTemplate(transportZoneName string) string { + if testAccIsGlobalManager() { + return testAccNSXGlobalPolicyTransportZoneWithTransportTypeTemplate(transportZoneName) + } return fmt.Sprintf(` data "nsxt_policy_transport_zone" "test" { display_name = "%s" transport_type = "VLAN_BACKED" }`, transportZoneName) } + +func testAccNSXGlobalPolicyTransportZoneReadTemplate(transportZoneName string) string { + return fmt.Sprintf(` +data "nsxt_policy_site" "test" { + display_name = "%s" +} + +data "nsxt_policy_transport_zone" "test" { + display_name = "%s" + site_path = data.nsxt_policy_site.test.path +}`, getTestSiteName(), transportZoneName) +} + +func testAccNSXGlobalPolicyTransportZoneWithTransportTypeTemplate(transportZoneName string) string { + return fmt.Sprintf(` +data "nsxt_policy_site" "test" { + display_name = "%s" +} + +data "nsxt_policy_transport_zone" "test" { + display_name = "%s" + site_path = data.nsxt_policy_site.test.path + transport_type = "VLAN_BACKED" +}`, getTestSiteName(), transportZoneName) +} diff --git a/nsxt/data_source_nsxt_policy_vm_test.go b/nsxt/data_source_nsxt_policy_vm_test.go index 2e3896276..32081b762 100644 --- a/nsxt/data_source_nsxt_policy_vm_test.go +++ b/nsxt/data_source_nsxt_policy_vm_test.go @@ -12,7 +12,7 @@ import ( func TestAccDataSourceNsxtPolicyVM_basic(t *testing.T) { testResourceName := "data.nsxt_policy_vm.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) testAccEnvDefined(t, "NSXT_TEST_VM_ID") diff --git a/nsxt/data_source_nsxt_policy_vni_pool_test.go b/nsxt/data_source_nsxt_policy_vni_pool_test.go index 83620a9ef..3ea92feae 100644 --- a/nsxt/data_source_nsxt_policy_vni_pool_test.go +++ b/nsxt/data_source_nsxt_policy_vni_pool_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtPolicyVniPoolConfig_basic(t *testing.T) { - name := "terraform_test" + name := "terraform_ds_test" testResourceName := "data.nsxt_policy_vni_pool.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccDataSourceNsxtPolicyVniPoolConfigDeleteByName(name) diff --git a/nsxt/data_source_nsxt_switching_profile_test.go b/nsxt/data_source_nsxt_switching_profile_test.go index 36e10ff6a..55d9c1b5a 100644 --- a/nsxt/data_source_nsxt_switching_profile_test.go +++ b/nsxt/data_source_nsxt_switching_profile_test.go @@ -13,11 +13,11 @@ import ( ) func TestAccDataSourceNsxtSwitchingProfile_basic(t *testing.T) { - profileName := "terraform_test_profile" + profileName := "terraform_ds_test_profile" profileType := "QosSwitchingProfile" testResourceName := "data.nsxt_switching_profile.test" - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { diff --git a/nsxt/data_source_nsxt_transport_zone_test.go b/nsxt/data_source_nsxt_transport_zone_test.go index fa47d25ae..3d2d94c78 100644 --- a/nsxt/data_source_nsxt_transport_zone_test.go +++ b/nsxt/data_source_nsxt_transport_zone_test.go @@ -13,8 +13,8 @@ func TestAccDataSourceNsxtTransportZone_basic(t *testing.T) { transportZoneName := getVlanTransportZoneName() testResourceName := "data.nsxt_transport_zone.test" - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/nsxt/gateway_common.go b/nsxt/gateway_common.go new file mode 100644 index 000000000..83ccf68e5 --- /dev/null +++ b/nsxt/gateway_common.go @@ -0,0 +1,357 @@ +package nsxt + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt" + global_policy "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" + "log" + "strings" +) + +func getFailoverModeSchema(defaultValue string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Description: "Failover mode", + Default: defaultValue, + Optional: true, + ValidateFunc: validation.StringInSlice(policyFailOverModeValues, false), + } +} + +func getIPv6NDRAPathSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Description: "The path of an IPv6 NDRA profile", + Optional: true, + Computed: true, + } +} + +func getIPv6DadPathSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Description: "The path of an IPv6 DAD profile", + Optional: true, + Computed: true, + } +} + +func getPolicyEdgeClusterPathSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Description: "The path of the edge cluster connected to this gateway", + Optional: true, + ValidateFunc: validatePolicyPath(), + } +} + +func getPolicyLocaleServiceSchema(isTier1 bool) *schema.Schema { + nodeConficts := []string{} + if isTier1 { + // for Tier1, enable_standby_relocation can not be enabled if + // preferred nodes are specified + nodeConficts = append(nodeConficts, "enable_standby_relocation") + } + return &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Description: "Locale Service for the gateway", + ConflictsWith: []string{"edge_cluster_path"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "edge_cluster_path": { + Type: schema.TypeString, + Description: "The path of the edge cluster connected to this gateway", + Required: true, + ValidateFunc: validatePolicyPath(), + }, + "preferred_edge_paths": { + Type: schema.TypeSet, + Description: "Paths of specific edge nodes", + Optional: true, + Elem: getElemPolicyPathSchema(), + ConflictsWith: nodeConficts, + }, + "path": getPathSchema(), + "revision": getRevisionSchema(), + }, + }, + } +} + +func getIpv6ProfilePathsFromSchema(d *schema.ResourceData) []string { + var profiles []string + if d.Get("ipv6_ndra_profile_path") != "" { + profiles = append(profiles, d.Get("ipv6_ndra_profile_path").(string)) + } + if d.Get("ipv6_dad_profile_path") != "" { + profiles = append(profiles, d.Get("ipv6_dad_profile_path").(string)) + } + return profiles +} + +func setIpv6ProfilePathsInSchema(d *schema.ResourceData, paths []string) error { + for _, path := range paths { + if strings.HasPrefix(path, "/infra/ipv6-ndra-profiles") { + d.Set("ipv6_ndra_profile_path", path) + } + if strings.HasPrefix(path, "/infra/ipv6-dad-profiles") { + d.Set("ipv6_dad_profile_path", path) + } + } + return nil +} + +func getGatewayInterfaceSubnetsSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Description: "List of IP addresses and network prefixes for this interface", + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateIPCidr(), + }, + Required: true, + } +} + +func getMtuSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeInt, + Optional: true, + Description: "Maximum transmission unit specifies the size of the largest packet that a network protocol can transmit", + ValidateFunc: validation.IntAtLeast(64), + } +} + +var gatewayInterfaceUrpfModeValues = []string{ + model.Tier0Interface_URPF_MODE_NONE, + model.Tier0Interface_URPF_MODE_STRICT, +} + +func getGatewayInterfaceUrpfModeSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Unicast Reverse Path Forwarding mode", + ValidateFunc: validation.StringInSlice(gatewayInterfaceUrpfModeValues, false), + Default: model.Tier0Interface_URPF_MODE_STRICT, + } +} + +func getGatewayIntersiteConfigSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Computed: true, + Description: "Locale Service for the gateway", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "transit_subnet": { + Type: schema.TypeString, + Description: "IPv4 subnet for inter-site transit segment connecting service routers across sites for stretched gateway. For IPv6 link local subnet is auto configured", + Computed: true, + Optional: true, + ForceNew: true, + ValidateFunc: validateCidr(), + }, + "primary_site_path": { + Type: schema.TypeString, + Description: "Primary egress site for gateway", + Optional: true, + ValidateFunc: validatePolicyPath(), + }, + "fallback_site_paths": { + Type: schema.TypeSet, + Description: "Fallback sites to be used as new primary site on current primary site failure", + Optional: true, + Elem: getElemPolicyPathSchema(), + }, + }, + }, + } +} + +func listPolicyGatewayLocaleServices(connector *client.RestConnector, gwID string, listLocaleServicesFunc func(*client.RestConnector, string, *string) (model.LocaleServicesListResult, error)) ([]model.LocaleServices, error) { + var results []model.LocaleServices + var cursor *string + var count int64 + total := int64(0) + + for { + listResponse, err := listLocaleServicesFunc(connector, gwID, cursor) + if err != nil { + return results, err + } + cursor = listResponse.Cursor + count = *listResponse.ResultCount + results = append(results, listResponse.Results...) + if total == 0 { + // first response + total = count + } + if int64(len(results)) >= total { + return results, nil + } + } +} + +func initChildLocaleService(serviceStruct *model.LocaleServices, markForDelete bool) (*data.StructValue, error) { + childService := model.ChildLocaleServices{ + ResourceType: "ChildLocaleServices", + LocaleServices: serviceStruct, + MarkedForDelete: &markForDelete, + } + + converter := bindings.NewTypeConverter() + converter.SetMode(bindings.REST) + dataValue, err := converter.ConvertToVapi(childService, model.ChildLocaleServicesBindingType()) + + if err != nil { + return nil, err[0] + } + + return dataValue.(*data.StructValue), nil +} + +func initGatewayLocaleServices(d *schema.ResourceData, connector *client.RestConnector, listLocaleServicesFunc func(*client.RestConnector, string, bool) ([]model.LocaleServices, error)) ([]*data.StructValue, error) { + var localeServices []*data.StructValue + + services := d.Get("locale_service").(*schema.Set).List() + + existingServices := make(map[string]bool) + if len(d.Id()) > 0 { + // This is an update - we might need to delete locale services + existingServiceObjects, errList := listLocaleServicesFunc(connector, d.Id(), true) + if errList != nil { + return nil, errList + } + + for _, obj := range existingServiceObjects { + existingServices[*obj.Id] = true + } + } + lsType := "LocaleServices" + for _, service := range services { + cfg := service.(map[string]interface{}) + edgeClusterPath := cfg["edge_cluster_path"].(string) + edgeNodes := interface2StringList(cfg["preferred_edge_paths"].(*schema.Set).List()) + path := cfg["path"].(string) + revision := int64(d.Get("revision").(int)) + + var serviceID string + if path != "" { + serviceID = getPolicyIDFromPath(path) + } else { + serviceID = newUUID() + log.Printf("[DEBUG] Preparing to create locale service %s for gateway %s", serviceID, d.Id()) + } + serviceStruct := model.LocaleServices{ + Id: &serviceID, + ResourceType: &lsType, + EdgeClusterPath: &edgeClusterPath, + PreferredEdgePaths: edgeNodes, + } + + if _, ok := existingServices[serviceID]; ok { + // if this is an update for existing locale service, + // we need revision + serviceStruct.Revision = &revision + } + + dataValue, err := initChildLocaleService(&serviceStruct, false) + if err != nil { + return localeServices, err + } + + localeServices = append(localeServices, dataValue) + existingServices[serviceID] = false + } + // Add instruction to delete services that are no longer present in intent + for id, shouldDelete := range existingServices { + if shouldDelete { + serviceStruct := model.LocaleServices{ + Id: &id, + ResourceType: &lsType, + } + dataValue, err := initChildLocaleService(&serviceStruct, true) + if err != nil { + return localeServices, err + } + localeServices = append(localeServices, dataValue) + log.Printf("[DEBUG] Preparing to delete locale service %s for gateway %s", id, d.Id()) + } + } + + return localeServices, nil +} + +func getPolicyGatewayIntersiteConfigFromSchema(d *schema.ResourceData) *model.IntersiteGatewayConfig { + cfg, isSet := d.GetOk("intersite_config") + if !isSet { + return nil + } + + configs := cfg.([]interface{}) + for _, elem := range configs { + data := elem.(map[string]interface{}) + + subnet := data["transit_subnet"].(string) + primarySitePath := data["primary_site_path"].(string) + fallbackSites := interface2StringList(data["fallback_site_paths"].(*schema.Set).List()) + intersiteConfig := model.IntersiteGatewayConfig{ + PrimarySitePath: &primarySitePath, + FallbackSites: fallbackSites, + } + if len(subnet) > 0 { + intersiteConfig.IntersiteTransitSubnet = &subnet + } + + return &intersiteConfig + } + + return nil +} + +func setPolicyGatewayIntersiteConfigInSchema(d *schema.ResourceData, config *model.IntersiteGatewayConfig) error { + if config == nil { + return nil + } + + var result []map[string]interface{} + elem := make(map[string]interface{}) + + if config.IntersiteTransitSubnet != nil { + elem["transit_subnet"] = config.IntersiteTransitSubnet + } + + if config.PrimarySitePath != nil { + elem["primary_site_path"] = config.PrimarySitePath + } + + elem["fallback_site_paths"] = config.FallbackSites + result = append(result, elem) + + return d.Set("intersite_config", result) +} + +func policyInfraPatch(obj model.Infra, isGlobalManager bool, connector *client.RestConnector, enforceRevision bool) error { + if isGlobalManager { + infraClient := global_policy.NewDefaultGlobalInfraClient(connector) + gmObj, err := convertModelBindingType(obj, model.InfraBindingType(), gm_model.InfraBindingType()) + if err != nil { + return err + } + + return infraClient.Patch(gmObj.(gm_model.Infra), &enforceRevision) + } + + infraClient := nsx_policy.NewDefaultInfraClient(connector) + return infraClient.Patch(obj, &enforceRevision) +} diff --git a/nsxt/policy_common.go b/nsxt/policy_common.go index f1868b3a9..a2061b502 100644 --- a/nsxt/policy_common.go +++ b/nsxt/policy_common.go @@ -1,6 +1,7 @@ package nsxt import ( + "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" @@ -75,43 +76,7 @@ func getDomainNameSchema() *schema.Schema { Description: "The domain name to use for resources. If not specified 'default' is used", Optional: true, Default: defaultDomain, - } -} - -func getFailoverModeSchema(defaultValue string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeString, - Description: "Failover mode", - Default: defaultValue, - Optional: true, - ValidateFunc: validation.StringInSlice(policyFailOverModeValues, false), - } -} - -func getIPv6NDRAPathSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeString, - Description: "The path of an IPv6 NDRA profile", - Optional: true, - Computed: true, - } -} - -func getIPv6DadPathSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeString, - Description: "The path of an IPv6 DAD profile", - Optional: true, - Computed: true, - } -} - -func getPolicyEdgeClusterPathSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeString, - Description: "The path of the edge cluster connected to this gateway", - Optional: true, - ValidateFunc: validatePolicyPath(), + ForceNew: true, } } @@ -438,29 +403,6 @@ func getDataSourceIDSchema() *schema.Schema { return getDataSourceStringSchema("Unique ID of this resource") } -func getIpv6ProfilePathsFromSchema(d *schema.ResourceData) []string { - var profiles []string - if d.Get("ipv6_ndra_profile_path") != "" { - profiles = append(profiles, d.Get("ipv6_ndra_profile_path").(string)) - } - if d.Get("ipv6_dad_profile_path") != "" { - profiles = append(profiles, d.Get("ipv6_dad_profile_path").(string)) - } - return profiles -} - -func setIpv6ProfilePathsInSchema(d *schema.ResourceData, paths []string) error { - for _, path := range paths { - if strings.HasPrefix(path, "/infra/ipv6-ndra-profiles") { - d.Set("ipv6_ndra_profile_path", path) - } - if strings.HasPrefix(path, "/infra/ipv6-dad-profiles") { - d.Set("ipv6_dad_profile_path", path) - } - } - return nil -} - func parseGatewayPolicyPath(gwPath string) (bool, string) { // sample path looks like "/infra/tier-0s/mytier0gw" isT0 := true @@ -489,27 +431,6 @@ func getElemPolicyPathSchema() *schema.Schema { } } -func getGatewayInterfaceSubnetsSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Description: "List of IP addresses and network prefixes for this interface", - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validateIPCidr(), - }, - Required: true, - } -} - -func getMtuSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Description: "Maximum transmission unit specifies the size of the largest packet that a network protocol can transmit", - ValidateFunc: validation.IntAtLeast(64), - } -} - func getAllocationRangeListSchema(required bool, description string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, @@ -535,17 +456,25 @@ func getAllocationRangeListSchema(required bool, description string) *schema.Sch } } -var gatewayInterfaceUrpfModeValues = []string{ - model.Tier0Interface_URPF_MODE_NONE, - model.Tier0Interface_URPF_MODE_STRICT, +func globalManagerOnlyError() error { + return fmt.Errorf("This configuration is only supported with NSX Global Manager. To mark your endpoint as Global Manager, please set 'global_manager' flag to 'true' in the provider.") } -func getGatewayInterfaceUrpfModeSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Unicast Reverse Path Forwarding mode", - ValidateFunc: validation.StringInSlice(gatewayInterfaceUrpfModeValues, false), - Default: model.Tier0Interface_URPF_MODE_STRICT, +func attributeRequiredGlobalManagerError(attribute string, resource string) error { + return fmt.Errorf("%s requires %s configuration for NSX Global Manager.", resource, attribute) +} + +func buildQueryStringFromMap(query map[string]string) string { + if query == nil { + return "" + } + keyValues := make([]string, 0, len(query)) + for key, value := range query { + if strings.Contains(value, "/") { + value = strings.Replace(value, "/", "\\/", -1) + } + keyValue := strings.Join([]string{key, value}, ":") + keyValues = append(keyValues, keyValue) } + return strings.Join(keyValues, " AND ") } diff --git a/nsxt/policy_gm_search.go b/nsxt/policy_gm_search.go new file mode 100644 index 000000000..7c8642f8d --- /dev/null +++ b/nsxt/policy_gm_search.go @@ -0,0 +1,172 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: MPL-2.0 */ + +package nsxt + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search" + "strings" +) + +type policySearchDataValue struct { + StructValue *data.StructValue + Resource model.PolicyResource +} + +func policyDataSourceResourceFilterAndSet(d *schema.ResourceData, resultValues []*data.StructValue, resourceType string) (*data.StructValue, error) { + var perfectMatch, prefixMatch []policySearchDataValue + var obj policySearchDataValue + objName := d.Get("display_name").(string) + objID := d.Get("id").(string) + converter := bindings.NewTypeConverter() + converter.SetMode(bindings.REST) + + for _, result := range resultValues { + dataValue, errors := converter.ConvertToGolang(result, model.PolicyResourceBindingType()) + if len(errors) > 0 { + return nil, errors[0] + } + policyResource := dataValue.(model.PolicyResource) + + if objID != "" && resourceType == *policyResource.ResourceType { + perfectMatch = append(perfectMatch, policySearchDataValue{StructValue: result, Resource: policyResource}) + continue + } + if *policyResource.DisplayName == objName { + perfectMatch = append(perfectMatch, policySearchDataValue{StructValue: result, Resource: policyResource}) + } + if strings.HasPrefix(*policyResource.DisplayName, objName) { + prefixMatch = append(prefixMatch, policySearchDataValue{StructValue: result, Resource: policyResource}) + } + } + + if len(perfectMatch) > 0 { + if len(perfectMatch) > 1 { + if objID != "" { + return nil, fmt.Errorf("Found multiple %s with ID '%s'", resourceType, objID) + } + return nil, fmt.Errorf("Found multiple %s with name '%s'", resourceType, objName) + } + obj = perfectMatch[0] + } else if len(prefixMatch) > 0 { + if len(prefixMatch) > 1 { + return nil, fmt.Errorf("Found multiple %s with name starting with '%s'", resourceType, objName) + } + obj = prefixMatch[0] + } else { + if objID != "" { + return nil, fmt.Errorf("%s with ID '%s' was not found", resourceType, objID) + } + return nil, fmt.Errorf("%s with name '%s' was not found", resourceType, objName) + } + + d.SetId(*obj.Resource.Id) + d.Set("display_name", obj.Resource.DisplayName) + d.Set("description", obj.Resource.Description) + d.Set("path", obj.Resource.Path) + + return obj.StructValue, nil +} + +func policyDataSourceResourceRead(d *schema.ResourceData, connector *client.RestConnector, resourceType string, additionalQuery map[string]string) (*data.StructValue, error) { + return policyDataSourceResourceReadWithValidation(d, connector, resourceType, additionalQuery, true) +} + +func policyDataSourceResourceReadWithValidation(d *schema.ResourceData, connector *client.RestConnector, resourceType string, additionalQuery map[string]string, paramsValidation bool) (*data.StructValue, error) { + objName := d.Get("display_name").(string) + objID := d.Get("id").(string) + var err error + var resultValues []*data.StructValue + additionalQueryString := buildQueryStringFromMap(additionalQuery) + if paramsValidation && objID == "" && objName == "" { + return nil, fmt.Errorf("No 'id' or 'display_name' specified for %s", resourceType) + } + if objID != "" { + resultValues, err = listPolicyResourcesByID(connector, &objID, &additionalQueryString) + } else { + resultValues, err = listPolicyResourcesByType(connector, &resourceType, &additionalQueryString) + } + if err != nil { + return nil, err + } + + return policyDataSourceResourceFilterAndSet(d, resultValues, resourceType) +} + +func listPolicyResourcesByType(connector *client.RestConnector, resourceType *string, additionalQuery *string) ([]*data.StructValue, error) { + query := fmt.Sprintf("resource_type:%s", *resourceType) + return searchPolicyResources(connector, *buildPolicyResourcesQuery(&query, additionalQuery)) +} + +func listPolicyResourcesByID(connector *client.RestConnector, resourceID *string, additionalQuery *string) ([]*data.StructValue, error) { + query := fmt.Sprintf("id:%s", *resourceID) + return searchPolicyResources(connector, *buildPolicyResourcesQuery(&query, additionalQuery)) +} + +func searchPolicyResources(connector *client.RestConnector, query string) ([]*data.StructValue, error) { + client := search.NewDefaultQueryClient(connector) + var results []*data.StructValue + var cursor *string + total := 0 + + for { + searchResponse, err := client.List(query, cursor, nil, nil, nil, nil) + if err != nil { + return results, err + } + results = append(results, searchResponse.Results...) + if total == 0 { + // first response + total = int(*searchResponse.ResultCount) + } + cursor = searchResponse.Cursor + if len(results) >= total { + return results, nil + } + } +} + +func searchPolicyResourcesTyped(connector *client.RestConnector, query string) ([]model.PolicyResource, error) { + converter := bindings.NewTypeConverter() + converter.SetMode(bindings.REST) + client := search.NewDefaultQueryClient(connector) + var results []model.PolicyResource + var cursor *string + total := 0 + + for { + searchResponse, err := client.List(query, cursor, nil, nil, nil, nil) + if err != nil { + return results, err + } + for _, result := range searchResponse.Results { + dataValue, errors := converter.ConvertToGolang(result, model.PolicyResourceBindingType()) + if len(errors) > 0 { + return nil, errors[0] + } + results = append(results, dataValue.(model.PolicyResource)) + } + + if total == 0 { + // first response + total = int(*searchResponse.ResultCount) + } + cursor = searchResponse.Cursor + if len(results) >= total { + return results, nil + } + } +} + +func buildPolicyResourcesQuery(query *string, additionalQuery *string) *string { + if additionalQuery != nil && *additionalQuery != "" { + *query = *query + " AND " + *additionalQuery + } + return query +} diff --git a/nsxt/policy_utils.go b/nsxt/policy_utils.go index c51a4bfe2..350dba945 100644 --- a/nsxt/policy_utils.go +++ b/nsxt/policy_utils.go @@ -8,6 +8,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/realized_state" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" @@ -15,13 +16,16 @@ import ( "time" ) -func getOrGenerateID(d *schema.ResourceData, connector *client.RestConnector, presenceChecker func(string, *client.RestConnector) bool) (string, error) { +func getOrGenerateID(d *schema.ResourceData, m interface{}, presenceChecker func(string, *client.RestConnector, bool) bool) (string, error) { + connector := getPolicyConnector(m) + isGlobalManager := isPolicyGlobalManager(m) + id := d.Get("nsx_id").(string) if id == "" { return newUUID(), nil } - if presenceChecker(id, connector) { + if presenceChecker(id, connector, isGlobalManager) { return "", fmt.Errorf("Resource with id %s already exists", id) } @@ -216,3 +220,19 @@ func nsxtPolicyWaitForRealizationStateConf(connector *client.RestConnector, d *s func getPolicyEnforcementPointPath(m interface{}) string { return "/infra/sites/default/enforcement-points/" + getPolicyEnforcementPoint(m) } + +func convertModelBindingType(obj interface{}, sourceType bindings.BindingType, destType bindings.BindingType) (interface{}, error) { + converter := bindings.NewTypeConverter() + converter.SetMode(bindings.REST) + dataValue, err := converter.ConvertToVapi(obj, sourceType) + if err != nil { + return nil, err[0] + } + + gmObj, err := converter.ConvertToGolang(dataValue, destType) + if err != nil { + return nil, err[0] + } + + return gmObj, nil +} diff --git a/nsxt/provider.go b/nsxt/provider.go index bcf16cef4..709820f0b 100644 --- a/nsxt/provider.go +++ b/nsxt/provider.go @@ -44,6 +44,7 @@ type nsxtClients struct { Host string PolicyEnforcementPoint string PolicySite string + PolicyGlobalManager bool } // Provider for VMWare NSX-T. Returns terraform.ResourceProvider @@ -145,6 +146,12 @@ func Provider() terraform.ResourceProvider { Description: "Enforcement Point for NSXT Policy", DefaultFunc: schema.EnvDefaultFunc("NSXT_POLICY_ENFORCEMENT_POINT", "default"), }, + "global_manager": { + Type: schema.TypeBool, + Optional: true, + Description: "Is this a policy global manager endpoint", + DefaultFunc: schema.EnvDefaultFunc("NSXT_GLOBAL_MANAGER", false), + }, }, DataSourcesMap: map[string]*schema.Resource{ @@ -185,6 +192,7 @@ func Provider() terraform.ResourceProvider { "nsxt_policy_vni_pool": dataSourceNsxtPolicyVniPool(), "nsxt_policy_ip_block": dataSourceNsxtPolicyIPBlock(), "nsxt_policy_ip_pool": dataSourceNsxtPolicyIPPool(), + "nsxt_policy_site": dataSourceNsxtPolicySite(), }, ResourcesMap: map[string]*schema.Resource{ @@ -442,6 +450,7 @@ func configurePolicyConnectorData(d *schema.ResourceData, clients *nsxtClients) clientAuthKeyFile := d.Get("client_auth_key_file").(string) caFile := d.Get("ca_file").(string) policyEnforcementPoint := d.Get("enforcement_point").(string) + policyGlobalManager := d.Get("global_manager").(bool) if hostIP == "" { return fmt.Errorf("host must be provided") @@ -500,6 +509,7 @@ func configurePolicyConnectorData(d *schema.ResourceData, clients *nsxtClients) clients.Host = host clients.PolicyEnforcementPoint = policyEnforcementPoint clients.PolicySite = policySite + clients.PolicyGlobalManager = policyGlobalManager return nil } @@ -568,6 +578,14 @@ func getPolicySite(clients interface{}) string { return clients.(nsxtClients).PolicySite } +func isPolicyGlobalManager(clients interface{}) bool { + return clients.(nsxtClients).PolicyGlobalManager +} + func getCommonProviderConfig(clients interface{}) commonProviderConfig { return clients.(nsxtClients).CommonConfig } + +func getGlobalPolicyEnforcementPointPath(m interface{}, sitePath *string) string { + return fmt.Sprintf("%s/enforcement-points/%s", *sitePath, getPolicyEnforcementPoint(m)) +} diff --git a/nsxt/resource_nsxt_algorithm_type_ns_service_test.go b/nsxt/resource_nsxt_algorithm_type_ns_service_test.go index ddd4adf89..a07f2ab70 100644 --- a/nsxt/resource_nsxt_algorithm_type_ns_service_test.go +++ b/nsxt/resource_nsxt_algorithm_type_ns_service_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtAlgorithmTypeNsService_basic(t *testing.T) { updatedDestPort := "21" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXAlgServiceCheckDestroy(state, serviceName) @@ -57,7 +57,7 @@ func TestAccResourceNsxtAlgorithmTypeNsService_importBasic(t *testing.T) { serviceName := fmt.Sprintf("test-nsx-alg-service") testResourceName := "nsxt_algorithm_type_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXAlgServiceCheckDestroy(state, serviceName) diff --git a/nsxt/resource_nsxt_dhcp_relay_profile_test.go b/nsxt/resource_nsxt_dhcp_relay_profile_test.go index 5feb2023d..89673113c 100644 --- a/nsxt/resource_nsxt_dhcp_relay_profile_test.go +++ b/nsxt/resource_nsxt_dhcp_relay_profile_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtDhcpRelayProfile_basic(t *testing.T) { testResourceName := "nsxt_dhcp_relay_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXDhcpRelayProfileCheckDestroy(state, prfName) @@ -52,7 +52,7 @@ func TestAccResourceNsxtDhcpRelayProfile_importBasic(t *testing.T) { testResourceName := "nsxt_dhcp_relay_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXDhcpRelayProfileCheckDestroy(state, prfName) diff --git a/nsxt/resource_nsxt_dhcp_server_ip_pool_test.go b/nsxt/resource_nsxt_dhcp_server_ip_pool_test.go index f96c6a448..262429e6d 100644 --- a/nsxt/resource_nsxt_dhcp_server_ip_pool_test.go +++ b/nsxt/resource_nsxt_dhcp_server_ip_pool_test.go @@ -26,7 +26,7 @@ func TestAccResourceNsxtDhcpServerIPPool_basic(t *testing.T) { updatedLeaseTime := "1000000" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXDhcpServerIPPoolCheckDestroy(state, name) @@ -93,7 +93,7 @@ func TestAccResourceNsxtDhcpServerIPPool_noOpts(t *testing.T) { end2 := "1.1.1.160" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXDhcpServerIPPoolCheckDestroy(state, name) @@ -139,7 +139,7 @@ func TestAccResourceNsxtDhcpServerIPPool_Import(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNATRuleCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_dhcp_server_profile_test.go b/nsxt/resource_nsxt_dhcp_server_profile_test.go index 887c9add0..c4f3d20dd 100644 --- a/nsxt/resource_nsxt_dhcp_server_profile_test.go +++ b/nsxt/resource_nsxt_dhcp_server_profile_test.go @@ -18,7 +18,7 @@ func TestAccResourceNsxtDhcpServerProfile_basic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXDhcpServerProfileCheckDestroy(state, prfName) @@ -54,7 +54,7 @@ func TestAccResourceNsxtDhcpServerProfile_importBasic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXDhcpServerProfileCheckDestroy(state, prfName) diff --git a/nsxt/resource_nsxt_ether_type_ns_service_test.go b/nsxt/resource_nsxt_ether_type_ns_service_test.go index d5e10f105..e880d2278 100644 --- a/nsxt/resource_nsxt_ether_type_ns_service_test.go +++ b/nsxt/resource_nsxt_ether_type_ns_service_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtEtherTypeNsService_basic(t *testing.T) { testResourceName := "nsxt_ether_type_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXEtherServiceCheckDestroy(state, serviceName) @@ -52,7 +52,7 @@ func TestAccResourceNsxtEtherTypeNsService_importBasic(t *testing.T) { testResourceName := "nsxt_ether_type_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXEtherServiceCheckDestroy(state, serviceName) diff --git a/nsxt/resource_nsxt_firewall_section_test.go b/nsxt/resource_nsxt_firewall_section_test.go index 8cf44b94f..dc490a42d 100644 --- a/nsxt/resource_nsxt_firewall_section_test.go +++ b/nsxt/resource_nsxt_firewall_section_test.go @@ -20,7 +20,7 @@ func TestAccResourceNsxtFirewallSection_basic(t *testing.T) { tos := "" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) @@ -75,7 +75,7 @@ target_id = "${nsxt_ns_group.grp2.id}" }` resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) @@ -122,7 +122,7 @@ func TestAccResourceNsxtFirewallSection_withRules(t *testing.T) { ruleTos := "" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) @@ -172,7 +172,7 @@ func TestAccResourceNsxtFirewallSection_withRulesAndTags(t *testing.T) { tos := "" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) @@ -236,7 +236,7 @@ applied_to { }` resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) @@ -280,7 +280,7 @@ func TestAccResourceNsxtFirewallSection_ordered(t *testing.T) { testResourceNames := [4]string{"nsxt_firewall_section.test1", "nsxt_firewall_section.test2", "nsxt_firewall_section.test3", "nsxt_firewall_section.test4"} resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { for i := 0; i <= 3; i++ { @@ -337,7 +337,7 @@ func TestAccResourceNsxtFirewallSection_edge(t *testing.T) { testResourceName := "nsxt_firewall_section.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.4.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.4.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) @@ -382,7 +382,7 @@ func TestAccResourceNsxtFirewallSection_importBasic(t *testing.T) { tos := string("") resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) @@ -408,7 +408,7 @@ func TestAccResourceNsxtFirewallSection_importWithRules(t *testing.T) { tos := string("") resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) @@ -436,7 +436,7 @@ target_id = "${nsxt_ns_group.grp1.id}" }` resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXFirewallSectionCheckDestroy(state, sectionName) diff --git a/nsxt/resource_nsxt_icmp_type_ns_service_test.go b/nsxt/resource_nsxt_icmp_type_ns_service_test.go index 6bc9a378d..558c9c6df 100644 --- a/nsxt/resource_nsxt_icmp_type_ns_service_test.go +++ b/nsxt/resource_nsxt_icmp_type_ns_service_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtIcmpTypeNsService_basic(t *testing.T) { testResourceName := "nsxt_icmp_type_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIcmpServiceCheckDestroy(state, serviceName) @@ -56,7 +56,7 @@ func TestAccResourceNsxtIcmpTypeNsService_importBasic(t *testing.T) { testResourceName := "nsxt_icmp_type_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIcmpServiceCheckDestroy(state, serviceName) diff --git a/nsxt/resource_nsxt_igmp_type_ns_service_test.go b/nsxt/resource_nsxt_igmp_type_ns_service_test.go index 358af556c..3ad98ef8d 100644 --- a/nsxt/resource_nsxt_igmp_type_ns_service_test.go +++ b/nsxt/resource_nsxt_igmp_type_ns_service_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtIgmpTypeNsService_basic(t *testing.T) { testResourceName := "nsxt_igmp_type_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIgmpServiceCheckDestroy(state, serviceName) @@ -50,7 +50,7 @@ func TestAccResourceNsxtIgmpTypeNsService_importBasic(t *testing.T) { testResourceName := "nsxt_igmp_type_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIgmpServiceCheckDestroy(state, serviceName) diff --git a/nsxt/resource_nsxt_ip_block_subnet_test.go b/nsxt/resource_nsxt_ip_block_subnet_test.go index 9f1645f8e..e7a0d55c1 100644 --- a/nsxt/resource_nsxt_ip_block_subnet_test.go +++ b/nsxt/resource_nsxt_ip_block_subnet_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtIpBlockSubnet_basic(t *testing.T) { testResourceName := "nsxt_ip_block_subnet.test" size := 16 resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.4.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.4.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpBlockSubnetCheckDestroy(state, name) @@ -63,7 +63,7 @@ func TestAccResourceNsxtIpBlockSubnet_importBasic(t *testing.T) { testResourceName := "nsxt_ip_block_subnet.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.4.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.4.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpBlockSubnetCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_ip_discovery_switching_profile_test.go b/nsxt/resource_nsxt_ip_discovery_switching_profile_test.go index 2698cbcc2..e6d78259d 100644 --- a/nsxt/resource_nsxt_ip_discovery_switching_profile_test.go +++ b/nsxt/resource_nsxt_ip_discovery_switching_profile_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtIpDiscoverySwitchingProfile_basic(t *testing.T) { testResourceName := "nsxt_ip_discovery_switching_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpDiscoverySwitchingProfileCheckDestroy(state, name) @@ -64,7 +64,7 @@ func TestAccResourceNsxtIpDiscoverySwitchingProfile_importBasic(t *testing.T) { name := "test-nsx-application-profile" testResourceName := "nsxt_ip_discovery_switching_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpDiscoverySwitchingProfileCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_ip_pool_allocation_ip_address_test.go b/nsxt/resource_nsxt_ip_pool_allocation_ip_address_test.go index 0a96975ac..dee3a03ed 100644 --- a/nsxt/resource_nsxt_ip_pool_allocation_ip_address_test.go +++ b/nsxt/resource_nsxt_ip_pool_allocation_ip_address_test.go @@ -22,7 +22,7 @@ var testAccIPPoolName = "data.nsxt_ip_pool.acceptance_test" func TestAccResourceNsxtIPPoolAllocationIPAddress_basic(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_IP_POOL") }, + PreCheck: func() { testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_IP_POOL"); testAccOnlyLocalManager(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIPPoolAllocationIPAddressCheckDestroy(state) @@ -43,7 +43,7 @@ func TestAccResourceNsxtIPPoolAllocationIPAddress_basic(t *testing.T) { func TestAccResourceNsxtIPPoolAllocationIPAddress_import(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_IP_POOL") }, + PreCheck: func() { testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_IP_POOL"); testAccOnlyLocalManager(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIPPoolAllocationIPAddressCheckDestroy(state) diff --git a/nsxt/resource_nsxt_ip_pool_test.go b/nsxt/resource_nsxt_ip_pool_test.go index ee80d99e6..99e68debd 100644 --- a/nsxt/resource_nsxt_ip_pool_test.go +++ b/nsxt/resource_nsxt_ip_pool_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtIpPool_basic(t *testing.T) { testResourceName := "nsxt_ip_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpPoolCheckDestroy(state, name) @@ -57,7 +57,7 @@ func TestAccResourceNsxtIpPool_importBasic(t *testing.T) { testResourceName := "nsxt_ip_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpPoolCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_ip_protocol_ns_service_test.go b/nsxt/resource_nsxt_ip_protocol_ns_service_test.go index 708da9fad..44dd7b98a 100644 --- a/nsxt/resource_nsxt_ip_protocol_ns_service_test.go +++ b/nsxt/resource_nsxt_ip_protocol_ns_service_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtIpProtocolNsService_basic(t *testing.T) { testResourceName := "nsxt_ip_protocol_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpProtocolServiceCheckDestroy(state, serviceName) @@ -52,7 +52,7 @@ func TestAccResourceNsxtIpProtocolNsService_importBasic(t *testing.T) { testResourceName := "nsxt_ip_protocol_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpProtocolServiceCheckDestroy(state, serviceName) diff --git a/nsxt/resource_nsxt_ip_set_test.go b/nsxt/resource_nsxt_ip_set_test.go index d2aba5247..55f75129c 100644 --- a/nsxt/resource_nsxt_ip_set_test.go +++ b/nsxt/resource_nsxt_ip_set_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtIpSet_basic(t *testing.T) { testResourceName := "nsxt_ip_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpSetCheckDestroy(state, name) @@ -52,7 +52,7 @@ func TestAccResourceNsxtIpSet_noName(t *testing.T) { testResourceName := "nsxt_ip_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpSetCheckDestroy(state, name) @@ -87,7 +87,7 @@ func TestAccResourceNsxtIpSet_importBasic(t *testing.T) { testResourceName := "nsxt_ip_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXIpSetCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_l4_port_set_ns_service_test.go b/nsxt/resource_nsxt_l4_port_set_ns_service_test.go index 094a1814f..00be571d9 100644 --- a/nsxt/resource_nsxt_l4_port_set_ns_service_test.go +++ b/nsxt/resource_nsxt_l4_port_set_ns_service_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtL4PortNsService_basic(t *testing.T) { testResourceName := "nsxt_l4_port_set_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXL4ServiceCheckDestroy(state, serviceName) @@ -52,7 +52,7 @@ func TestAccResourceNsxtL4PortNsService_importBasic(t *testing.T) { testResourceName := "nsxt_l4_port_set_ns_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXL4ServiceCheckDestroy(state, serviceName) diff --git a/nsxt/resource_nsxt_lb_client_ssl_profile_test.go b/nsxt/resource_nsxt_lb_client_ssl_profile_test.go index e840eb4c0..d471a806c 100644 --- a/nsxt/resource_nsxt_lb_client_ssl_profile_test.go +++ b/nsxt/resource_nsxt_lb_client_ssl_profile_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtLbClientSSLProfile_basic(t *testing.T) { testResourceName := "nsxt_lb_client_ssl_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbClientSSLProfileCheckDestroy(state, name) @@ -61,7 +61,7 @@ func TestAccResourceNsxtLbClientSSLProfile_importBasic(t *testing.T) { name := "test" testResourceName := "nsxt_lb_client_ssl_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbClientSSLProfileCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_cookie_persistence_profile_test.go b/nsxt/resource_nsxt_lb_cookie_persistence_profile_test.go index 5496b96c2..fac2ed254 100644 --- a/nsxt/resource_nsxt_lb_cookie_persistence_profile_test.go +++ b/nsxt/resource_nsxt_lb_cookie_persistence_profile_test.go @@ -21,7 +21,7 @@ func TestAccResourceNsxtLbCookiePersistenceProfile_basic(t *testing.T) { updatedCookieName := "new_cookie" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbCookiePersistenceProfileCheckDestroy(state, name) @@ -71,7 +71,7 @@ func TestAccResourceNsxtLbCookiePersistenceProfile_insertMode(t *testing.T) { updatedCookiePath := "/subfolder1" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbCookiePersistenceProfileCheckDestroy(state, name) @@ -125,7 +125,7 @@ func TestAccResourceNsxtLbCookiePersistenceProfile_importBasic(t *testing.T) { name := "test-nsx-persistence-profile" testResourceName := "nsxt_lb_cookie_persistence_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbCookiePersistenceProfileCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_fast_tcp_application_profile_test.go b/nsxt/resource_nsxt_lb_fast_tcp_application_profile_test.go index eb31962ca..f675a0e97 100644 --- a/nsxt/resource_nsxt_lb_fast_tcp_application_profile_test.go +++ b/nsxt/resource_nsxt_lb_fast_tcp_application_profile_test.go @@ -23,7 +23,7 @@ func TestAccResourceNsxtLbFastTCPApplicationProfile_basic(t *testing.T) { updatedMirroring := "false" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbFastTCPApplicationProfileCheckDestroy(state, name) @@ -60,7 +60,7 @@ func TestAccResourceNsxtLbFastTCPApplicationProfile_importBasic(t *testing.T) { name := "test-nsx-application-profile" testResourceName := "nsxt_lb_fast_tcp_application_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbFastTCPApplicationProfileCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_fast_udp_application_profile_test.go b/nsxt/resource_nsxt_lb_fast_udp_application_profile_test.go index d066bc80a..6df29a4ba 100644 --- a/nsxt/resource_nsxt_lb_fast_udp_application_profile_test.go +++ b/nsxt/resource_nsxt_lb_fast_udp_application_profile_test.go @@ -21,7 +21,7 @@ func TestAccResourceNsxtLbFastUDPApplicationProfile_basic(t *testing.T) { updatedMirroring := "false" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbFastUDPApplicationProfileCheckDestroy(state, name) @@ -56,7 +56,7 @@ func TestAccResourceNsxtLbFastUDPApplicationProfile_importBasic(t *testing.T) { name := "test-nsx-application-profile" testResourceName := "nsxt_lb_fast_udp_application_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbFastUDPApplicationProfileCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_http_application_profile_test.go b/nsxt/resource_nsxt_lb_http_application_profile_test.go index 58bd4ff26..883459f41 100644 --- a/nsxt/resource_nsxt_lb_http_application_profile_test.go +++ b/nsxt/resource_nsxt_lb_http_application_profile_test.go @@ -34,7 +34,7 @@ func TestAccResourceNsxtLbHTTPApplicationProfile_basic(t *testing.T) { upNtlm := "false" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPApplicationProfileCheckDestroy(state, name) @@ -74,7 +74,7 @@ func TestAccResourceNsxtLbHTTPApplicationProfile_importBasic(t *testing.T) { name := "test" testResourceName := "nsxt_lb_http_application_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPApplicationProfileCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_http_forwarding_rule_test.go b/nsxt/resource_nsxt_lb_http_forwarding_rule_test.go index 9c559019c..ef2649518 100644 --- a/nsxt/resource_nsxt_lb_http_forwarding_rule_test.go +++ b/nsxt/resource_nsxt_lb_http_forwarding_rule_test.go @@ -20,7 +20,7 @@ func TestAccResourceNsxtLbHttpForwardingRule_basic(t *testing.T) { updatedMatchType := "ENDS_WITH" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPForwardingRuleCheckDestroy(state, name) @@ -146,7 +146,7 @@ func TestAccResourceNsxtLbHttpForwardingRule_importBasic(t *testing.T) { name := "test" resourceName := "nsxt_lb_http_forwarding_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPForwardingRuleCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_http_request_rewrite_rule_test.go b/nsxt/resource_nsxt_lb_http_request_rewrite_rule_test.go index 146d901f9..fc8a6e335 100644 --- a/nsxt/resource_nsxt_lb_http_request_rewrite_rule_test.go +++ b/nsxt/resource_nsxt_lb_http_request_rewrite_rule_test.go @@ -20,7 +20,7 @@ func TestAccResourceNsxtLbHttpRequestRewriteRule_basic(t *testing.T) { updatedMatchType := "ENDS_WITH" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPRequestRewriteRuleCheckDestroy(state, name) @@ -174,7 +174,7 @@ func TestAccResourceNsxtLbHttpRequestRewriteRule_importBasic(t *testing.T) { name := "test" resourceName := "nsxt_lb_http_request_rewrite_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPRequestRewriteRuleCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_http_response_rewrite_rule_test.go b/nsxt/resource_nsxt_lb_http_response_rewrite_rule_test.go index a3b4aa4d9..b04a46a0a 100644 --- a/nsxt/resource_nsxt_lb_http_response_rewrite_rule_test.go +++ b/nsxt/resource_nsxt_lb_http_response_rewrite_rule_test.go @@ -20,7 +20,7 @@ func TestAccResourceNsxtLbHttpResponseRewriteRule_basic(t *testing.T) { updatedMatchType := "REGEX" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPResponseRewriteRuleCheckDestroy(state, name) @@ -140,7 +140,7 @@ func TestAccResourceNsxtLbHttpResponseRewriteRule_importBasic(t *testing.T) { name := "test" resourceName := "nsxt_lb_http_response_rewrite_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPResponseRewriteRuleCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_http_virtual_server_test.go b/nsxt/resource_nsxt_lb_http_virtual_server_test.go index 3212873a0..139a9d8ef 100644 --- a/nsxt/resource_nsxt_lb_http_virtual_server_test.go +++ b/nsxt/resource_nsxt_lb_http_virtual_server_test.go @@ -24,7 +24,7 @@ func TestAccResourceNsxtLbHttpVirtualServer_basic(t *testing.T) { updatedEnabled := "false" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPVirtualServerCheckDestroy(state, name) @@ -81,7 +81,7 @@ func TestAccResourceNsxtLbHttpVirtualServer_withRules(t *testing.T) { updatedRule2 := "rule1" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPVirtualServerCheckDestroy(state, name) @@ -116,7 +116,7 @@ func TestAccResourceNsxtLbHttpVirtualServer_withSSL(t *testing.T) { updatedDepth := "4" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { testAccNSXDeleteCerts(t, testLbVirtualServerCertID, testLbVirtualServerClientCertID, testLbVirtualServerCaCertID) @@ -187,7 +187,7 @@ func TestAccResourceNsxtLbHttpVirtualServer_importBasic(t *testing.T) { name := "test" resourceName := "nsxt_lb_http_virtual_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbHTTPVirtualServerCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_icmp_monitor_test.go b/nsxt/resource_nsxt_lb_icmp_monitor_test.go index 68d3c0cd8..30a9e8879 100644 --- a/nsxt/resource_nsxt_lb_icmp_monitor_test.go +++ b/nsxt/resource_nsxt_lb_icmp_monitor_test.go @@ -24,7 +24,7 @@ func TestAccResourceNsxtLbIcmpMonitor_basic(t *testing.T) { updatedCount := "5" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbIcmpMonitorCheckDestroy(state, name) @@ -68,7 +68,7 @@ func TestAccResourceNsxtLbIcmpMonitor_importBasic(t *testing.T) { name := "test-nsx-monitor" testResourceName := "nsxt_lb_icmp_monitor.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbIcmpMonitorCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_l4_monitor_test.go b/nsxt/resource_nsxt_lb_l4_monitor_test.go index 26cfe1e50..b8eedac8e 100644 --- a/nsxt/resource_nsxt_lb_l4_monitor_test.go +++ b/nsxt/resource_nsxt_lb_l4_monitor_test.go @@ -41,7 +41,7 @@ func testAccResourceNsxtLbL4MonitorBasic(t *testing.T, protocol string) { receive := "Server hello" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbL4MonitorCheckDestroy(protocol, state, name) @@ -87,7 +87,7 @@ func testAccResourceNsxtLbL4MonitorImport(t *testing.T, protocol string) { name := "test-nsx-monitor" testResourceName := fmt.Sprintf("nsxt_lb_%s_monitor.test", protocol) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbL4MonitorCheckDestroy(protocol, state, name) diff --git a/nsxt/resource_nsxt_lb_l4_virtual_server_test.go b/nsxt/resource_nsxt_lb_l4_virtual_server_test.go index 0051e5dee..a4947a837 100644 --- a/nsxt/resource_nsxt_lb_l4_virtual_server_test.go +++ b/nsxt/resource_nsxt_lb_l4_virtual_server_test.go @@ -28,7 +28,7 @@ func testAccResourceNsxtLbL4VirtualServer(t *testing.T, protocol string) { updatedMemberPort := "10098" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbL4VirtualServerCheckDestroy(state, protocol, name) @@ -96,7 +96,7 @@ func testAccResourceNsxtLbL4VirtualServerImport(t *testing.T, protocol string) { name := "test" resourceName := fmt.Sprintf("nsxt_lb_%s_virtual_server.test", protocol) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbL4VirtualServerCheckDestroy(state, protocol, name) diff --git a/nsxt/resource_nsxt_lb_l7_monitor_test.go b/nsxt/resource_nsxt_lb_l7_monitor_test.go index cab950177..6e6f371c2 100644 --- a/nsxt/resource_nsxt_lb_l7_monitor_test.go +++ b/nsxt/resource_nsxt_lb_l7_monitor_test.go @@ -40,7 +40,7 @@ func testAccResourceNsxtLbL7MonitorBasic(t *testing.T, protocol string) { body2 := "YYYYYYYYYYYYYYYYYYY" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbL7MonitorCheckDestroy(state, name) @@ -85,7 +85,7 @@ func TestAccResourceNsxtLbHTTPSMonitor_withAuth(t *testing.T) { testResourceName := "nsxt_lb_https_monitor.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { testAccNSXDeleteCerts(t, testLbMonitorCertID, testLbMonitorClientCertID, testLbMonitorCaCertID) @@ -119,7 +119,7 @@ func testAccResourceNsxtLbL7MonitorImport(t *testing.T, protocol string) { name := "test-nsx-monitor" testResourceName := fmt.Sprintf("nsxt_lb_%s_monitor.test", protocol) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbL7MonitorCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_passive_monitor_test.go b/nsxt/resource_nsxt_lb_passive_monitor_test.go index ac3f91607..796bd9695 100644 --- a/nsxt/resource_nsxt_lb_passive_monitor_test.go +++ b/nsxt/resource_nsxt_lb_passive_monitor_test.go @@ -20,7 +20,7 @@ func TestAccResourceNsxtLbPassiveMonitor_basic(t *testing.T) { updatedTimeout := "7" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbPassiveMonitorCheckDestroy(state, name) @@ -56,7 +56,7 @@ func TestAccResourceNsxtLbPassiveMonitor_importBasic(t *testing.T) { name := "test-nsx-monitor" testResourceName := "nsxt_lb_passive_monitor.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbPassiveMonitorCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_pool_test.go b/nsxt/resource_nsxt_lb_pool_test.go index 8a32390ca..0821a6363 100644 --- a/nsxt/resource_nsxt_lb_pool_test.go +++ b/nsxt/resource_nsxt_lb_pool_test.go @@ -23,7 +23,7 @@ func TestAccResourceNsxtLbPool_basic(t *testing.T) { updatedSnatTranslationType := "SNAT_AUTO_MAP" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbPoolCheckDestroy(state, name) @@ -65,7 +65,7 @@ func TestAccResourceNsxtLbPool_withMonitors(t *testing.T) { testResourceName := "nsxt_lb_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbPoolCheckDestroy(state, name) @@ -113,7 +113,7 @@ func TestAccResourceNsxtLbPool_withIpSnat(t *testing.T) { updatedIPAddress := "1.1.1.2-1.1.1.20" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbPoolCheckDestroy(state, name) @@ -164,7 +164,7 @@ func TestAccResourceNsxtLbPool_withMember(t *testing.T) { memberIP := "1.1.1.1" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbPoolCheckDestroy(state, name) @@ -214,7 +214,7 @@ func TestAccResourceNsxtLbPool_withMemberGroup(t *testing.T) { updatedPort := "60" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbPoolCheckDestroy(state, name) @@ -264,7 +264,7 @@ func TestAccResourceNsxtLbPool_importBasic(t *testing.T) { name := "test-nsx-lb-pool" testResourceName := "nsxt_lb_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbPoolCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_server_ssl_profile_test.go b/nsxt/resource_nsxt_lb_server_ssl_profile_test.go index 64b2618cc..e50f074c3 100644 --- a/nsxt/resource_nsxt_lb_server_ssl_profile_test.go +++ b/nsxt/resource_nsxt_lb_server_ssl_profile_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtLbServerSSLProfile_basic(t *testing.T) { testResourceName := "nsxt_lb_server_ssl_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbServerSSLProfileCheckDestroy(state, name) @@ -57,7 +57,7 @@ func TestAccResourceNsxtLbServerSSLProfile_importBasic(t *testing.T) { name := "test" testResourceName := "nsxt_lb_server_ssl_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbServerSSLProfileCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_service_test.go b/nsxt/resource_nsxt_lb_service_test.go index c65329513..acab60da6 100644 --- a/nsxt/resource_nsxt_lb_service_test.go +++ b/nsxt/resource_nsxt_lb_service_test.go @@ -16,7 +16,7 @@ func TestAccResourceNsxtLbService_basic(t *testing.T) { testResourceName := "nsxt_lb_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbServiceCheckDestroy(state, name) @@ -59,7 +59,7 @@ func TestAccResourceNsxtLbService_withServers(t *testing.T) { updatedLogLevel := "INFO" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbServiceCheckDestroy(state, name) @@ -98,7 +98,7 @@ func TestAccResourceNsxtLbService_importBasic(t *testing.T) { testResourceName := "nsxt_lb_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbServiceCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_lb_source_ip_persistence_profile_test.go b/nsxt/resource_nsxt_lb_source_ip_persistence_profile_test.go index 9cb41477f..4e574b01b 100644 --- a/nsxt/resource_nsxt_lb_source_ip_persistence_profile_test.go +++ b/nsxt/resource_nsxt_lb_source_ip_persistence_profile_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtLbSourceIpPersistenceProfile_basic(t *testing.T) { updatedTimeout := "200" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbSourceIPPersistenceProfileCheckDestroy(state, name) @@ -59,7 +59,7 @@ func TestAccResourceNsxtLbSourceIpPersistenceProfile_importBasic(t *testing.T) { name := "test-nsx-persistence-profile" testResourceName := "nsxt_lb_source_ip_persistence_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLbSourceIPPersistenceProfileCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_logical_dhcp_port_test.go b/nsxt/resource_nsxt_logical_dhcp_port_test.go index 8a312554d..329923069 100644 --- a/nsxt/resource_nsxt_logical_dhcp_port_test.go +++ b/nsxt/resource_nsxt_logical_dhcp_port_test.go @@ -18,7 +18,7 @@ func TestAccResourceNsxtLogicalDhcpPort_basic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalPortCheckDestroy(state, portName) @@ -59,7 +59,7 @@ func TestAccResourceNsxtLogicalDhcpPort_importBasic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalPortCheckDestroy(state, portName) diff --git a/nsxt/resource_nsxt_logical_dhcp_server_test.go b/nsxt/resource_nsxt_logical_dhcp_server_test.go index 362f9aa23..01d68485f 100644 --- a/nsxt/resource_nsxt_logical_dhcp_server_test.go +++ b/nsxt/resource_nsxt_logical_dhcp_server_test.go @@ -25,7 +25,7 @@ func TestAccResourceNsxtLogicalDhcpServer_basic(t *testing.T) { ip5 := "1.1.1.23" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalDhcpServerCheckDestroy(state, prfName) @@ -85,7 +85,7 @@ func TestAccResourceNsxtLogicalDhcpServer_noOpts(t *testing.T) { ip4 := "1.1.1.22" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalDhcpServerCheckDestroy(state, prfName) @@ -131,7 +131,7 @@ func TestAccResourceNsxtLogicalDhcpServer_importBasic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalDhcpServerCheckDestroy(state, prfName) diff --git a/nsxt/resource_nsxt_logical_port_test.go b/nsxt/resource_nsxt_logical_port_test.go index 520002dfb..26beac756 100644 --- a/nsxt/resource_nsxt_logical_port_test.go +++ b/nsxt/resource_nsxt_logical_port_test.go @@ -18,7 +18,7 @@ func TestAccResourceNsxtLogicalPort_basic(t *testing.T) { transportZoneName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalPortCheckDestroy(state, portName) @@ -57,7 +57,7 @@ func TestAccResourceNsxtLogicalPort_withProfiles(t *testing.T) { profileType := "QosSwitchingProfile" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { // Verify that the LP was deleted @@ -108,7 +108,7 @@ func TestAccResourceNsxtLogicalPort_withNSGroup(t *testing.T) { transportZoneName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalPortCheckDestroy(state, portName) @@ -137,7 +137,7 @@ func TestAccResourceNsxtLogicalPort_importBasic(t *testing.T) { transportZoneName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalPortCheckDestroy(state, portName) diff --git a/nsxt/resource_nsxt_logical_router_centralized_service_port_test.go b/nsxt/resource_nsxt_logical_router_centralized_service_port_test.go index ffc4c709f..776cb873e 100644 --- a/nsxt/resource_nsxt_logical_router_centralized_service_port_test.go +++ b/nsxt/resource_nsxt_logical_router_centralized_service_port_test.go @@ -20,7 +20,7 @@ func TestAccResourceNsxtLogicalRouterCentralizedServicePort_basic(t *testing.T) routerObj := "nsxt_logical_tier1_router.rtr1.id" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterCentralizedServicePortCheckDestroy(state, portName) @@ -65,7 +65,7 @@ func TestAccResourceNsxtLogicalRouterCentralizedServicePort_onTier0(t *testing.T routerObj := "data.nsxt_logical_tier0_router.tier0rtr.id" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterCentralizedServicePortCheckDestroy(state, portName) @@ -109,7 +109,7 @@ func TestAccResourceNsxtLogicalRouterCentralizedServicePort_importBasic(t *testi routerObj := "nsxt_logical_tier1_router.rtr1.id" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterCentralizedServicePortCheckDestroy(state, portName) @@ -134,7 +134,7 @@ func TestAccResourceNsxtLogicalRouterCentralizedServicePort_onTier1(t *testing.T edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "2.3.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterCentralizedServicePortCheckDestroy(state, portName) diff --git a/nsxt/resource_nsxt_logical_router_downlink_port_test.go b/nsxt/resource_nsxt_logical_router_downlink_port_test.go index 7711c2193..f4be5c4d5 100644 --- a/nsxt/resource_nsxt_logical_router_downlink_port_test.go +++ b/nsxt/resource_nsxt_logical_router_downlink_port_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtLogicalRouterDownlinkPort_basic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterDownlinkPortCheckDestroy(state, portName) @@ -73,7 +73,7 @@ func TestAccResourceNsxtLogicalRouterDownlinkPort_withRelay(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterDownlinkPortCheckDestroy(state, portName) @@ -118,7 +118,7 @@ func TestAccResourceNsxtLogicalRouterDownlinkPort_importBasic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterDownlinkPortCheckDestroy(state, portName) diff --git a/nsxt/resource_nsxt_logical_router_link_port_on_tier0_test.go b/nsxt/resource_nsxt_logical_router_link_port_on_tier0_test.go index f176e2c95..2a1138371 100644 --- a/nsxt/resource_nsxt_logical_router_link_port_on_tier0_test.go +++ b/nsxt/resource_nsxt_logical_router_link_port_on_tier0_test.go @@ -18,7 +18,7 @@ func TestAccResourceNsxtLogicalRouterLinkPortOnTier0_basic(t *testing.T) { testResourceName := "nsxt_logical_router_link_port_on_tier0.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterLinkPortOnTier0CheckDestroy(state, name) @@ -52,7 +52,7 @@ func TestAccResourceNsxtLogicalRouterLinkPortOnTier0_importBasic(t *testing.T) { testResourceName := "nsxt_logical_router_link_port_on_tier0.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterLinkPortOnTier0CheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_logical_router_link_port_on_tier1_test.go b/nsxt/resource_nsxt_logical_router_link_port_on_tier1_test.go index 7cc74dec8..3d23db163 100644 --- a/nsxt/resource_nsxt_logical_router_link_port_on_tier1_test.go +++ b/nsxt/resource_nsxt_logical_router_link_port_on_tier1_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtLogicalRouterLinkPortOnTier1_basic(t *testing.T) { testResourceName := "nsxt_logical_router_link_port_on_tier1.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterLinkPortOnTier1CheckDestroy(state, name) @@ -58,7 +58,7 @@ func TestAccResourceNsxtLogicalRouterLinkPortOnTier1_importBasic(t *testing.T) { testResourceName := "nsxt_logical_router_link_port_on_tier1.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalRouterLinkPortOnTier1CheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_logical_switch_test.go b/nsxt/resource_nsxt_logical_switch_test.go index 62897bd45..ba30797a0 100644 --- a/nsxt/resource_nsxt_logical_switch_test.go +++ b/nsxt/resource_nsxt_logical_switch_test.go @@ -22,7 +22,7 @@ func TestAccResourceNsxtLogicalSwitch_basic(t *testing.T) { transportZoneName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalSwitchCheckDestroy(state, switchName, "nsxt_logical_switch") @@ -75,7 +75,7 @@ func TestAccResourceNsxtLogicalSwitch_vlan(t *testing.T) { replicationMode := "" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalSwitchCheckDestroy(state, switchName, "nsxt_logical_switch") @@ -116,7 +116,7 @@ func TestAccResourceNsxtLogicalSwitch_withProfiles(t *testing.T) { profileType := "SwitchSecuritySwitchingProfile" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { // Verify that the LS was deleted @@ -171,7 +171,7 @@ func TestAccResourceNsxtLogicalSwitch_withMacPool(t *testing.T) { replicationMode := "MTEP" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalSwitchCheckDestroy(state, switchName, "nsxt_logical_switch") @@ -206,7 +206,7 @@ func TestAccResourceNsxtLogicalSwitch_importBasic(t *testing.T) { transportZoneName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalSwitchCheckDestroy(state, switchName, "nsxt_logical_switch") diff --git a/nsxt/resource_nsxt_logical_tier0_router_test.go b/nsxt/resource_nsxt_logical_tier0_router_test.go index 18abcab3c..6e887b4c8 100644 --- a/nsxt/resource_nsxt_logical_tier0_router_test.go +++ b/nsxt/resource_nsxt_logical_tier0_router_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtLogicalTier0Router_basic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalTier0RouterCheckDestroy(state, name) @@ -57,7 +57,7 @@ func TestAccResourceNsxtLogicalTier0Router_active(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalTier0RouterCheckDestroy(state, name) @@ -94,7 +94,7 @@ func TestAccResourceNsxtLogicalTier0Router_importBasic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalTier0RouterCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_logical_tier1_router_test.go b/nsxt/resource_nsxt_logical_tier1_router_test.go index 5b6637a37..89d0ee380 100644 --- a/nsxt/resource_nsxt_logical_tier1_router_test.go +++ b/nsxt/resource_nsxt_logical_tier1_router_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtLogicalTier1Router_basic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalTier1RouterCheckDestroy(state, name) @@ -68,7 +68,7 @@ func TestAccResourceNsxtLogicalTier1Router_importBasic(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalTier1RouterCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_nat_rule_test.go b/nsxt/resource_nsxt_nat_rule_test.go index ec81964bf..548ad8bd2 100644 --- a/nsxt/resource_nsxt_nat_rule_test.go +++ b/nsxt/resource_nsxt_nat_rule_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtNatRule_snat(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNATRuleCheckDestroy(state, ruleName) @@ -70,7 +70,7 @@ func TestAccResourceNsxtNatRule_snatImport(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNATRuleCheckDestroy(state, ruleName) @@ -95,7 +95,7 @@ func TestAccResourceNsxtNatRule_dnat(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNATRuleCheckDestroy(state, ruleName) @@ -142,7 +142,7 @@ func TestAccResourceNsxtNatRule_dnatImport(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNATRuleCheckDestroy(state, ruleName) @@ -166,7 +166,7 @@ func TestAccResourceNsxtNatRule_noNnat(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersionLessThan(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersionLessThan(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNATRuleCheckDestroy(state, ruleName) diff --git a/nsxt/resource_nsxt_ns_group_test.go b/nsxt/resource_nsxt_ns_group_test.go index 41d3ef446..72fe91242 100644 --- a/nsxt/resource_nsxt_ns_group_test.go +++ b/nsxt/resource_nsxt_ns_group_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtNSGroup_basic(t *testing.T) { testResourceName := "nsxt_ns_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNSGroupCheckDestroy(state, grpName) @@ -53,7 +53,7 @@ func TestAccResourceNsxtNSGroup_nested(t *testing.T) { testResourceName := "nsxt_ns_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNSGroupCheckDestroy(state, grpName) @@ -88,7 +88,7 @@ func TestAccResourceNsxtNSGroup_withCriteria(t *testing.T) { transportZoneName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNSGroupCheckDestroy(state, grpName) @@ -123,7 +123,7 @@ func TestAccResourceNsxtNSGroup_importBasic(t *testing.T) { testResourceName := "nsxt_ns_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNSGroupCheckDestroy(state, grpName) @@ -146,7 +146,7 @@ func TestAccResourceNsxtNSGroup_importWithCriteria(t *testing.T) { testResourceName := "nsxt_ns_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXNSGroupCheckDestroy(state, grpName) diff --git a/nsxt/resource_nsxt_policy_bgp_neighbor_test.go b/nsxt/resource_nsxt_policy_bgp_neighbor_test.go index e309fff02..e20da62f3 100644 --- a/nsxt/resource_nsxt_policy_bgp_neighbor_test.go +++ b/nsxt/resource_nsxt_policy_bgp_neighbor_test.go @@ -43,7 +43,7 @@ func TestAccResourceNsxtPolicyBgpNeighbor_basic(t *testing.T) { sourceAddress := "1.1.12.2" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyBgpNeighborCheckDestroy(state, accTestPolicyBgpNeighborConfigCreateAttributes["display_name"]) @@ -104,7 +104,7 @@ func TestAccResourceNsxtPolicyBgpNeighbor_minimalistic(t *testing.T) { testResourceName := "nsxt_policy_bgp_neighbor.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyBgpNeighborCheckDestroy(state, accTestPolicyBgpNeighborConfigCreateAttributes["display_name"]) @@ -128,7 +128,7 @@ func TestAccResourceNsxtPolicyBgpNeighbor_subConfig(t *testing.T) { testResourceName := "nsxt_policy_bgp_neighbor.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyBgpNeighborCheckDestroy(state, "tfbgp") @@ -178,7 +178,7 @@ func TestAccResourceNsxtPolicyBgpNeighbor_subConfigSingleRoute(t *testing.T) { testResourceName := "nsxt_policy_bgp_neighbor.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyBgpNeighborCheckDestroy(state, "tfbgp") @@ -209,7 +209,7 @@ func TestAccResourceNsxtPolicyBgpNeighbor_importBasic(t *testing.T) { testResourceName := "nsxt_policy_bgp_neighbor.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyBgpNeighborCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_dhcp_relay.go b/nsxt/resource_nsxt_policy_dhcp_relay.go index da13e2ccc..da4cc667a 100644 --- a/nsxt/resource_nsxt_policy_dhcp_relay.go +++ b/nsxt/resource_nsxt_policy_dhcp_relay.go @@ -41,7 +41,7 @@ func resourceNsxtPolicyDhcpRelayConfig() *schema.Resource { } } -func resourceNsxtPolicyDhcpRelayConfigExists(id string, connector *client.RestConnector) bool { +func resourceNsxtPolicyDhcpRelayConfigExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { client := infra.NewDefaultDhcpRelayConfigsClient(connector) _, err := client.Get(id) @@ -67,7 +67,7 @@ func resourceNsxtPolicyDhcpRelayConfigCreate(d *schema.ResourceData, m interface } // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyDhcpRelayConfigExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyDhcpRelayConfigExists) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_dhcp_relay_test.go b/nsxt/resource_nsxt_policy_dhcp_relay_test.go index ff9f1fca2..2a61f313d 100644 --- a/nsxt/resource_nsxt_policy_dhcp_relay_test.go +++ b/nsxt/resource_nsxt_policy_dhcp_relay_test.go @@ -28,7 +28,7 @@ func TestAccResourceNsxtPolicyDhcpRelayConfig_basic(t *testing.T) { testResourceName := "nsxt_policy_dhcp_relay.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyDhcpRelayConfigCheckDestroy(state, accTestPolicyDhcpRelayConfigCreateAttributes["display_name"]) @@ -82,7 +82,7 @@ func TestAccResourceNsxtPolicyDhcpRelayConfig_importBasic(t *testing.T) { testResourceName := "nsxt_policy_dhcp_relay.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyDhcpRelayConfigCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_dhcp_server.go b/nsxt/resource_nsxt_policy_dhcp_server.go index 8bd110c6a..2116b0e89 100644 --- a/nsxt/resource_nsxt_policy_dhcp_server.go +++ b/nsxt/resource_nsxt_policy_dhcp_server.go @@ -63,7 +63,7 @@ func resourceNsxtPolicyDhcpServer() *schema.Resource { } } -func resourceNsxtPolicyDhcpServerExists(id string, connector *client.RestConnector) bool { +func resourceNsxtPolicyDhcpServerExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { client := infra.NewDefaultDhcpServerConfigsClient(connector) _, err := client.Get(id) @@ -120,7 +120,7 @@ func resourceNsxtPolicyDhcpServerCreate(d *schema.ResourceData, m interface{}) e } // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyDhcpServerExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyDhcpServerExists) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_dhcp_server_test.go b/nsxt/resource_nsxt_policy_dhcp_server_test.go index 0fb90ddf4..f34ee939c 100644 --- a/nsxt/resource_nsxt_policy_dhcp_server_test.go +++ b/nsxt/resource_nsxt_policy_dhcp_server_test.go @@ -27,7 +27,7 @@ func TestAccResourceNsxtPolicyDhcpServer_basic(t *testing.T) { testResourceName := "nsxt_policy_dhcp_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyDhcpServerCheckDestroy(state, accTestPolicyDhcpServerCreateAttributes["display_name"]) @@ -89,7 +89,7 @@ func TestAccResourceNsxtPolicyDhcpServer_importBasic(t *testing.T) { testResourceName := "nsxt_policy_dhcp_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyDhcpServerCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_gateway_policy.go b/nsxt/resource_nsxt_policy_gateway_policy.go index 3c7300e0a..601e734e4 100644 --- a/nsxt/resource_nsxt_policy_gateway_policy.go +++ b/nsxt/resource_nsxt_policy_gateway_policy.go @@ -7,6 +7,8 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + gm_domains "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/domains" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "log" @@ -26,10 +28,16 @@ func resourceNsxtPolicyGatewayPolicy() *schema.Resource { } } -func resourceNsxtPolicyGatewayPolicyExistsInDomain(id string, domainName string, connector *client.RestConnector) bool { - client := domains.NewDefaultGatewayPoliciesClient(connector) +func resourceNsxtPolicyGatewayPolicyExistsInDomain(id string, domainName string, connector *client.RestConnector, isGlobalManager bool) bool { + var err error + if isGlobalManager { + client := gm_domains.NewDefaultGatewayPoliciesClient(connector) + _, err = client.Get(domainName, id) + } else { + client := domains.NewDefaultGatewayPoliciesClient(connector) + _, err = client.Get(domainName, id) + } - _, err := client.Get(domainName, id) if err == nil { return true } @@ -42,18 +50,17 @@ func resourceNsxtPolicyGatewayPolicyExistsInDomain(id string, domainName string, return false } -func resourceNsxtPolicyGatewayPolicyExistsPartial(domainName string) func(id string, connector *client.RestConnector) bool { - return func(id string, connector *client.RestConnector) bool { - return resourceNsxtPolicyGatewayPolicyExistsInDomain(id, domainName, connector) +func resourceNsxtPolicyGatewayPolicyExistsPartial(domainName string) func(id string, connector *client.RestConnector, isGlobalManager bool) bool { + return func(id string, connector *client.RestConnector, isGlobalManager bool) bool { + return resourceNsxtPolicyGatewayPolicyExistsInDomain(id, domainName, connector, isGlobalManager) } } func resourceNsxtPolicyGatewayPolicyCreate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultGatewayPoliciesClient(connector) // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyGatewayPolicyExistsPartial(d.Get("domain").(string))) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyGatewayPolicyExistsPartial(d.Get("domain").(string))) if err != nil { return err } @@ -87,7 +94,17 @@ func resourceNsxtPolicyGatewayPolicyCreate(d *schema.ResourceData, m interface{} } log.Printf("[INFO] Creating Gateway Policy with ID %s", id) - err = client.Patch(d.Get("domain").(string), id, obj) + if isPolicyGlobalManager(m) { + client := gm_domains.NewDefaultGatewayPoliciesClient(connector) + gmObj, err1 := convertModelBindingType(obj, model.GatewayPolicyBindingType(), gm_model.GatewayPolicyBindingType()) + if err1 != nil { + return err1 + } + err = client.Patch(d.Get("domain").(string), id, gmObj.(gm_model.GatewayPolicy)) + } else { + client := domains.NewDefaultGatewayPoliciesClient(connector) + err = client.Patch(d.Get("domain").(string), id, obj) + } if err != nil { return handleCreateError("Gateway Policy", id, err) } @@ -100,16 +117,31 @@ func resourceNsxtPolicyGatewayPolicyCreate(d *schema.ResourceData, m interface{} func resourceNsxtPolicyGatewayPolicyRead(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultGatewayPoliciesClient(connector) id := d.Id() if id == "" { return fmt.Errorf("Error obtaining Gateway Policy ID") } - obj, err := client.Get(d.Get("domain").(string), id) - if err != nil { - return handleReadError(d, "Gateway Policy", id, err) + var obj model.GatewayPolicy + if isPolicyGlobalManager(m) { + client := gm_domains.NewDefaultGatewayPoliciesClient(connector) + gmObj, err := client.Get(d.Get("domain").(string), id) + if err != nil { + return handleReadError(d, "Gateway Policy", id, err) + } + rawObj, err := convertModelBindingType(gmObj, gm_model.GatewayPolicyBindingType(), model.GatewayPolicyBindingType()) + if err != nil { + return err + } + obj = rawObj.(model.GatewayPolicy) + } else { + var err error + client := domains.NewDefaultGatewayPoliciesClient(connector) + obj, err = client.Get(d.Get("domain").(string), id) + if err != nil { + return handleReadError(d, "Gateway Policy", id, err) + } } d.Set("display_name", obj.DisplayName) @@ -135,7 +167,6 @@ func resourceNsxtPolicyGatewayPolicyRead(d *schema.ResourceData, m interface{}) func resourceNsxtPolicyGatewayPolicyUpdate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultGatewayPoliciesClient(connector) id := d.Id() if id == "" { @@ -168,8 +199,22 @@ func resourceNsxtPolicyGatewayPolicyUpdate(d *schema.ResourceData, m interface{} Rules: rules, } - // We need to use PUT, because PATCH will not replace the whole rule list - _, err := client.Update(d.Get("domain").(string), id, obj) + var err error + if isPolicyGlobalManager(m) { + rawObj, err1 := convertModelBindingType(obj, model.GatewayPolicyBindingType(), gm_model.GatewayPolicyBindingType()) + if err1 != nil { + return err1 + } + gmObj := rawObj.(gm_model.GatewayPolicy) + client := gm_domains.NewDefaultGatewayPoliciesClient(connector) + // We need to use PUT, because PATCH will not replace the whole rule list + _, err = client.Update(d.Get("domain").(string), id, gmObj) + } else { + client := domains.NewDefaultGatewayPoliciesClient(connector) + // We need to use PUT, because PATCH will not replace the whole rule list + _, err = client.Update(d.Get("domain").(string), id, obj) + } + if err != nil { return handleUpdateError("Gateway Policy", id, err) } @@ -184,8 +229,14 @@ func resourceNsxtPolicyGatewayPolicyDelete(d *schema.ResourceData, m interface{} } connector := getPolicyConnector(m) - client := domains.NewDefaultGatewayPoliciesClient(connector) - err := client.Delete(d.Get("domain").(string), id) + var err error + if isPolicyGlobalManager(m) { + client := gm_domains.NewDefaultGatewayPoliciesClient(connector) + err = client.Delete(d.Get("domain").(string), id) + } else { + client := domains.NewDefaultGatewayPoliciesClient(connector) + err = client.Delete(d.Get("domain").(string), id) + } if err != nil { return handleDeleteError("Gateway Policy", id, err) } diff --git a/nsxt/resource_nsxt_policy_gateway_policy_test.go b/nsxt/resource_nsxt_policy_gateway_policy_test.go index 6e29e1ec9..319bcf1ce 100644 --- a/nsxt/resource_nsxt_policy_gateway_policy_test.go +++ b/nsxt/resource_nsxt_policy_gateway_policy_test.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/domains" "testing" ) @@ -238,11 +237,117 @@ func TestAccResourceNsxtPolicyGatewayPolicy_importNoTcpStrict(t *testing.T) { }) } +func TestAccResourceNsxtGlobalPolicyGatewayPolicy_withSite(t *testing.T) { + name := "terraform-test" + updatedName := fmt.Sprintf("%s-update", name) + domainName := getTestSiteName() + testResourceName := "nsxt_policy_gateway_policy.test" + comments1 := "Acceptance test create" + comments2 := "Acceptance test update" + direction1 := "IN" + direction2 := "OUT" + proto1 := "IPV4" + proto2 := "IPV4_IPV6" + defaultAction := "ALLOW" + tag1 := "abc" + tag2 := "def" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccOnlyGlobalManager(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtPolicyGatewayPolicyCheckDestroy(state, name, domainName) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtGlobalPolicyGatewayPolicyBasic(name, comments1, domainName), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyGatewayPolicyExists(testResourceName, domainName), + resource.TestCheckResourceAttr(testResourceName, "display_name", name), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "category", "LocalGatewayRules"), + resource.TestCheckResourceAttr(testResourceName, "domain", domainName), + resource.TestCheckResourceAttr(testResourceName, "comments", comments1), + resource.TestCheckResourceAttr(testResourceName, "locked", "true"), + resource.TestCheckResourceAttr(testResourceName, "sequence_number", "3"), + resource.TestCheckResourceAttr(testResourceName, "stateful", "true"), + resource.TestCheckResourceAttr(testResourceName, "tcp_strict", "false"), + resource.TestCheckResourceAttr(testResourceName, "rule.#", "0"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + { + Config: testAccNsxtGlobalPolicyGatewayPolicyBasic(updatedName, comments2, domainName), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyGatewayPolicyExists(testResourceName, domainName), + resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "category", "LocalGatewayRules"), + resource.TestCheckResourceAttr(testResourceName, "domain", domainName), + resource.TestCheckResourceAttr(testResourceName, "comments", comments2), + resource.TestCheckResourceAttr(testResourceName, "locked", "true"), + resource.TestCheckResourceAttr(testResourceName, "sequence_number", "3"), + resource.TestCheckResourceAttr(testResourceName, "stateful", "true"), + resource.TestCheckResourceAttr(testResourceName, "tcp_strict", "false"), + resource.TestCheckResourceAttr(testResourceName, "rule.#", "0"), + ), + }, + { + Config: testAccNsxtGlobalPolicyGatewayPolicyWithRule(updatedName, direction1, proto1, tag1, domainName), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyGatewayPolicyExists(testResourceName, domainName), + resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "category", "LocalGatewayRules"), + resource.TestCheckResourceAttr(testResourceName, "domain", domainName), + resource.TestCheckResourceAttr(testResourceName, "comments", ""), + resource.TestCheckResourceAttr(testResourceName, "locked", "false"), + resource.TestCheckResourceAttr(testResourceName, "sequence_number", "3"), + resource.TestCheckResourceAttr(testResourceName, "stateful", "true"), + resource.TestCheckResourceAttr(testResourceName, "tcp_strict", "false"), + resource.TestCheckResourceAttr(testResourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "rule.0.display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "rule.0.direction", direction1), + resource.TestCheckResourceAttr(testResourceName, "rule.0.ip_version", proto1), + resource.TestCheckResourceAttr(testResourceName, "rule.0.action", defaultAction), + resource.TestCheckResourceAttr(testResourceName, "rule.0.log_label", tag1), + resource.TestCheckResourceAttr(testResourceName, "rule.0.tag.#", "1"), + ), + }, + { + Config: testAccNsxtGlobalPolicyGatewayPolicyWithRule(updatedName, direction2, proto2, tag2, domainName), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyGatewayPolicyExists(testResourceName, domainName), + resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "category", "LocalGatewayRules"), + resource.TestCheckResourceAttr(testResourceName, "domain", domainName), + resource.TestCheckResourceAttr(testResourceName, "comments", ""), + resource.TestCheckResourceAttr(testResourceName, "locked", "false"), + resource.TestCheckResourceAttr(testResourceName, "sequence_number", "3"), + resource.TestCheckResourceAttr(testResourceName, "stateful", "true"), + resource.TestCheckResourceAttr(testResourceName, "tcp_strict", "false"), + resource.TestCheckResourceAttr(testResourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "rule.0.display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "rule.0.direction", direction2), + resource.TestCheckResourceAttr(testResourceName, "rule.0.ip_version", proto2), + resource.TestCheckResourceAttr(testResourceName, "rule.0.action", defaultAction), + resource.TestCheckResourceAttr(testResourceName, "rule.0.log_label", tag2), + resource.TestCheckResourceAttr(testResourceName, "rule.0.tag.#", "1"), + ), + }, + }, + }) +} + func testAccNsxtPolicyGatewayPolicyExists(resourceName string, domainName string) resource.TestCheckFunc { return func(state *terraform.State) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := domains.NewDefaultGatewayPoliciesClient(connector) rs, ok := state.RootModule().Resources[resourceName] if !ok { @@ -254,18 +359,15 @@ func testAccNsxtPolicyGatewayPolicyExists(resourceName string, domainName string return fmt.Errorf("Policy GatewayPolicy resource ID not set in resources") } - _, err := nsxClient.Get(domainName, resourceID) - if err != nil { - return fmt.Errorf("Error while retrieving policy GatewayPolicy ID %s. Error: %v", resourceID, err) + if !resourceNsxtPolicyGatewayPolicyExistsInDomain(resourceID, domainName, connector, testAccIsGlobalManager()) { + return fmt.Errorf("Error while retrieving policy GatewayPolicy ID %s", resourceID) } - return nil } } func testAccNsxtPolicyGatewayPolicyCheckDestroy(state *terraform.State, displayName string, domainName string) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := domains.NewDefaultGatewayPoliciesClient(connector) for _, rs := range state.RootModule().Resources { if rs.Type != "nsxt_policy_gateway_policy" { @@ -273,8 +375,7 @@ func testAccNsxtPolicyGatewayPolicyCheckDestroy(state *terraform.State, displayN } resourceID := rs.Primary.Attributes["id"] - _, err := nsxClient.Get(domainName, resourceID) - if err == nil { + if resourceNsxtPolicyGatewayPolicyExistsInDomain(resourceID, domainName, connector, testAccIsGlobalManager()) { return fmt.Errorf("Policy GatewayPolicy %s still exists", displayName) } } @@ -468,3 +569,62 @@ resource "nsxt_policy_gateway_policy" "test" { }`, name) } + +func testAccNsxtGlobalPolicyGatewayPolicyBasic(name string, comments string, domainName string) string { + return testAccNsxtGlobalPolicySite(domainName) + fmt.Sprintf(` +resource "nsxt_policy_gateway_policy" "test" { + display_name = "%s" + description = "Acceptance Test" + category = "LocalGatewayRules" + comments = "%s" + locked = true + sequence_number = 3 + stateful = true + tcp_strict = false + domain = data.nsxt_policy_site.test.id + + tag { + scope = "color" + tag = "orange" + } + +}`, name, comments) +} + +func testAccNsxtGlobalPolicyGatewayPolicyWithRule(name string, direction string, protocol string, ruleTag string, domainName string) string { + return testAccNsxtGlobalPolicySite(domainName) + fmt.Sprintf(` +resource "nsxt_policy_tier1_gateway" "gwt1test" { + display_name = "tf-t1-gw" + description = "Acceptance Test" +} + +resource "nsxt_policy_gateway_policy" "test" { + display_name = "%s" + description = "Acceptance Test" + category = "LocalGatewayRules" + locked = false + sequence_number = 3 + stateful = true + tcp_strict = false + domain = data.nsxt_policy_site.test.id + + + tag { + scope = "color" + tag = "orange" + } + + rule { + display_name = "%s" + direction = "%s" + ip_version = "%s" + scope = [nsxt_policy_tier1_gateway.gwt1test.path] + log_label = "%s" + + tag { + scope = "color" + tag = "blue" + } + } +}`, name, name, direction, protocol, ruleTag) +} diff --git a/nsxt/resource_nsxt_policy_group.go b/nsxt/resource_nsxt_policy_group.go index cc551fa5f..54f06a048 100644 --- a/nsxt/resource_nsxt_policy_group.go +++ b/nsxt/resource_nsxt_policy_group.go @@ -10,6 +10,8 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" "github.com/vmware/vsphere-automation-sdk-go/runtime/data" "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + gm_domains "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/domains" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "log" @@ -174,10 +176,15 @@ func getCriteriaSetSchema() *schema.Resource { } } -func resourceNsxtPolicyGroupExistsInDomain(id string, domain string, connector *client.RestConnector) bool { - client := domains.NewDefaultGroupsClient(connector) - - _, err := client.Get(domain, id) +func resourceNsxtPolicyGroupExistsInDomain(id string, domain string, connector *client.RestConnector, isGlobalManager bool) bool { + var err error + if isGlobalManager { + client := gm_domains.NewDefaultGroupsClient(connector) + _, err = client.Get(domain, id) + } else { + client := domains.NewDefaultGroupsClient(connector) + _, err = client.Get(domain, id) + } if err == nil { return true } @@ -191,9 +198,9 @@ func resourceNsxtPolicyGroupExistsInDomain(id string, domain string, connector * } -func resourceNsxtPolicyGroupExistsInDomainPartial(domain string) func(id string, connector *client.RestConnector) bool { - return func(id string, connector *client.RestConnector) bool { - return resourceNsxtPolicyGroupExistsInDomain(id, domain, connector) +func resourceNsxtPolicyGroupExistsInDomainPartial(domain string) func(id string, connector *client.RestConnector, isGlobalManager bool) bool { + return func(id string, connector *client.RestConnector, isGlobalManager bool) bool { + return resourceNsxtPolicyGroupExistsInDomain(id, domain, connector, isGlobalManager) } } @@ -569,10 +576,9 @@ func validateGroupCriteriaAndConjunctions(criteriaSets []interface{}, conjunctio func resourceNsxtPolicyGroupCreate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultGroupsClient(connector) // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyGroupExistsInDomainPartial(d.Get("domain").(string))) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyGroupExistsInDomainPartial(d.Get("domain").(string))) if err != nil { return err } @@ -601,9 +607,19 @@ func resourceNsxtPolicyGroupCreate(d *schema.ResourceData, m interface{}) error Expression: expressionData, } + if isPolicyGlobalManager(m) { + gmObj, err1 := convertModelBindingType(obj, model.GroupBindingType(), gm_model.GroupBindingType()) + if err1 != nil { + return err1 + } + client := gm_domains.NewDefaultGroupsClient(connector) + err = client.Patch(d.Get("domain").(string), id, gmObj.(gm_model.Group)) + } else { + client := domains.NewDefaultGroupsClient(connector) + err = client.Patch(d.Get("domain").(string), id, obj) + } // Create the resource using PATCH log.Printf("[INFO] Creating Group with ID %s", id) - err = client.Patch(d.Get("domain").(string), id, obj) if err != nil { return handleCreateError("Group", id, err) } @@ -616,25 +632,31 @@ func resourceNsxtPolicyGroupCreate(d *schema.ResourceData, m interface{}) error func resourceNsxtPolicyGroupRead(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultGroupsClient(connector) - id := d.Id() + domainName := d.Get("domain").(string) if id == "" { return fmt.Errorf("Error obtaining Group ID") } - - domainName := d.Get("domain").(string) - obj, err := client.Get(domainName, id) - if err != nil { - return handleReadError(d, "Group", id, err) - } - - criteria, conditions, err := fromGroupExpressionData(obj.Expression) - log.Printf("[INFO] Found %d criteria, %d conjunctions for group %s", len(criteria), len(conditions), id) - if err != nil { - return err + var obj model.Group + if isPolicyGlobalManager(m) { + client := gm_domains.NewDefaultGroupsClient(connector) + gmObj, err := client.Get(domainName, id) + if err != nil { + return handleReadError(d, "Group", id, err) + } + rawObj, err := convertModelBindingType(gmObj, gm_model.GroupBindingType(), model.GroupBindingType()) + if err != nil { + return err + } + obj = rawObj.(model.Group) + } else { + var err error + client := domains.NewDefaultGroupsClient(connector) + obj, err = client.Get(domainName, id) + if err != nil { + return handleReadError(d, "Group", id, err) + } } - d.Set("display_name", obj.DisplayName) d.Set("description", obj.Description) setPolicyTagsInSchema(d, obj.Tags) @@ -642,6 +664,11 @@ func resourceNsxtPolicyGroupRead(d *schema.ResourceData, m interface{}) error { d.Set("path", obj.Path) d.Set("domain", getDomainFromResourcePath(*obj.Path)) d.Set("revision", obj.Revision) + criteria, conditions, err := fromGroupExpressionData(obj.Expression) + log.Printf("[INFO] Found %d criteria, %d conjunctions for group %s", len(criteria), len(conditions), id) + if err != nil { + return err + } d.Set("criteria", criteria) d.Set("conjunction", conditions) @@ -650,7 +677,6 @@ func resourceNsxtPolicyGroupRead(d *schema.ResourceData, m interface{}) error { func resourceNsxtPolicyGroupUpdate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultGroupsClient(connector) id := d.Id() if id == "" { @@ -682,8 +708,22 @@ func resourceNsxtPolicyGroupUpdate(d *schema.ResourceData, m interface{}) error Expression: expressionData, } - // Update the resource using PATCH - err = client.Patch(d.Get("domain").(string), id, obj) + if isPolicyGlobalManager(m) { + gmObj, err1 := convertModelBindingType(obj, model.GroupBindingType(), gm_model.GroupBindingType()) + if err1 != nil { + return err1 + } + gmGroup := gmObj.(gm_model.Group) + client := gm_domains.NewDefaultGroupsClient(connector) + + // Update the resource using PATCH + err = client.Patch(d.Get("domain").(string), id, gmGroup) + } else { + client := domains.NewDefaultGroupsClient(connector) + + // Update the resource using PATCH + err = client.Patch(d.Get("domain").(string), id, obj) + } if err != nil { return handleUpdateError("Group", id, err) } @@ -698,11 +738,18 @@ func resourceNsxtPolicyGroupDelete(d *schema.ResourceData, m interface{}) error } connector := getPolicyConnector(m) - client := domains.NewDefaultGroupsClient(connector) - + var err error forceDelete := true failIfSubtreeExists := false - err := client.Delete(d.Get("domain").(string), id, &failIfSubtreeExists, &forceDelete) + + if isPolicyGlobalManager(m) { + client := gm_domains.NewDefaultGroupsClient(connector) + err = client.Delete(d.Get("domain").(string), id, &failIfSubtreeExists, &forceDelete) + } else { + client := domains.NewDefaultGroupsClient(connector) + err = client.Delete(d.Get("domain").(string), id, &failIfSubtreeExists, &forceDelete) + } + if err != nil { return handleDeleteError("Group", id, err) } diff --git a/nsxt/resource_nsxt_policy_group_test.go b/nsxt/resource_nsxt_policy_group_test.go index 7e9f7ba67..4df73a95d 100644 --- a/nsxt/resource_nsxt_policy_group_test.go +++ b/nsxt/resource_nsxt_policy_group_test.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" + gm_domains "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/domains" "testing" ) @@ -60,6 +61,54 @@ func TestAccResourceNsxtPolicyGroup_singleIPAddressCriteria(t *testing.T) { }) } +func TestAccResourceNsxtGlobalPolicyGroup_singleIPAddressCriteria(t *testing.T) { + name := fmt.Sprintf("test-nsx-global-policy-group-ipaddrs") + updatedName := fmt.Sprintf("%s-update", name) + testResourceName := "nsxt_policy_group.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccOnlyGlobalManager(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtPolicyGroupCheckDestroy(state, name, getTestSiteName()) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtGlobalPolicyGroupIPAddressCreateTemplate(name, getTestSiteName()), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyGroupExists(testResourceName, getTestSiteName()), + resource.TestCheckResourceAttr(testResourceName, "display_name", name), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "domain", getTestSiteName()), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + resource.TestCheckNoResourceAttr(testResourceName, "conjunction"), + resource.TestCheckResourceAttr(testResourceName, "tag.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "criteria.#", "1"), + ), + }, + { + Config: testAccNsxtGlobalPolicyGroupIPAddressUpdateTemplate(updatedName, getTestSiteName()), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyGroupExists(testResourceName, getTestSiteName()), + resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "domain", getTestSiteName()), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + resource.TestCheckResourceAttr(testResourceName, "conjunction.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "tag.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "criteria.#", "2"), + ), + }, + }, + }) +} + func TestAccResourceNsxtPolicyGroup_multipleIPAddressCriteria(t *testing.T) { name := fmt.Sprintf("test-nsx-policy-group-ipaddrs") updatedName := fmt.Sprintf("%s-update", name) @@ -109,7 +158,14 @@ func TestAccResourceNsxtPolicyGroup_pathCriteria(t *testing.T) { testResourceName := "nsxt_policy_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { + //TODO Remove this line after segment support for GM is merged + testAccOnlyLocalManager(t) + testAccPreCheck(t) + if testAccIsGlobalManager() { + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + } + }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyGroupCheckDestroy(state, name, defaultDomain) @@ -329,7 +385,6 @@ func testAccNsxtPolicyGroupExists(resourceName string, domainName string) resour return func(state *terraform.State) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := domains.NewDefaultGroupsClient(connector) rs, ok := state.RootModule().Resources[resourceName] if !ok { @@ -341,7 +396,14 @@ func testAccNsxtPolicyGroupExists(resourceName string, domainName string) resour return fmt.Errorf("Policy Group resource ID not set in resources") } - _, err := nsxClient.Get(domainName, resourceID) + var err error + if isPolicyGlobalManager(testAccProvider.Meta()) { + nsxClient := gm_domains.NewDefaultGroupsClient(connector) + _, err = nsxClient.Get(domainName, resourceID) + } else { + nsxClient := domains.NewDefaultGroupsClient(connector) + _, err = nsxClient.Get(domainName, resourceID) + } if err != nil { return fmt.Errorf("Error while retrieving policy Group ID %s. Error: %v", resourceID, err) } @@ -352,7 +414,7 @@ func testAccNsxtPolicyGroupExists(resourceName string, domainName string) resour func testAccNsxtPolicyGroupCheckDestroy(state *terraform.State, displayName string, domainName string) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := domains.NewDefaultGroupsClient(connector) + for _, rs := range state.RootModule().Resources { if rs.Type != "nsxt_policy_group" { @@ -360,9 +422,9 @@ func testAccNsxtPolicyGroupCheckDestroy(state *terraform.State, displayName stri } resourceID := rs.Primary.Attributes["id"] - _, err := nsxClient.Get(domainName, resourceID) - if err == nil { - return fmt.Errorf("Policy Group %s still exists", displayName) + isPolicyGlobalManager := isPolicyGlobalManager(testAccProvider.Meta()) + if resourceNsxtPolicyGroupExistsInDomain(resourceID, domainName, connector, isPolicyGlobalManager) { + return fmt.Errorf("Policy Group %s still exists in domain %s", displayName, domainName) } } return nil @@ -402,6 +464,64 @@ resource "nsxt_policy_group" "test" { `, name) } +func testAccNsxtGlobalPolicyGroupIPAddressCreateTemplate(name string, siteName string) string { + return fmt.Sprintf(` +data "nsxt_policy_site" "test" { + display_name = "%s" +} +resource "nsxt_policy_group" "test" { + display_name = "%s" + description = "Acceptance Test" + domain = data.nsxt_policy_site.test.id + + criteria { + ipaddress_expression { + ip_addresses = ["111.1.1.1", "222.2.2.2"] + } + } + + tag { + scope = "scope1" + tag = "tag1" + } + + tag { + scope = "scope2" + tag = "tag2" + } +} +`, siteName, name) +} + +func testAccNsxtGlobalPolicyGroupIPAddressUpdateTemplate(name string, siteName string) string { + return fmt.Sprintf(` +data "nsxt_policy_site" "test" { + display_name = "%s" +} +resource "nsxt_policy_group" "test" { + display_name = "%s" + description = "Acceptance Test" + domain = data.nsxt_policy_site.test.id + + criteria { + ipaddress_expression { + ip_addresses = ["111.2.1.1", "232.2.2.2"] + } + } + + conjunction { + operator = "OR" + } + + criteria { + ipaddress_expression { + ip_addresses = ["111.1.1.3", "222.2.2.4"] + } + } +} +`, siteName, name) +} + func testAccNsxtPolicyGroupIPAddressMultipleCreateTemplate(name string) string { return fmt.Sprintf(` resource "nsxt_policy_group" "test" { @@ -438,11 +558,13 @@ resource "nsxt_policy_group" "test" { } func testAccNsxtPolicyGroupPathsPrerequisites() string { - return fmt.Sprintf(` -data "nsxt_policy_transport_zone" "test"{ - display_name = "%s" -} - + var preRequisites string + if testAccIsGlobalManager() { + preRequisites = testNsxtGlobalPolicyGroupPathsTransportZone() + } else { + preRequisites = testNsxtPolicyGroupPathsTransportZone() + } + return preRequisites + fmt.Sprintf(` resource "nsxt_policy_segment" "test-1" { display_name = "group-test-1" transport_zone_path = data.nsxt_policy_transport_zone.test.path @@ -451,10 +573,28 @@ resource "nsxt_policy_segment" "test-1" { resource "nsxt_policy_segment" "test-2" { display_name = "group-test-1" transport_zone_path = data.nsxt_policy_transport_zone.test.path -}`, getOverlayTransportZoneName()) +}`) } +func testNsxtGlobalPolicyGroupPathsTransportZone() string { + return fmt.Sprintf(` +data "nsxt_policy_site" "test" { + display_name = "%s" +} +data "nsxt_policy_transport_zone" "test"{ + display_name = "%s" + site_path = data.nsxt_policy_site.test.path +}`, getTestSiteName(), getOverlayTransportZoneName()) +} + +func testNsxtPolicyGroupPathsTransportZone() string { + return fmt.Sprintf(` +data "nsxt_policy_transport_zone" "test"{ + display_name = "%s" +}`, getOverlayTransportZoneName()) +} + func testAccNsxtPolicyGroupPathsCreateTemplate(name string) string { return testAccNsxtPolicyGroupPathsPrerequisites() + fmt.Sprintf(` diff --git a/nsxt/resource_nsxt_policy_ip_address_allocation.go b/nsxt/resource_nsxt_policy_ip_address_allocation.go index fe64a0ba4..91690038e 100644 --- a/nsxt/resource_nsxt_policy_ip_address_allocation.go +++ b/nsxt/resource_nsxt_policy_ip_address_allocation.go @@ -51,14 +51,6 @@ func resourceNsxtPolicyIPAddressAllocation() *schema.Resource { } } -func resourceNsxtPolicyIPAddressParsePoolIDFromPath(poolPath string, connector *client.RestConnector) (string, error) { - poolID := getPolicyIDFromPath(poolPath) - if !resourceNsxtPolicyIPPoolExists(poolID, connector) { - return "", fmt.Errorf("IP Pool specified in path '%s' does not exist", poolPath) - } - return poolID, nil -} - func resourceNsxtPolicyIPAddressAllocationExists(poolID string, allocationID string, connector *client.RestConnector) bool { client := ip_pools.NewDefaultIpAllocationsClient(connector) @@ -84,11 +76,7 @@ func resourceNsxtPolicyIPAddressAllocationCreate(d *schema.ResourceData, m inter return policyResourceNotSupportedError() } - poolID, err := resourceNsxtPolicyIPAddressParsePoolIDFromPath(d.Get("pool_path").(string), connector) - - if err != nil { - return err - } + poolID := getPolicyIDFromPath(d.Get("pool_path").(string)) id := d.Get("nsx_id").(string) if id == "" { @@ -117,7 +105,7 @@ func resourceNsxtPolicyIPAddressAllocationCreate(d *schema.ResourceData, m inter // Create the resource using PATCH log.Printf("[INFO] Creating IPAddressAllocation with ID %s", id) - err = client.Patch(poolID, id, obj) + err := client.Patch(poolID, id, obj) if err != nil { return handleCreateError("IPAddressAllocation", id, err) } @@ -141,11 +129,7 @@ func resourceNsxtPolicyIPAddressAllocationRead(d *schema.ResourceData, m interfa return fmt.Errorf("Error obtaining IPAddressAllocation ID") } - poolID, err := resourceNsxtPolicyIPAddressParsePoolIDFromPath(d.Get("pool_path").(string), connector) - - if err != nil { - return err - } + poolID := getPolicyIDFromPath(d.Get("pool_path").(string)) obj, err := client.Get(poolID, id) if err != nil { @@ -195,13 +179,9 @@ func resourceNsxtPolicyIPAddressAllocationDelete(d *schema.ResourceData, m inter return fmt.Errorf("Error obtaining IPAddressAllocation ID") } - poolID, err := resourceNsxtPolicyIPAddressParsePoolIDFromPath(d.Get("pool_path").(string), connector) - - if err != nil { - return err - } + poolID := getPolicyIDFromPath(d.Get("pool_path").(string)) - err = client.Delete(poolID, id) + err := client.Delete(poolID, id) if err != nil { return handleDeleteError("IPAddressAllocation", id, err) } diff --git a/nsxt/resource_nsxt_policy_ip_address_allocation_test.go b/nsxt/resource_nsxt_policy_ip_address_allocation_test.go index 9fd3aefb8..d7e3351ee 100644 --- a/nsxt/resource_nsxt_policy_ip_address_allocation_test.go +++ b/nsxt/resource_nsxt_policy_ip_address_allocation_test.go @@ -27,7 +27,7 @@ func TestAccResourceNsxtPolicyIPAddressAllocation_basic(t *testing.T) { testResourceName := "nsxt_policy_ip_address_allocation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyIPAddressAllocationCheckDestroy(state, accTestPolicyIPAddressAllocationCreateAttributes["display_name"]) @@ -75,7 +75,7 @@ func TestAccResourceNsxtPolicyIPAddressAllocation_anyIPBasic(t *testing.T) { testResourceName := "nsxt_policy_ip_address_allocation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyIPAddressAllocationCheckDestroy(state, accTestPolicyIPAddressAllocationCreateAttributes["display_name"]) @@ -124,7 +124,7 @@ func TestAccResourceNsxtPolicyIPAddressAllocation_importBasic(t *testing.T) { testResourceName := "nsxt_policy_ip_address_allocation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyIPAddressAllocationCheckDestroy(state, name) @@ -183,12 +183,9 @@ func testAccNsxtPolicyIPAddressAllocationExists(resourceName string) resource.Te if poolPath == "" { return fmt.Errorf("No pool_path found for IP Address Allocation with ID %s", resourceID) } - poolID, err := resourceNsxtPolicyIPAddressParsePoolIDFromPath(poolPath, connector) - if err != nil { - return err - } + poolID := getPolicyIDFromPath(poolPath) - _, err = nsxClient.Get(poolID, resourceID) + _, err := nsxClient.Get(poolID, resourceID) if err != nil { return fmt.Errorf("Error while retrieving policy IPAddressAllocation ID %s. Error: %v", resourceID, err) } @@ -211,12 +208,9 @@ func testAccNsxtPolicyIPAddressAllocationCheckDestroy(state *terraform.State, di if poolPath == "" { return fmt.Errorf("No pool_path found for IP Address Allocation with ID %s", resourceID) } - poolID, err := resourceNsxtPolicyIPAddressParsePoolIDFromPath(poolPath, connector) - if err != nil { - return err - } + poolID := getPolicyIDFromPath(poolPath) - _, err = nsxClient.Get(poolID, resourceID) + _, err := nsxClient.Get(poolID, resourceID) if err == nil { return fmt.Errorf("Policy IPAddressAllocation %s still exists", displayName) } diff --git a/nsxt/resource_nsxt_policy_ip_block.go b/nsxt/resource_nsxt_policy_ip_block.go index 174e3bcbf..df9d06638 100644 --- a/nsxt/resource_nsxt_policy_ip_block.go +++ b/nsxt/resource_nsxt_policy_ip_block.go @@ -39,7 +39,7 @@ func resourceNsxtPolicyIPBlock() *schema.Resource { } } -func resourceNsxtPolicyIPBlockExists(id string, connector *client.RestConnector) bool { +func resourceNsxtPolicyIPBlockExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { client := infra.NewDefaultIpBlocksClient(connector) _, err := client.Get(id) @@ -84,7 +84,7 @@ func resourceNsxtPolicyIPBlockCreate(d *schema.ResourceData, m interface{}) erro connector := getPolicyConnector(m) client := infra.NewDefaultIpBlocksClient(connector) - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyIPBlockExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyIPBlockExists) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_ip_block_test.go b/nsxt/resource_nsxt_policy_ip_block_test.go index 553d42702..22e8ce27e 100644 --- a/nsxt/resource_nsxt_policy_ip_block_test.go +++ b/nsxt/resource_nsxt_policy_ip_block_test.go @@ -17,7 +17,7 @@ func TestAccResourceNsxtPolicyIPBlock_minimal(t *testing.T) { cidr := "192.168.1.0/24" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPBlockCheckDestroy(state) @@ -46,7 +46,7 @@ func TestAccResourceNsxtPolicyIPBlock_basic(t *testing.T) { cidr2 := "191.166.1.0/24" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPBlockCheckDestroy(state) @@ -85,7 +85,7 @@ func TestAccResourceNsxtPolicyIPBlock_importBasic(t *testing.T) { testResourceName := "nsxt_policy_ip_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPBlockCheckDestroy(state) diff --git a/nsxt/resource_nsxt_policy_ip_pool.go b/nsxt/resource_nsxt_policy_ip_pool.go index e9b121ed9..4fd0eb22f 100644 --- a/nsxt/resource_nsxt_policy_ip_pool.go +++ b/nsxt/resource_nsxt_policy_ip_pool.go @@ -33,7 +33,7 @@ func resourceNsxtPolicyIPPool() *schema.Resource { } } -func resourceNsxtPolicyIPPoolExists(id string, connector *client.RestConnector) bool { +func resourceNsxtPolicyIPPoolExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { client := infra.NewDefaultIpPoolsClient(connector) _, err := client.Get(id) @@ -82,7 +82,7 @@ func resourceNsxtPolicyIPPoolCreate(d *schema.ResourceData, m interface{}) error connector := getPolicyConnector(m) client := infra.NewDefaultIpPoolsClient(connector) - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyIPPoolExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyIPPoolExists) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_ip_pool_block_subnet_test.go b/nsxt/resource_nsxt_policy_ip_pool_block_subnet_test.go index 5e7b7c4ef..a1fd4dcf9 100644 --- a/nsxt/resource_nsxt_policy_ip_pool_block_subnet_test.go +++ b/nsxt/resource_nsxt_policy_ip_pool_block_subnet_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtPolicyIPPoolBlockSubnet_minimal(t *testing.T) { testResourceName := "nsxt_policy_ip_pool_block_subnet.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolBlockSubnetCheckDestroy(state) @@ -53,7 +53,7 @@ func TestAccResourceNsxtPolicyIPPoolBlockSubnet_basic(t *testing.T) { testResourceName := "nsxt_policy_ip_pool_block_subnet.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolBlockSubnetCheckDestroy(state) @@ -103,7 +103,7 @@ func TestAccResourceNsxtPolicyIPPoolBlockSubnet_import_basic(t *testing.T) { testResourceName := "nsxt_policy_ip_pool_block_subnet.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolBlockSubnetCheckDestroy(state) diff --git a/nsxt/resource_nsxt_policy_ip_pool_static_subnet_test.go b/nsxt/resource_nsxt_policy_ip_pool_static_subnet_test.go index 94462608b..05125419d 100644 --- a/nsxt/resource_nsxt_policy_ip_pool_static_subnet_test.go +++ b/nsxt/resource_nsxt_policy_ip_pool_static_subnet_test.go @@ -18,7 +18,7 @@ func TestAccResourceNsxtPolicyIPPoolStaticSubnet_minimal(t *testing.T) { testResourceName := "nsxt_policy_ip_pool_static_subnet.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolStaticSubnetCheckDestroy(state) @@ -51,7 +51,7 @@ func TestAccResourceNsxtPolicyIPPoolStaticSubnet_basic(t *testing.T) { testResourceName := "nsxt_policy_ip_pool_static_subnet.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolStaticSubnetCheckDestroy(state) @@ -117,7 +117,7 @@ func TestAccResourceNsxtPolicyIPPoolStaticSubnet_import_basic(t *testing.T) { testResourceName := "nsxt_policy_ip_pool_static_subnet.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolStaticSubnetCheckDestroy(state) diff --git a/nsxt/resource_nsxt_policy_ip_pool_test.go b/nsxt/resource_nsxt_policy_ip_pool_test.go index 492a29d8a..f654db770 100644 --- a/nsxt/resource_nsxt_policy_ip_pool_test.go +++ b/nsxt/resource_nsxt_policy_ip_pool_test.go @@ -16,7 +16,7 @@ func TestAccResourceNsxtPolicyIPPool_minimal(t *testing.T) { testResourceName := "nsxt_policy_ip_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolCheckDestroy(state) @@ -40,7 +40,7 @@ func TestAccResourceNsxtPolicyIPPool_basic(t *testing.T) { testResourceName := "nsxt_policy_ip_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolCheckDestroy(state) @@ -73,7 +73,7 @@ func TestAccResourceNsxtPolicyIPPool_import_basic(t *testing.T) { testResourceName := "nsxt_policy_ip_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyIPPoolCheckDestroy(state) diff --git a/nsxt/resource_nsxt_policy_lb_pool.go b/nsxt/resource_nsxt_policy_lb_pool.go index 66a56c202..9de0e955b 100644 --- a/nsxt/resource_nsxt_policy_lb_pool.go +++ b/nsxt/resource_nsxt_policy_lb_pool.go @@ -401,7 +401,7 @@ func setPolicyPoolSnatInSchema(d *schema.ResourceData, snat *data.StructValue) e return nil } -func resourceNsxtPolicyLBPoolExists(id string, connector *client.RestConnector) bool { +func resourceNsxtPolicyLBPoolExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { client := infra.NewDefaultLbPoolsClient(connector) _, err := client.Get(id) @@ -427,7 +427,7 @@ func resourceNsxtPolicyLBPoolCreate(d *schema.ResourceData, m interface{}) error } // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyLBPoolExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyLBPoolExists) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_lb_pool_test.go b/nsxt/resource_nsxt_policy_lb_pool_test.go index 8ab898a64..55a61475a 100644 --- a/nsxt/resource_nsxt_policy_lb_pool_test.go +++ b/nsxt/resource_nsxt_policy_lb_pool_test.go @@ -31,7 +31,7 @@ func TestAccResourceNsxtPolicyLBPool_basic(t *testing.T) { testResourceName := "nsxt_policy_lb_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBPoolCheckDestroy(state, accTestPolicyLBPoolCreateAttributes["display_name"]) @@ -130,7 +130,7 @@ func TestAccResourceNsxtPolicyLBPool_snat(t *testing.T) { testResourceName := "nsxt_policy_lb_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBPoolCheckDestroy(state, accTestPolicyLBPoolCreateAttributes["display_name"]) @@ -196,7 +196,7 @@ func TestAccResourceNsxtPolicyLBPool_importBasic(t *testing.T) { testResourceName := "nsxt_policy_lb_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBPoolCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_lb_service.go b/nsxt/resource_nsxt_policy_lb_service.go index 444e6fdb1..3e46f76f3 100644 --- a/nsxt/resource_nsxt_policy_lb_service.go +++ b/nsxt/resource_nsxt_policy_lb_service.go @@ -73,7 +73,7 @@ func resourceNsxtPolicyLBService() *schema.Resource { } } -func resourceNsxtPolicyLBServiceExists(id string, connector *client.RestConnector) bool { +func resourceNsxtPolicyLBServiceExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { client := infra.NewDefaultLbServicesClient(connector) _, err := client.Get(id) @@ -99,7 +99,7 @@ func resourceNsxtPolicyLBServiceCreate(d *schema.ResourceData, m interface{}) er } // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyLBServiceExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyLBServiceExists) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_lb_service_test.go b/nsxt/resource_nsxt_policy_lb_service_test.go index 4e1aedbeb..3335b2809 100644 --- a/nsxt/resource_nsxt_policy_lb_service_test.go +++ b/nsxt/resource_nsxt_policy_lb_service_test.go @@ -31,17 +31,16 @@ var accTestPolicyLBServiceUpdateAttributes = map[string]string{ func TestAccResourceNsxtPolicyLBService_basic(t *testing.T) { testResourceName := "nsxt_policy_lb_service.test" - edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBServiceCheckDestroy(state, accTestPolicyLBServiceCreateAttributes["display_name"]) }, Steps: []resource.TestStep{ { - Config: testAccNsxtPolicyLBServiceTemplate(edgeClusterName, true), + Config: testAccNsxtPolicyLBServiceTemplate(true), Check: resource.ComposeTestCheckFunc( testAccNsxtPolicyLBServiceExists(testResourceName), resource.TestCheckResourceAttr(testResourceName, "display_name", accTestPolicyLBServiceCreateAttributes["display_name"]), @@ -58,7 +57,7 @@ func TestAccResourceNsxtPolicyLBService_basic(t *testing.T) { ), }, { - Config: testAccNsxtPolicyLBServiceTemplate(edgeClusterName, false), + Config: testAccNsxtPolicyLBServiceTemplate(false), Check: resource.ComposeTestCheckFunc( testAccNsxtPolicyLBServiceExists(testResourceName), resource.TestCheckResourceAttr(testResourceName, "display_name", accTestPolicyLBServiceUpdateAttributes["display_name"]), @@ -81,6 +80,7 @@ func TestAccResourceNsxtPolicyLBService_basic(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "description", ""), resource.TestCheckResourceAttrSet(testResourceName, "nsx_id"), resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttr(testResourceName, "connectivity_path", ""), resource.TestCheckResourceAttrSet(testResourceName, "revision"), resource.TestCheckResourceAttr(testResourceName, "tag.#", "0"), ), @@ -94,7 +94,7 @@ func TestAccResourceNsxtPolicyLBService_importBasic(t *testing.T) { testResourceName := "nsxt_policy_lb_service.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBServiceCheckDestroy(state, name) @@ -155,21 +155,14 @@ func testAccNsxtPolicyLBServiceCheckDestroy(state *terraform.State, displayName return nil } -func testAccNsxtPolicyLBServiceTemplate(edgeClusterName string, createFlow bool) string { +func testAccNsxtPolicyLBServiceTemplate(createFlow bool) string { var attrMap map[string]string if createFlow { attrMap = accTestPolicyLBServiceCreateAttributes } else { attrMap = accTestPolicyLBServiceUpdateAttributes } - return fmt.Sprintf(` -data "nsxt_policy_edge_cluster" "test" { - display_name = "%s" -} - -resource "nsxt_policy_tier0_gateway" "test" { - display_name = "terraform-lb-test" -} + return testAccNsxtPolicyLBServiceDeps() + fmt.Sprintf(` resource "nsxt_policy_tier1_gateway" "test1" { display_name = "terraform-lb-test-1" @@ -199,11 +192,22 @@ resource "nsxt_policy_lb_service" "test" { data "nsxt_policy_realization_info" "realization_info" { path = nsxt_policy_lb_service.test.path -}`, edgeClusterName, attrMap["display_name"], attrMap["description"], attrMap["connectivity_path"], attrMap["enabled"], attrMap["error_log_level"], attrMap["size"]) +}`, attrMap["display_name"], attrMap["description"], attrMap["connectivity_path"], attrMap["enabled"], attrMap["error_log_level"], attrMap["size"]) } +// Terraform test does not respect T1-T0 dependency upon destroy, +// so we need workaround that detaches T1 from T0 to avoid destroy error func testAccNsxtPolicyLBServiceMinimalistic() string { - return fmt.Sprintf(` + return testAccNsxtPolicyLBServiceDeps() + fmt.Sprintf(` +resource "nsxt_policy_tier1_gateway" "test1" { + display_name = "terraform-lb-test-1-update" + edge_cluster_path = data.nsxt_policy_edge_cluster.test.path +} + +resource "nsxt_policy_tier1_gateway" "test2" { + display_name = "terraform-lb-test-2-update" + edge_cluster_path = data.nsxt_policy_edge_cluster.test.path +} resource "nsxt_policy_lb_service" "test" { display_name = "%s" } @@ -212,3 +216,29 @@ data "nsxt_policy_realization_info" "realization_info" { path = nsxt_policy_lb_service.test.path }`, accTestPolicyLBServiceUpdateAttributes["display_name"]) } + +func testAccNsxtPolicyLBServiceDeps() string { + return fmt.Sprintf(` +data "nsxt_policy_edge_cluster" "test" { + display_name = "%s" +} + +resource "nsxt_policy_tier0_gateway" "test" { + display_name = "terraform-lb-test" +}`, getEdgeClusterName()) + +} + +func testAccNsxtPolicyLBServiceTier1CleanUp() string { + return testAccNsxtPolicyLBServiceDeps() + ` +resource "nsxt_policy_tier1_gateway" "test1" { + display_name = "terraform-lb-test-1-update" + edge_cluster_path = data.nsxt_policy_edge_cluster.test.path +} + +resource "nsxt_policy_tier1_gateway" "test2" { + display_name = "terraform-lb-test-2-update" + edge_cluster_path = data.nsxt_policy_edge_cluster.test.path +}` + +} diff --git a/nsxt/resource_nsxt_policy_lb_virtual_server.go b/nsxt/resource_nsxt_policy_lb_virtual_server.go index e7aecfd45..6c25edfe5 100644 --- a/nsxt/resource_nsxt_policy_lb_virtual_server.go +++ b/nsxt/resource_nsxt_policy_lb_virtual_server.go @@ -373,7 +373,7 @@ func policyLBVirtualServerVersionDepenantSet(d *schema.ResourceData, obj *model. } } -func resourceNsxtPolicyLBVirtualServerExists(id string, connector *client.RestConnector) bool { +func resourceNsxtPolicyLBVirtualServerExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { client := infra.NewDefaultLbVirtualServersClient(connector) _, err := client.Get(id) @@ -399,7 +399,7 @@ func resourceNsxtPolicyLBVirtualServerCreate(d *schema.ResourceData, m interface } // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyLBVirtualServerExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyLBVirtualServerExists) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_lb_virtual_server_test.go b/nsxt/resource_nsxt_policy_lb_virtual_server_test.go index 24b19ca62..39483dbcb 100644 --- a/nsxt/resource_nsxt_policy_lb_virtual_server_test.go +++ b/nsxt/resource_nsxt_policy_lb_virtual_server_test.go @@ -48,7 +48,7 @@ func TestAccResourceNsxtPolicyLBVirtualServer_basic(t *testing.T) { testResourceName := "nsxt_policy_lb_virtual_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBVirtualServerCheckDestroy(state, accTestPolicyLBVirtualServerCreateAttributes["display_name"]) @@ -126,7 +126,11 @@ func TestAccResourceNsxtPolicyLBVirtualServer_withSSL(t *testing.T) { testResourceName := "nsxt_policy_lb_virtual_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_CERTIFICATE_NAME") }, + PreCheck: func() { + testAccOnlyLocalManager(t) + testAccPreCheck(t) + testAccEnvDefined(t, "NSXT_TEST_CERTIFICATE_NAME") + }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBVirtualServerCheckDestroy(state, accTestPolicyLBVirtualServerCreateAttributes["display_name"]) @@ -191,7 +195,7 @@ func TestAccResourceNsxtPolicyLBVirtualServer_withAccessList(t *testing.T) { testResourceName := "nsxt_policy_lb_virtual_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBVirtualServerCheckDestroy(state, accTestPolicyLBVirtualServerCreateAttributes["display_name"]) @@ -256,7 +260,7 @@ func TestAccResourceNsxtPolicyLBVirtualServer_importBasic(t *testing.T) { testResourceName := "nsxt_policy_lb_virtual_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyLBVirtualServerCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_nat_rule_test.go b/nsxt/resource_nsxt_policy_nat_rule_test.go index 07f1d9ec1..4ff5f479b 100644 --- a/nsxt/resource_nsxt_policy_nat_rule_test.go +++ b/nsxt/resource_nsxt_policy_nat_rule_test.go @@ -21,7 +21,7 @@ func TestAccResourceNsxtPolicyNATRule_minimalT0(t *testing.T) { action := model.PolicyNatRule_ACTION_REFLEXIVE resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyNATRuleCheckDestroy(state, name) @@ -56,7 +56,7 @@ func TestAccResourceNsxtPolicyNATRule_basicT1(t *testing.T) { action := model.PolicyNatRule_ACTION_DNAT resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyNATRuleCheckDestroy(state, name) @@ -133,7 +133,7 @@ func TestAccResourceNsxtPolicyNATRule_basicT0(t *testing.T) { action := model.PolicyNatRule_ACTION_REFLEXIVE resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyNATRuleCheckDestroy(state, name) @@ -186,7 +186,7 @@ func TestAccResourceNsxtPolicyNATRule_basicT1Import(t *testing.T) { action := model.PolicyNatRule_ACTION_DNAT resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyNATRuleCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_security_policy.go b/nsxt/resource_nsxt_policy_security_policy.go index b0f839e05..80c650d33 100644 --- a/nsxt/resource_nsxt_policy_security_policy.go +++ b/nsxt/resource_nsxt_policy_security_policy.go @@ -7,6 +7,8 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + gm_domains "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/domains" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "log" @@ -25,10 +27,16 @@ func resourceNsxtPolicySecurityPolicy() *schema.Resource { } } -func resourceNsxtPolicySecurityPolicyExistsInDomain(id string, domainName string, connector *client.RestConnector) bool { - client := domains.NewDefaultSecurityPoliciesClient(connector) +func resourceNsxtPolicySecurityPolicyExistsInDomain(id string, domainName string, connector *client.RestConnector, isGlobalManager bool) bool { + var err error + if isGlobalManager { + client := gm_domains.NewDefaultSecurityPoliciesClient(connector) + _, err = client.Get(domainName, id) + } else { + client := domains.NewDefaultSecurityPoliciesClient(connector) + _, err = client.Get(domainName, id) + } - _, err := client.Get(domainName, id) if err == nil { return true } @@ -41,18 +49,17 @@ func resourceNsxtPolicySecurityPolicyExistsInDomain(id string, domainName string return false } -func resourceNsxtPolicySecurityPolicyExistsPartial(domainName string) func(id string, connector *client.RestConnector) bool { - return func(id string, connector *client.RestConnector) bool { - return resourceNsxtPolicySecurityPolicyExistsInDomain(id, domainName, connector) +func resourceNsxtPolicySecurityPolicyExistsPartial(domainName string) func(id string, connector *client.RestConnector, isGlobalManager bool) bool { + return func(id string, connector *client.RestConnector, isGlobalManager bool) bool { + return resourceNsxtPolicySecurityPolicyExistsInDomain(id, domainName, connector, isGlobalManager) } } func resourceNsxtPolicySecurityPolicyCreate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultSecurityPoliciesClient(connector) // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicySecurityPolicyExistsPartial(d.Get("domain").(string))) + id, err := getOrGenerateID(d, m, resourceNsxtPolicySecurityPolicyExistsPartial(d.Get("domain").(string))) if err != nil { return err } @@ -82,9 +89,19 @@ func resourceNsxtPolicySecurityPolicyCreate(d *schema.ResourceData, m interface{ TcpStrict: &tcpStrict, Rules: rules, } - log.Printf("[INFO] Creating Security Policy with ID %s", id) - err = client.Patch(d.Get("domain").(string), id, obj) + if isPolicyGlobalManager(m) { + gmObj, err1 := convertModelBindingType(obj, model.SecurityPolicyBindingType(), gm_model.SecurityPolicyBindingType()) + if err1 != nil { + return err1 + } + client := gm_domains.NewDefaultSecurityPoliciesClient(connector) + err = client.Patch(d.Get("domain").(string), id, gmObj.(gm_model.SecurityPolicy)) + } else { + client := domains.NewDefaultSecurityPoliciesClient(connector) + err = client.Patch(d.Get("domain").(string), id, obj) + } + if err != nil { return handleCreateError("Security Policy", id, err) } @@ -97,19 +114,31 @@ func resourceNsxtPolicySecurityPolicyCreate(d *schema.ResourceData, m interface{ func resourceNsxtPolicySecurityPolicyRead(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultSecurityPoliciesClient(connector) - id := d.Id() + domainName := d.Get("domain").(string) if id == "" { return fmt.Errorf("Error obtaining Security Policy id") } - - domainName := d.Get("domain").(string) - obj, err := client.Get(domainName, id) - if err != nil { - return handleReadError(d, "Security Policy", id, err) + var obj model.SecurityPolicy + if isPolicyGlobalManager(m) { + client := gm_domains.NewDefaultSecurityPoliciesClient(connector) + gmObj, err := client.Get(domainName, id) + if err != nil { + return handleReadError(d, "SecurityPolicy", id, err) + } + rawObj, err := convertModelBindingType(gmObj, gm_model.SecurityPolicyBindingType(), model.SecurityPolicyBindingType()) + if err != nil { + return err + } + obj = rawObj.(model.SecurityPolicy) + } else { + var err error + client := domains.NewDefaultSecurityPoliciesClient(connector) + obj, err = client.Get(domainName, id) + if err != nil { + return handleReadError(d, "SecurityPolicy", id, err) + } } - d.Set("display_name", obj.DisplayName) d.Set("description", obj.Description) setPolicyTagsInSchema(d, obj.Tags) @@ -135,7 +164,6 @@ func resourceNsxtPolicySecurityPolicyRead(d *schema.ResourceData, m interface{}) func resourceNsxtPolicySecurityPolicyUpdate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := domains.NewDefaultSecurityPoliciesClient(connector) id := d.Id() if id == "" { @@ -170,8 +198,23 @@ func resourceNsxtPolicySecurityPolicyUpdate(d *schema.ResourceData, m interface{ Rules: rules, } - // We need to use PUT, because PATCH will not replace the whole rule list - _, err := client.Update(d.Get("domain").(string), id, obj) + var err error + if isPolicyGlobalManager(m) { + gmObj, err1 := convertModelBindingType(obj, model.SecurityPolicyBindingType(), gm_model.SecurityPolicyBindingType()) + if err1 != nil { + return err1 + } + gmSecurityPolicy := gmObj.(gm_model.SecurityPolicy) + client := gm_domains.NewDefaultSecurityPoliciesClient(connector) + + // We need to use PUT, because PATCH will not replace the whole rule list + _, err = client.Update(d.Get("domain").(string), id, gmSecurityPolicy) + } else { + client := domains.NewDefaultSecurityPoliciesClient(connector) + + // We need to use PUT, because PATCH will not replace the whole rule list + _, err = client.Update(d.Get("domain").(string), id, obj) + } if err != nil { return handleUpdateError("Security Policy", id, err) } @@ -186,9 +229,16 @@ func resourceNsxtPolicySecurityPolicyDelete(d *schema.ResourceData, m interface{ } connector := getPolicyConnector(m) - client := domains.NewDefaultSecurityPoliciesClient(connector) + var err error + + if isPolicyGlobalManager(m) { + client := gm_domains.NewDefaultSecurityPoliciesClient(connector) + err = client.Delete(d.Get("domain").(string), id) + } else { + client := domains.NewDefaultSecurityPoliciesClient(connector) + err = client.Delete(d.Get("domain").(string), id) + } - err := client.Delete(d.Get("domain").(string), id) if err != nil { return handleDeleteError("Security Policy", id, err) } diff --git a/nsxt/resource_nsxt_policy_security_policy_test.go b/nsxt/resource_nsxt_policy_security_policy_test.go index f47fab4b1..faa706e80 100644 --- a/nsxt/resource_nsxt_policy_security_policy_test.go +++ b/nsxt/resource_nsxt_policy_security_policy_test.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/domains" "testing" ) @@ -33,7 +32,7 @@ func TestAccResourceNsxtPolicySecurityPolicy_basic(t *testing.T) { }, Steps: []resource.TestStep{ { - Config: testAccNsxtPolicySecurityPolicyBasic(name, comments1), + Config: testAccNsxtPolicySecurityPolicyBasic(name, comments1, defaultDomain), Check: resource.ComposeTestCheckFunc( testAccNsxtPolicySecurityPolicyExists(testResourceName, defaultDomain), resource.TestCheckResourceAttr(testResourceName, "display_name", name), @@ -51,7 +50,7 @@ func TestAccResourceNsxtPolicySecurityPolicy_basic(t *testing.T) { ), }, { - Config: testAccNsxtPolicySecurityPolicyBasic(updatedName, comments2), + Config: testAccNsxtPolicySecurityPolicyBasic(updatedName, comments2, defaultDomain), Check: resource.ComposeTestCheckFunc( testAccNsxtPolicySecurityPolicyExists(testResourceName, defaultDomain), resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), @@ -68,7 +67,7 @@ func TestAccResourceNsxtPolicySecurityPolicy_basic(t *testing.T) { ), }, { - Config: testAccNsxtPolicySecurityPolicyWithRule(updatedName, direction1, proto1, tag1), + Config: testAccNsxtPolicySecurityPolicyWithRule(updatedName, direction1, proto1, tag1, defaultDomain), Check: resource.ComposeTestCheckFunc( testAccNsxtPolicySecurityPolicyExists(testResourceName, defaultDomain), resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), @@ -91,7 +90,7 @@ func TestAccResourceNsxtPolicySecurityPolicy_basic(t *testing.T) { ), }, { - Config: testAccNsxtPolicySecurityPolicyWithRule(updatedName, direction2, proto2, tag2), + Config: testAccNsxtPolicySecurityPolicyWithRule(updatedName, direction2, proto2, tag2, defaultDomain), Check: resource.ComposeTestCheckFunc( testAccNsxtPolicySecurityPolicyExists(testResourceName, defaultDomain), resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), @@ -213,7 +212,7 @@ func TestAccResourceNsxtPolicySecurityPolicy_importBasic(t *testing.T) { }, Steps: []resource.TestStep{ { - Config: testAccNsxtPolicySecurityPolicyBasic(name, "import"), + Config: testAccNsxtPolicySecurityPolicyBasic(name, "import", defaultDomain), }, { ResourceName: testResourceName, @@ -223,12 +222,121 @@ func TestAccResourceNsxtPolicySecurityPolicy_importBasic(t *testing.T) { }, }) } +func TestAccResourceNsxtGlobalPolicySecurityPolicy_withSite(t *testing.T) { + name := fmt.Sprintf("terraform-test-site") + testResourceName := "nsxt_policy_security_policy.test" + updatedName := fmt.Sprintf("%s-update", name) + comments1 := "Acceptance test create" + comments2 := "Acceptance test update" + direction1 := "IN" + direction2 := "OUT" + proto1 := "IPV4" + proto2 := "IPV4_IPV6" + defaultAction := "ALLOW" + tag1 := "abc" + tag2 := "def" + domain := getTestSiteName() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccOnlyGlobalManager(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtPolicySecurityPolicyCheckDestroy(state, name, domain) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicySecurityPolicyBasic(name, comments1, domain), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicySecurityPolicyExists(testResourceName, domain), + resource.TestCheckResourceAttr(testResourceName, "display_name", name), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "category", "Application"), + resource.TestCheckResourceAttr(testResourceName, "domain", domain), + resource.TestCheckResourceAttr(testResourceName, "comments", comments1), + resource.TestCheckResourceAttr(testResourceName, "locked", "true"), + resource.TestCheckResourceAttr(testResourceName, "scope.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "sequence_number", "3"), + resource.TestCheckResourceAttr(testResourceName, "stateful", "true"), + resource.TestCheckResourceAttr(testResourceName, "tcp_strict", "false"), + resource.TestCheckResourceAttr(testResourceName, "rule.#", "0"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + { + Config: testAccNsxtPolicySecurityPolicyBasic(updatedName, comments2, domain), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicySecurityPolicyExists(testResourceName, domain), + resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "category", "Application"), + resource.TestCheckResourceAttr(testResourceName, "domain", domain), + resource.TestCheckResourceAttr(testResourceName, "comments", comments2), + resource.TestCheckResourceAttr(testResourceName, "locked", "true"), + resource.TestCheckResourceAttr(testResourceName, "scope.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "sequence_number", "3"), + resource.TestCheckResourceAttr(testResourceName, "stateful", "true"), + resource.TestCheckResourceAttr(testResourceName, "tcp_strict", "false"), + resource.TestCheckResourceAttr(testResourceName, "rule.#", "0"), + ), + }, + { + Config: testAccNsxtPolicySecurityPolicyWithRule(updatedName, direction1, proto1, tag1, domain), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicySecurityPolicyExists(testResourceName, domain), + resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "category", "Application"), + resource.TestCheckResourceAttr(testResourceName, "domain", domain), + resource.TestCheckResourceAttr(testResourceName, "comments", ""), + resource.TestCheckResourceAttr(testResourceName, "locked", "false"), + resource.TestCheckResourceAttr(testResourceName, "scope.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "sequence_number", "3"), + resource.TestCheckResourceAttr(testResourceName, "stateful", "true"), + resource.TestCheckResourceAttr(testResourceName, "tcp_strict", "false"), + resource.TestCheckResourceAttr(testResourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "rule.0.display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "rule.0.direction", direction1), + resource.TestCheckResourceAttr(testResourceName, "rule.0.ip_version", proto1), + resource.TestCheckResourceAttr(testResourceName, "rule.0.action", defaultAction), + resource.TestCheckResourceAttr(testResourceName, "rule.0.log_label", tag1), + resource.TestCheckResourceAttr(testResourceName, "rule.0.tag.#", "1"), + ), + }, + { + Config: testAccNsxtPolicySecurityPolicyWithRule(updatedName, direction2, proto2, tag2, domain), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicySecurityPolicyExists(testResourceName, domain), + resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "category", "Application"), + resource.TestCheckResourceAttr(testResourceName, "domain", domain), + resource.TestCheckResourceAttr(testResourceName, "comments", ""), + resource.TestCheckResourceAttr(testResourceName, "locked", "false"), + resource.TestCheckResourceAttr(testResourceName, "scope.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "sequence_number", "3"), + resource.TestCheckResourceAttr(testResourceName, "stateful", "true"), + resource.TestCheckResourceAttr(testResourceName, "tcp_strict", "false"), + resource.TestCheckResourceAttr(testResourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "rule.0.display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "rule.0.direction", direction2), + resource.TestCheckResourceAttr(testResourceName, "rule.0.ip_version", proto2), + resource.TestCheckResourceAttr(testResourceName, "rule.0.action", defaultAction), + resource.TestCheckResourceAttr(testResourceName, "rule.0.log_label", tag2), + resource.TestCheckResourceAttr(testResourceName, "rule.0.tag.#", "1"), + ), + }, + }, + }) + +} func testAccNsxtPolicySecurityPolicyExists(resourceName string, domainName string) resource.TestCheckFunc { return func(state *terraform.State) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := domains.NewDefaultSecurityPoliciesClient(connector) rs, ok := state.RootModule().Resources[resourceName] if !ok { @@ -240,18 +348,17 @@ func testAccNsxtPolicySecurityPolicyExists(resourceName string, domainName strin return fmt.Errorf("Policy SecurityPolicy resource ID not set in resources") } - _, err := nsxClient.Get(domainName, resourceID) - if err != nil { - return fmt.Errorf("Error while retrieving policy SecurityPolicy ID %s. Error: %v", resourceID, err) + isPolicyGlobalManager := isPolicyGlobalManager(testAccProvider.Meta()) + if !resourceNsxtPolicySecurityPolicyExistsInDomain(resourceID, domainName, connector, isPolicyGlobalManager) { + return fmt.Errorf("Error while retrieving policy SecurityPolicy ID %s", resourceID) } - return nil } } func testAccNsxtPolicySecurityPolicyCheckDestroy(state *terraform.State, displayName string, domainName string) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := domains.NewDefaultSecurityPoliciesClient(connector) + isPolicyGlobalManager := isPolicyGlobalManager(testAccProvider.Meta()) for _, rs := range state.RootModule().Resources { if rs.Type != "nsxt_policy_security_policy" { @@ -259,16 +366,16 @@ func testAccNsxtPolicySecurityPolicyCheckDestroy(state *terraform.State, display } resourceID := rs.Primary.Attributes["id"] - _, err := nsxClient.Get(domainName, resourceID) - if err == nil { + if resourceNsxtPolicySecurityPolicyExistsInDomain(resourceID, domainName, connector, isPolicyGlobalManager) { return fmt.Errorf("Policy SecurityPolicy %s still exists", displayName) } } return nil } -func testAccNsxtPolicySecurityPolicyBasic(name string, comments string) string { - return fmt.Sprintf(` +func testAccNsxtPolicySecurityPolicyBasic(name string, comments string, domainName string) string { + if domainName == defaultDomain { + return fmt.Sprintf(` resource "nsxt_policy_security_policy" "test" { display_name = "%s" description = "Acceptance Test" @@ -285,10 +392,31 @@ resource "nsxt_policy_security_policy" "test" { } }`, name, comments) + } else { + return testAccNsxtGlobalPolicySite(domainName) + fmt.Sprintf(` +resource "nsxt_policy_security_policy" "test" { + display_name = "%s" + description = "Acceptance Test" + category = "Application" + comments = "%s" + locked = true + sequence_number = 3 + stateful = true + tcp_strict = false + domain = data.nsxt_policy_site.test.id + + tag { + scope = "color" + tag = "orange" + } + +}`, name, comments) + } } -func testAccNsxtPolicySecurityPolicyWithRule(name string, direction string, protocol string, ruleTag string) string { - return fmt.Sprintf(` +func testAccNsxtPolicySecurityPolicyWithRule(name string, direction string, protocol string, ruleTag string, domainName string) string { + if domainName == defaultDomain { + return fmt.Sprintf(` resource "nsxt_policy_security_policy" "test" { display_name = "%s" description = "Acceptance Test" @@ -315,6 +443,36 @@ resource "nsxt_policy_security_policy" "test" { } } }`, name, name, direction, protocol, ruleTag) + } else { + return testAccNsxtGlobalPolicySite(domainName) + fmt.Sprintf(` +resource "nsxt_policy_security_policy" "test" { + display_name = "%s" + description = "Acceptance Test" + category = "Application" + locked = false + sequence_number = 3 + stateful = true + tcp_strict = false + domain = data.nsxt_policy_site.test.id + + tag { + scope = "color" + tag = "orange" + } + + rule { + display_name = "%s" + direction = "%s" + ip_version = "%s" + log_label = "%s" + + tag { + scope = "color" + tag = "blue" + } + } +}`, name, name, direction, protocol, ruleTag) + } } func testAccNsxtPolicySecurityPolicyDeps() string { diff --git a/nsxt/resource_nsxt_policy_segment_test.go b/nsxt/resource_nsxt_policy_segment_test.go index 8eb1c8385..c79ed0871 100644 --- a/nsxt/resource_nsxt_policy_segment_test.go +++ b/nsxt/resource_nsxt_policy_segment_test.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "testing" ) @@ -75,6 +74,51 @@ func TestAccResourceNsxtPolicySegment_basicUpdate(t *testing.T) { }) } +func TestAccResourceNsxtPolicySegment_connectivityPath(t *testing.T) { + name := fmt.Sprintf("test-nsx-policy-segment") + updatedName := fmt.Sprintf("%s-update", name) + testResourceName := "nsxt_policy_segment.test" + tzName := getOverlayTransportZoneName() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtPolicySegmentCheckDestroy(state, name) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicySegmentBasicTemplate(tzName, name), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicySegmentExists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", name), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), + resource.TestCheckResourceAttr(testResourceName, "subnet.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "subnet.0.cidr", "12.12.2.1/24"), + resource.TestCheckResourceAttr(testResourceName, "domain_name", "tftest.org"), + resource.TestCheckResourceAttr(testResourceName, "overlay_id", "1011"), + resource.TestCheckResourceAttr(testResourceName, "tag.#", "1"), + resource.TestCheckResourceAttrSet(testResourceName, "connectivity_path"), + ), + }, + { + Config: testAccNsxtPolicySegmentUpdateConnectivityTemplate(tzName, updatedName), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicySegmentExists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", updatedName), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test2"), + resource.TestCheckResourceAttr(testResourceName, "subnet.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "subnet.0.cidr", "22.22.22.1/24"), + resource.TestCheckResourceAttr(testResourceName, "domain_name", "tftest2.org"), + resource.TestCheckResourceAttr(testResourceName, "overlay_id", "1011"), + resource.TestCheckResourceAttr(testResourceName, "tag.#", "2"), + resource.TestCheckResourceAttrSet(testResourceName, "connectivity_path"), + ), + }, + }, + }) +} + func TestAccResourceNsxtPolicySegment_updateAdvConfig(t *testing.T) { name := fmt.Sprintf("test-nsx-policy-segment") updatedName := fmt.Sprintf("%s-update", name) @@ -133,7 +177,7 @@ func TestAccResourceNsxtPolicySegment_withDhcp(t *testing.T) { tzName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicySegmentCheckDestroy(state, name) @@ -201,7 +245,6 @@ func testAccNsxtPolicySegmentExists(resourceName string) resource.TestCheckFunc return func(state *terraform.State) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultSegmentsClient(connector) rs, ok := state.RootModule().Resources[resourceName] if !ok { @@ -213,9 +256,8 @@ func testAccNsxtPolicySegmentExists(resourceName string) resource.TestCheckFunc return fmt.Errorf("Policy Segment resource ID not set in resources") } - _, err := nsxClient.Get(resourceID) - if err != nil { - return fmt.Errorf("Error while retrieving policy Segment ID %s. Error: %v", resourceID, err) + if !resourceNsxtPolicySegmentExists(resourceID, connector, testAccIsGlobalManager()) { + return fmt.Errorf("Error while retrieving policy Segment ID %s", resourceID) } return nil @@ -224,7 +266,6 @@ func testAccNsxtPolicySegmentExists(resourceName string) resource.TestCheckFunc func testAccNsxtPolicySegmentCheckDestroy(state *terraform.State, displayName string) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultSegmentsClient(connector) for _, rs := range state.RootModule().Resources { if rs.Type != "nsxt_policy_segment" { @@ -232,8 +273,7 @@ func testAccNsxtPolicySegmentCheckDestroy(state *terraform.State, displayName st } resourceID := rs.Primary.Attributes["id"] - _, err := nsxClient.Get(resourceID) - if err == nil { + if resourceNsxtPolicySegmentExists(resourceID, connector, testAccIsGlobalManager()) { return fmt.Errorf("Policy Segment %s still exists", displayName) } } @@ -241,21 +281,31 @@ func testAccNsxtPolicySegmentCheckDestroy(state *terraform.State, displayName st } func testAccNsxtPolicySegmentDeps(tzName string) string { - return fmt.Sprintf(` -data "nsxt_policy_transport_zone" "test" { - display_name = "%s" -} + return testAccNSXPolicyTransportZoneReadTemplate(tzName) + fmt.Sprintf(` -resource "nsxt_policy_tier1_gateway" "test" { +resource "nsxt_policy_tier1_gateway" "tier1ForSegments" { display_name = "t1gw" description = "Acceptance Test" default_rule_logging = "true" enable_firewall = "false" - enable_standby_relocation = "true" + enable_standby_relocation = "false" force_whitelisting = "false" + failover_mode = "NON_PREEMPTIVE" + pool_allocation = "ROUTING" route_advertisement_types = ["TIER1_STATIC_ROUTES", "TIER1_CONNECTED"] - ipv6_ndra_profile_path = "/infra/ipv6-ndra-profiles/default" -}`, tzName) +} + +resource "nsxt_policy_tier1_gateway" "anotherTier1ForSegments" { + display_name = "t1gw-b" + description = "Another Tier1" + default_rule_logging = "true" + enable_firewall = "false" + enable_standby_relocation = "false" + force_whitelisting = "false" + failover_mode = "NON_PREEMPTIVE" + pool_allocation = "ROUTING" + route_advertisement_types = ["TIER1_STATIC_ROUTES", "TIER1_CONNECTED"] +}`) } func testAccNsxtPolicySegmentImportTemplate(tzName string, name string) string { @@ -263,7 +313,7 @@ func testAccNsxtPolicySegmentImportTemplate(tzName string, name string) string { resource "nsxt_policy_segment" "test" { display_name = "%s" description = "Acceptance Test" - connectivity_path = nsxt_policy_tier1_gateway.test.path + connectivity_path = nsxt_policy_tier1_gateway.tier1ForSegments.path transport_zone_path = data.nsxt_policy_transport_zone.test.path subnet { @@ -282,6 +332,7 @@ resource "nsxt_policy_segment" "test" { domain_name = "tftest.org" overlay_id = 1011 transport_zone_path = data.nsxt_policy_transport_zone.test.path + connectivity_path = nsxt_policy_tier1_gateway.tier1ForSegments.path subnet { cidr = "12.12.2.1/24" @@ -304,6 +355,34 @@ resource "nsxt_policy_segment" "test" { domain_name = "tftest2.org" overlay_id = 1011 transport_zone_path = data.nsxt_policy_transport_zone.test.path + connectivity_path = nsxt_policy_tier1_gateway.tier1ForSegments.path + + subnet { + cidr = "22.22.22.1/24" + } + + tag { + scope = "color" + tag = "green" + } + tag { + scope = "color" + tag = "orange" + } +} +`, name) +} + +func testAccNsxtPolicySegmentUpdateConnectivityTemplate(tzName string, name string) string { + return testAccNsxtPolicySegmentDeps(tzName) + fmt.Sprintf(` + +resource "nsxt_policy_segment" "test" { + display_name = "%s" + description = "Acceptance Test2" + domain_name = "tftest2.org" + overlay_id = 1011 + transport_zone_path = data.nsxt_policy_transport_zone.test.path + connectivity_path = nsxt_policy_tier1_gateway.anotherTier1ForSegments.path subnet { cidr = "22.22.22.1/24" @@ -377,13 +456,26 @@ resource "nsxt_policy_segment" "test" { `, name) } -func testAccNsxtPolicySegmentWithDhcpTemplate(tzName string, name string, dnsServerV4 string, dnsServerV6 string, lease string, preferred string) string { - return testAccNsxtPolicySegmentDeps(tzName) + fmt.Sprintf(` - +func testAccNsxtPolicyEdgeCluster(name string) string { + if testAccIsGlobalManager() { + return fmt.Sprintf(` +data "nsxt_policy_edge_cluster" "EC" { + display_name = "%s" + site_path = data.nsxt_policy_site.test.path +}`, name) + } else { + return fmt.Sprintf(` data "nsxt_policy_edge_cluster" "EC" { display_name = "%s" +}`, name) + } + } +func testAccNsxtPolicySegmentWithDhcpTemplate(tzName string, name string, dnsServerV4 string, dnsServerV6 string, lease string, preferred string) string { + return testAccNsxtPolicySegmentDeps(tzName) + + testAccNsxtPolicyEdgeCluster(getEdgeClusterName()) + fmt.Sprintf(` + resource "nsxt_policy_dhcp_server" "test" { edge_cluster_path = data.nsxt_policy_edge_cluster.EC.path display_name = "segment-test" @@ -436,5 +528,5 @@ resource "nsxt_policy_segment" "test" { dhcp_config_path = nsxt_policy_dhcp_server.test.path } -`, getEdgeClusterName(), name, lease, dnsServerV4, lease, preferred, dnsServerV6) +`, name, lease, dnsServerV4, lease, preferred, dnsServerV6) } diff --git a/nsxt/resource_nsxt_policy_service.go b/nsxt/resource_nsxt_policy_service.go index 5e4060685..d03ebca0b 100644 --- a/nsxt/resource_nsxt_policy_service.go +++ b/nsxt/resource_nsxt_policy_service.go @@ -10,6 +10,8 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" "github.com/vmware/vsphere-automation-sdk-go/runtime/data" "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + gm_infra "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "log" @@ -383,10 +385,16 @@ func resourceNsxtPolicyServiceGetEntriesFromSchema(d *schema.ResourceData) ([]*d return serviceEntries, nil } -func resourceNsxtPolicyServiceExists(id string, connector *client.RestConnector) bool { - client := infra.NewDefaultServicesClient(connector) +func resourceNsxtPolicyServiceExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { + var err error + if isGlobalManager { + client := gm_infra.NewDefaultServicesClient(connector) + _, err = client.Get(id) + } else { + client := infra.NewDefaultServicesClient(connector) + _, err = client.Get(id) + } - _, err := client.Get(id) if err == nil { return true } @@ -408,10 +416,9 @@ func filterServiceEntryDisplayName(entryDisplayName string, entryID string) stri func resourceNsxtPolicyServiceCreate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := infra.NewDefaultServicesClient(connector) // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyServiceExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyServiceExists) if err != nil { return err } @@ -433,7 +440,18 @@ func resourceNsxtPolicyServiceCreate(d *schema.ResourceData, m interface{}) erro // Create the resource using PATCH log.Printf("[INFO] Creating service with ID %s", id) - err = client.Patch(id, obj) + + if isPolicyGlobalManager(m) { + gmObj, err := convertModelBindingType(obj, model.ServiceBindingType(), gm_model.ServiceBindingType()) + if err != nil { + return err + } + client := gm_infra.NewDefaultServicesClient(connector) + err = client.Patch(id, gmObj.(gm_model.Service)) + } else { + client := infra.NewDefaultServicesClient(connector) + err = client.Patch(id, obj) + } if err != nil { return handleCreateError("Service", id, err) } @@ -445,16 +463,31 @@ func resourceNsxtPolicyServiceCreate(d *schema.ResourceData, m interface{}) erro func resourceNsxtPolicyServiceRead(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := infra.NewDefaultServicesClient(connector) id := d.Id() if id == "" { return fmt.Errorf("Error obtaining service id") } - obj, err := client.Get(id) - if err != nil { - return handleReadError(d, "Service", id, err) + var obj model.Service + if isPolicyGlobalManager(m) { + client := gm_infra.NewDefaultServicesClient(connector) + gmObj, err := client.Get(id) + if err != nil { + return handleReadError(d, "Service", id, err) + } + lmObj, err := convertModelBindingType(gmObj, gm_model.ServiceBindingType(), model.ServiceBindingType()) + if err != nil { + return err + } + obj = lmObj.(model.Service) + } else { + client := infra.NewDefaultServicesClient(connector) + var err error + obj, err = client.Get(id) + if err != nil { + return handleReadError(d, "Service", id, err) + } } d.Set("display_name", obj.DisplayName) @@ -566,7 +599,7 @@ func resourceNsxtPolicyServiceRead(d *schema.ResourceData, m interface{}) error } } - err = d.Set("icmp_entry", icmpEntriesList) + err := d.Set("icmp_entry", icmpEntriesList) if err != nil { return err } @@ -601,7 +634,6 @@ func resourceNsxtPolicyServiceRead(d *schema.ResourceData, m interface{}) error func resourceNsxtPolicyServiceUpdate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := infra.NewDefaultServicesClient(connector) id := d.Id() if id == "" { @@ -626,7 +658,20 @@ func resourceNsxtPolicyServiceUpdate(d *schema.ResourceData, m interface{}) erro } // Update the resource using Update to totally replace the list of entries - _, err := client.Update(id, obj) + var err error + if isPolicyGlobalManager(m) { + + gmObj, err := convertModelBindingType(obj, model.ServiceBindingType(), gm_model.ServiceBindingType()) + if err != nil { + return err + } + client := gm_infra.NewDefaultServicesClient(connector) + _, err = client.Update(id, gmObj.(gm_model.Service)) + } else { + client := infra.NewDefaultServicesClient(connector) + _, err = client.Update(id, obj) + } + if err != nil { return handleUpdateError("Service", id, err) } @@ -640,8 +685,15 @@ func resourceNsxtPolicyServiceDelete(d *schema.ResourceData, m interface{}) erro } connector := getPolicyConnector(m) - client := infra.NewDefaultServicesClient(connector) - err := client.Delete(id) + + var err error + if isPolicyGlobalManager(m) { + client := gm_infra.NewDefaultServicesClient(connector) + err = client.Delete(id) + } else { + client := infra.NewDefaultServicesClient(connector) + err = client.Delete(id) + } if err != nil { return handleDeleteError("Service", id, err) } diff --git a/nsxt/resource_nsxt_policy_service_test.go b/nsxt/resource_nsxt_policy_service_test.go index 4a2e372a8..44937b3bf 100644 --- a/nsxt/resource_nsxt_policy_service_test.go +++ b/nsxt/resource_nsxt_policy_service_test.go @@ -7,6 +7,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" + gm_infra "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "testing" ) @@ -600,7 +601,6 @@ func testAccNsxtPolicyServiceExists(resourceName string) resource.TestCheckFunc return func(state *terraform.State) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultServicesClient(connector) rs, ok := state.RootModule().Resources[resourceName] if !ok { @@ -612,7 +612,14 @@ func testAccNsxtPolicyServiceExists(resourceName string) resource.TestCheckFunc return fmt.Errorf("Policy service resource ID not set in resources") } - _, err := nsxClient.Get(resourceID) + var err error + if testAccIsGlobalManager() { + nsxClient := gm_infra.NewDefaultServicesClient(connector) + _, err = nsxClient.Get(resourceID) + } else { + nsxClient := infra.NewDefaultServicesClient(connector) + _, err = nsxClient.Get(resourceID) + } if err != nil { return fmt.Errorf("Error while retrieving policy service ID %s. Error: %v", resourceID, err) } @@ -623,7 +630,7 @@ func testAccNsxtPolicyServiceExists(resourceName string) resource.TestCheckFunc func testAccNsxtPolicyServiceCheckDestroy(state *terraform.State, displayName string) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultServicesClient(connector) + var err error for _, rs := range state.RootModule().Resources { if rs.Type != "nsxt_policy_service" { @@ -631,7 +638,13 @@ func testAccNsxtPolicyServiceCheckDestroy(state *terraform.State, displayName st } resourceID := rs.Primary.Attributes["id"] - _, err := nsxClient.Get(resourceID) + if testAccIsGlobalManager() { + nsxClient := gm_infra.NewDefaultServicesClient(connector) + _, err = nsxClient.Get(resourceID) + } else { + nsxClient := infra.NewDefaultServicesClient(connector) + _, err = nsxClient.Get(resourceID) + } if err == nil { return fmt.Errorf("Policy service %s still exists", displayName) } diff --git a/nsxt/resource_nsxt_policy_static_route_test.go b/nsxt/resource_nsxt_policy_static_route_test.go index c311fac4f..5858b9909 100644 --- a/nsxt/resource_nsxt_policy_static_route_test.go +++ b/nsxt/resource_nsxt_policy_static_route_test.go @@ -19,7 +19,7 @@ func TestAccResourceNsxtPolicyStaticRoute_basicT0(t *testing.T) { updateNetwork := "15.1.1.0/24" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyStaticRouteCheckDestroy(state, name) @@ -75,7 +75,7 @@ func TestAccResourceNsxtPolicyStaticRoute_basicT1(t *testing.T) { updateNetwork := "15.1.1.0/24" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyStaticRouteCheckDestroy(state, name) @@ -129,7 +129,7 @@ func TestAccResourceNsxtPolicyStaticRoute_basicT0Import(t *testing.T) { network := "14.1.1.0/24" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyStaticRouteCheckDestroy(state, name) @@ -153,7 +153,7 @@ func TestAccResourceNsxtPolicyStaticRoute_basicT1Import(t *testing.T) { network := "14.1.1.0/24" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyStaticRouteCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_tier0_gateway.go b/nsxt/resource_nsxt_policy_tier0_gateway.go index af04adc6d..cb7c9e68a 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway.go @@ -10,7 +10,9 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" "github.com/vmware/vsphere-automation-sdk-go/runtime/data" "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt" + gm_infra "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra" + gm_tier_0s "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/tier_0s" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/tier_0s/locale_services" @@ -107,9 +109,11 @@ func resourceNsxtPolicyTier0Gateway() *schema.Resource { "ipv6_ndra_profile_path": getIPv6NDRAPathSchema(), "ipv6_dad_profile_path": getIPv6DadPathSchema(), "edge_cluster_path": getPolicyEdgeClusterPathSchema(), + "locale_service": getPolicyLocaleServiceSchema(false), "bgp_config": getPolicyBGPConfigSchema(), "vrf_config": getPolicyVRFConfigSchema(), "dhcp_config_path": getPolicyPathSchema(false, false, "Policy path to DHCP server or relay configuration to use for this Tier0"), + "intersite_config": getGatewayIntersiteConfigSchema(), }, } } @@ -278,31 +282,38 @@ func getPolicyVRFConfigSchema() *schema.Schema { } } -func resourceNsxtPolicyTier0GatewayListEdgeClusterLocaleServiceEntries(connector *client.RestConnector, t0ID string) ([]model.LocaleServices, error) { +func listGlobalManagerTier0GatewayLocaleServices(connector *client.RestConnector, gwID string, cursor *string) (model.LocaleServicesListResult, error) { + client := gm_tier_0s.NewDefaultLocaleServicesClient(connector) + markForDelete := false + listResponse, err := client.List(gwID, cursor, &markForDelete, nil, nil, nil, nil) + if err != nil { + return model.LocaleServicesListResult{}, err + } + + convertedResult, conversionErr := convertModelBindingType(listResponse, gm_model.LocaleServicesListResultBindingType(), model.LocaleServicesListResultBindingType()) + if conversionErr != nil { + return model.LocaleServicesListResult{}, conversionErr + } + + return convertedResult.(model.LocaleServicesListResult), nil +} + +func listLocalManagerTier0GatewayLocaleServices(connector *client.RestConnector, gwID string, cursor *string) (model.LocaleServicesListResult, error) { client := tier_0s.NewDefaultLocaleServicesClient(connector) - var results []model.LocaleServices - var cursor *string - total := 0 + markForDelete := false + return client.List(gwID, cursor, &markForDelete, nil, nil, nil, nil) +} - for { - includeMarkForDeleteObjectsParam := false - searchResponse, err := client.List(t0ID, cursor, &includeMarkForDeleteObjectsParam, nil, nil, nil, nil) - if err != nil { - return results, err - } - results = append(results, searchResponse.Results...) - if total == 0 { - // first response - total = int(*searchResponse.ResultCount) - } - cursor = searchResponse.Cursor - if len(results) >= total { - return results, nil - } +func listPolicyTier0GatewayLocaleServices(connector *client.RestConnector, gwID string, isGlobalManager bool) ([]model.LocaleServices, error) { + + if isGlobalManager { + return listPolicyGatewayLocaleServices(connector, gwID, listGlobalManagerTier0GatewayLocaleServices) } + + return listPolicyGatewayLocaleServices(connector, gwID, listLocalManagerTier0GatewayLocaleServices) } -func resourceNsxtPolicyTier0GatewayGetLocaleServiceEntry(gwID string, connector *client.RestConnector) (*model.LocaleServices, error) { +func getPolicyTier0GatewayLocaleServiceWithEdgeCluster(gwID string, connector *client.RestConnector) (*model.LocaleServices, error) { // Get the locale services of this Tier0 for the edge-cluster id client := tier_0s.NewDefaultLocaleServicesClient(connector) obj, err := client.Get(gwID, defaultPolicyLocaleServiceID) @@ -312,7 +323,7 @@ func resourceNsxtPolicyTier0GatewayGetLocaleServiceEntry(gwID string, connector // No locale-service with the default ID // List all the locale services - objList, errList := resourceNsxtPolicyTier0GatewayListEdgeClusterLocaleServiceEntries(connector, gwID) + objList, errList := listPolicyTier0GatewayLocaleServices(connector, gwID, false) if errList != nil { if isNotFoundError(errList) { return nil, nil @@ -495,10 +506,16 @@ func setPolicyVRFConfigInSchema(d *schema.ResourceData, config *model.Tier0VrfCo return d.Set("vrf_config", vrfConfigs) } -func resourceNsxtPolicyTier0GatewayExists(id string, connector *client.RestConnector) bool { - client := infra.NewDefaultTier0sClient(connector) +func resourceNsxtPolicyTier0GatewayExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { + var err error + if isGlobalManager { + client := gm_infra.NewDefaultTier0sClient(connector) + _, err = client.Get(id) + } else { + client := infra.NewDefaultTier0sClient(connector) + _, err = client.Get(id) + } - _, err := client.Get(id) if err == nil { return true } @@ -600,7 +617,57 @@ func resourceNsxtPolicyTier0GatewayBGPConfigSchemaToStruct(cfg interface{}, isVr return routeStruct } -func resourceNsxtPolicyTier0GatewayResourceToInfraStruct(d *schema.ResourceData, connector *client.RestConnector, isCreate bool, id string) (model.Infra, error) { +func initSingleTier0GatewayLocaleService(d *schema.ResourceData, children []*data.StructValue, connector *client.RestConnector) (*data.StructValue, error) { + + edgeClusterPath := d.Get("edge_cluster_path").(string) + var serviceStruct *model.LocaleServices + var err error + if len(d.Id()) > 0 { + // This is an update flow - fetch existing locale service to reuse if needed + serviceStruct, err = getPolicyTier0GatewayLocaleServiceWithEdgeCluster(d.Id(), connector) + if err != nil { + return nil, err + } + } + + if serviceStruct == nil { + // Locale Service required for edge cluster path and/or BGP config + lsType := "LocaleServices" + serviceStruct = &model.LocaleServices{ + Id: &defaultPolicyLocaleServiceID, + ResourceType: &lsType, + } + } + + serviceStruct.EdgeClusterPath = &edgeClusterPath + if len(children) > 0 { + serviceStruct.Children = children + } + + log.Printf("[DEBUG] Using Locale Service with ID %s and Edge Cluster %v", *serviceStruct.Id, serviceStruct.EdgeClusterPath) + + return initChildLocaleService(serviceStruct, false) +} + +func verifyPolicyTier0GatewayConfig(d *schema.ResourceData, isGlobalManager bool) error { + if isGlobalManager { + _, isSet := d.GetOk("edge_cluster_path") + if isSet { + return fmt.Errorf("edge_cluster_path setting is not supported with NSX Global Manager, please use locale_service instead") + } + + return nil + } + + _, isSet := d.GetOk("locale_serviceee") + if isSet { + return fmt.Errorf("locale_service setting is only supported with NSX Global Manager") + } + + return nil +} + +func policyTier0GatewayResourceToInfraStruct(d *schema.ResourceData, connector *client.RestConnector, isGlobalManager bool, id string) (model.Infra, error) { var infraChildren, gwChildren, lsChildren []*data.StructValue var infraStruct model.Infra converter := bindings.NewTypeConverter() @@ -639,7 +706,8 @@ func resourceNsxtPolicyTier0GatewayResourceToInfraStruct(d *schema.ResourceData, VrfConfig: vrfConfig, } - if !isCreate { + if len(d.Id()) > 0 { + // This is update flow t0Struct.Revision = &revision } if dhcpPath != "" { @@ -649,8 +717,14 @@ func resourceNsxtPolicyTier0GatewayResourceToInfraStruct(d *schema.ResourceData, t0Struct.DhcpConfigPaths = []string{} } + if isGlobalManager { + intersiteConfig := getPolicyGatewayIntersiteConfigFromSchema(d) + t0Struct.IntersiteConfig = intersiteConfig + } + bgpConfig := d.Get("bgp_config").([]interface{}) - if len(bgpConfig) > 0 { + if len(bgpConfig) > 0 && !isGlobalManager { + // BGP not supported for global manager yet routingConfigStruct := resourceNsxtPolicyTier0GatewayBGPConfigSchemaToStruct(bgpConfig[0], vrfConfig != nil, id) childConfig := model.ChildBgpRoutingConfig{ ResourceType: "ChildBgpRoutingConfig", @@ -663,7 +737,9 @@ func resourceNsxtPolicyTier0GatewayResourceToInfraStruct(d *schema.ResourceData, lsChildren = append(lsChildren, dataValue.(*data.StructValue)) } - if len(lsChildren) > 0 || d.Get("edge_cluster_path") != "" { + edgeClusterPath := d.Get("edge_cluster_path").(string) + // Local Manager case + if !isGlobalManager && (len(lsChildren) > 0 || edgeClusterPath != "") { if d.Get("edge_cluster_path") == "" { bgpMap := bgpConfig[0].(map[string]interface{}) if bgpMap["enabled"].(bool) { @@ -673,44 +749,23 @@ func resourceNsxtPolicyTier0GatewayResourceToInfraStruct(d *schema.ResourceData, } } - var serviceStruct *model.LocaleServices var err error - if !isCreate { - // BGP config and edge cluster share the same locale service - serviceStruct, err = resourceNsxtPolicyTier0GatewayGetLocaleServiceEntry(d.Id(), connector) - if err != nil { - return infraStruct, err - } - } - - lsType := "LocaleServices" - if serviceStruct == nil { - // Locale Service required for edge cluster path and/or BGP config - serviceStruct = &model.LocaleServices{ - Id: &defaultPolicyLocaleServiceID, - } - } - - serviceStruct.ResourceType = &lsType - - edgeClusterPath := d.Get("edge_cluster_path").(string) - serviceStruct.EdgeClusterPath = &edgeClusterPath - - log.Printf("[DEBUG] Using Locale Service with ID %s and Edge Cluster %v", *serviceStruct.Id, serviceStruct.EdgeClusterPath) - - if len(lsChildren) > 0 { - serviceStruct.Children = lsChildren + dataValue, err := initSingleTier0GatewayLocaleService(d, lsChildren, connector) + if err != nil { + return infraStruct, err } + gwChildren = append(gwChildren, dataValue) + } - childService := model.ChildLocaleServices{ - ResourceType: "ChildLocaleServices", - LocaleServices: serviceStruct, + // Global Manager case - multiple locale services. BGP not supported yet. + if isGlobalManager { + localeServices, err := initGatewayLocaleServices(d, connector, listPolicyTier0GatewayLocaleServices) + if err != nil { + return infraStruct, err } - dataValue, errors := converter.ConvertToVapi(childService, model.ChildLocaleServicesBindingType()) - if errors != nil { - return infraStruct, fmt.Errorf("Error converting child Locale Service: %v", errors[0]) + if len(localeServices) > 0 { + gwChildren = append(gwChildren, localeServices...) } - gwChildren = append(gwChildren, dataValue.(*data.StructValue)) } t0Struct.Children = gwChildren @@ -734,23 +789,29 @@ func resourceNsxtPolicyTier0GatewayResourceToInfraStruct(d *schema.ResourceData, } func resourceNsxtPolicyTier0GatewayCreate(d *schema.ResourceData, m interface{}) error { + connector := getPolicyConnector(m) - infraClient := nsx_policy.NewDefaultInfraClient(connector) + isGlobalManager := isPolicyGlobalManager(m) + + err := verifyPolicyTier0GatewayConfig(d, isGlobalManager) + if err != nil { + return err + } // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyTier0GatewayExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicyTier0GatewayExists) if err != nil { return err } - infraModel, err := resourceNsxtPolicyTier0GatewayResourceToInfraStruct(d, connector, true, id) + obj, err := policyTier0GatewayResourceToInfraStruct(d, connector, isGlobalManager, id) if err != nil { - return handleCreateError("Tier0", id, err) + return err } - boolFalse := false - log.Printf("[INFO] H-API Creating Tier0 with ID %s", id) - err = infraClient.Patch(infraModel, &boolFalse) + log.Printf("[INFO] Using H-API to create Tier0 with ID %s", id) + + err = policyInfraPatch(obj, isGlobalManager, getPolicyConnector(m), false) if err != nil { return handleCreateError("Tier0", id, err) } @@ -763,14 +824,34 @@ func resourceNsxtPolicyTier0GatewayCreate(d *schema.ResourceData, m interface{}) func resourceNsxtPolicyTier0GatewayRead(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := infra.NewDefaultTier0sClient(connector) id := d.Id() if id == "" { return fmt.Errorf("Error obtaining Tier0 ID") } - obj, err := client.Get(id) + var obj model.Tier0 + var err error + isGlobalManager := isPolicyGlobalManager(m) + if isGlobalManager { + client := gm_infra.NewDefaultTier0sClient(connector) + gmObj, err := client.Get(id) + if err != nil { + return handleReadError(d, "Tier0", id, err) + } + + convertedObj, err := convertModelBindingType(gmObj, model.Tier0BindingType(), model.Tier0BindingType()) + if err != nil { + return err + } + + obj = convertedObj.(model.Tier0) + + } else { + client := infra.NewDefaultTier0sClient(connector) + obj, err = client.Get(id) + } + if err != nil { return handleReadError(d, "Tier0", id, err) } @@ -794,47 +875,80 @@ func resourceNsxtPolicyTier0GatewayRead(d *schema.ResourceData, m interface{}) e if len(dhcpPaths) > 0 { d.Set("dhcp_config_path", dhcpPaths[0]) } - // Get the edge cluster Id - localeService, err := resourceNsxtPolicyTier0GatewayGetLocaleServiceEntry(d.Id(), connector) + // Get the edge cluster Id or locale services + localeServices, err := listPolicyTier0GatewayLocaleServices(connector, id, isGlobalManager) if err != nil { return handleReadError(d, "Locale Service for T0", id, err) } - if localeService != nil { - d.Set("edge_cluster_path", localeService.EdgeClusterPath) - err = resourceNsxtPolicyTier0GatewayReadBGPConfig(d, connector, *localeService) - if err != nil { - return handleReadError(d, "BGP Configuration for T0", id, err) + var services []map[string]interface{} + if len(localeServices) > 0 { + + for _, service := range localeServices { + if isGlobalManager { + cfgMap := make(map[string]interface{}) + cfgMap["path"] = service.Path + cfgMap["edge_cluster_path"] = service.EdgeClusterPath + cfgMap["preferred_edge_paths"] = service.PreferredEdgePaths + cfgMap["revision"] = service.Revision + services = append(services, cfgMap) + + } else { + if service.EdgeClusterPath != nil { + d.Set("edge_cluster_path", service.EdgeClusterPath) + err = resourceNsxtPolicyTier0GatewayReadBGPConfig(d, connector, service) + if err != nil { + return handleReadError(d, "BGP Configuration for T0", id, err) + } + break + } + } } + } else { // set empty bgp_config to keep empty plan d.Set("bgp_config", make([]map[string]interface{}, 0)) } + if isGlobalManager { + d.Set("locale_service", services) + } + err = setIpv6ProfilePathsInSchema(d, obj.Ipv6ProfilePaths) if err != nil { return fmt.Errorf("Failed to get Tier0 %s ipv6 profiles: %v", *obj.Id, err) } + if isGlobalManager { + err = setPolicyGatewayIntersiteConfigInSchema(d, obj.IntersiteConfig) + if err != nil { + return fmt.Errorf("Failed to get Tier1 %s interset config: %v", *obj.Id, err) + } + } + return nil } func resourceNsxtPolicyTier0GatewayUpdate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - infraClient := nsx_policy.NewDefaultInfraClient(connector) + isGlobalManager := isPolicyGlobalManager(m) + err := verifyPolicyTier0GatewayConfig(d, isGlobalManager) + if err != nil { + return err + } id := d.Id() if id == "" { return fmt.Errorf("Error obtaining Tier0 ID") } - infraModel, err := resourceNsxtPolicyTier0GatewayResourceToInfraStruct(d, connector, false, id) + obj, err := policyTier0GatewayResourceToInfraStruct(d, connector, isGlobalManager, id) if err != nil { return err } - boolFalse := false - log.Printf("[INFO] H-API Updating Tier0 with ID %s", id) - err = infraClient.Patch(infraModel, &boolFalse) + log.Printf("[INFO] Using H-API to update Tier0 with ID %s", id) + + err = policyInfraPatch(obj, isGlobalManager, connector, true) if err != nil { return handleUpdateError("Tier0", id, err) } @@ -843,14 +957,10 @@ func resourceNsxtPolicyTier0GatewayUpdate(d *schema.ResourceData, m interface{}) } func resourceNsxtPolicyTier0GatewayDelete(d *schema.ResourceData, m interface{}) error { - connector := getPolicyConnector(m) var infraChildren []*data.StructValue - infraClient := nsx_policy.NewDefaultInfraClient(connector) converter := bindings.NewTypeConverter() converter.SetMode(bindings.REST) boolTrue := true - boolFalse := false - id := d.Id() if id == "" { return fmt.Errorf("Error obtaining Tier0 ID") @@ -874,16 +984,17 @@ func resourceNsxtPolicyTier0GatewayDelete(d *schema.ResourceData, m interface{}) infraChildren = append(infraChildren, dataValue.(*data.StructValue)) infraType := "Infra" - infraModel := model.Infra{ + obj := model.Infra{ Children: infraChildren, ResourceType: &infraType, } - log.Printf("[DEBUG] HAPI deleting Tier0 with ID %s", id) - err := infraClient.Patch(infraModel, &boolFalse) + log.Printf("[DEBUG] Using H-API to delete Tier0 with ID %s", id) + err := policyInfraPatch(obj, isPolicyGlobalManager(m), getPolicyConnector(m), false) if err != nil { return handleDeleteError("Tier0", id, err) } + log.Printf("[DEBUG] Success deleting Tier0 with ID %s", id) return nil diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_gm_test.go b/nsxt/resource_nsxt_policy_tier0_gateway_gm_test.go new file mode 100644 index 000000000..dc7c9ae98 --- /dev/null +++ b/nsxt/resource_nsxt_policy_tier0_gateway_gm_test.go @@ -0,0 +1,196 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: MPL-2.0 */ + +package nsxt + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "testing" +) + +var testAccGmGatewayIntersiteSubnet = "10.10.2.0/24" + +// NOTE: This test assumes single edge cluster on both sites +func TestAccResourceNsxtPolicyTier0Gateway_globalManager(t *testing.T) { + testResourceName := "nsxt_policy_tier0_gateway.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + testAccEnvDefined(t, "NSXT_TEST_ANOTHER_SITE_NAME") + }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtPolicyTier0CheckDestroy(state, defaultTestResourceName) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicyTier0GMCreateTemplate(true), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier0Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "ha_mode", "ACTIVE_ACTIVE"), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.0.transit_subnet", testAccGmGatewayIntersiteSubnet), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.primary_site_path"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + { + Config: testAccNsxtPolicyTier0GMUpdateTemplate(), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier0Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "ha_mode", "ACTIVE_ACTIVE"), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.0.transit_subnet", testAccGmGatewayIntersiteSubnet), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.primary_site_path"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + { + Config: testAccNsxtPolicyTier0GMMinimalistic(), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier0Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "ha_mode", "ACTIVE_ACTIVE"), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + }, + }) +} + +// NOTE: This test assumes single edge cluster on both sites +func TestAccResourceNsxtPolicyTier0Gateway_globalManagerNoSubnet(t *testing.T) { + testResourceName := "nsxt_policy_tier0_gateway.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + testAccEnvDefined(t, "NSXT_TEST_ANOTHER_SITE_NAME") + }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtPolicyTier0CheckDestroy(state, defaultTestResourceName) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicyTier0GMCreateTemplate(false), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier0Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.transit_subnet"), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.primary_site_path"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + { + Config: testAccNsxtPolicyTier0GMUpdateTemplate(), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier0Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.0.transit_subnet", testAccGmGatewayIntersiteSubnet), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.primary_site_path"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + }, + }) +} + +// TODO: Add test for ACTIVE_ACTIVE when HA VIP config is supported + +func testAccNsxtPolicyGMGatewayDeps() string { + return fmt.Sprintf(` +data "nsxt_policy_site" "site1" { + display_name = "%s" +} + +data "nsxt_policy_site" "site2" { + display_name = "%s" +} + +data "nsxt_policy_edge_cluster" "ec_site1" { + site_path = data.nsxt_policy_site.site1.path +} + +data "nsxt_policy_edge_cluster" "ec_site2" { + site_path = data.nsxt_policy_site.site2.path +} + +data "nsxt_policy_edge_node" "en_site1" { + edge_cluster_path = data.nsxt_policy_edge_cluster.ec_site1.path + member_index = 0 +}`, getTestSiteName(), getTestAnotherSiteName()) +} + +func testAccNsxtPolicyTier0GMCreateTemplate(withSubnet bool) string { + + subnet := "" + if withSubnet { + subnet = fmt.Sprintf(`transit_subnet = "%s"`, testAccGmGatewayIntersiteSubnet) + } + return testAccNsxtPolicyGMGatewayDeps() + fmt.Sprintf(` +resource "nsxt_policy_tier0_gateway" "test" { + display_name = "%s" + ha_mode = "ACTIVE_ACTIVE" + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.ec_site1.path + preferred_edge_paths = [data.nsxt_policy_edge_node.en_site1.path] + } + + intersite_config { + primary_site_path = data.nsxt_policy_site.site1.path + fallback_site_paths = [data.nsxt_policy_site.site2.path] + %s + } +}`, defaultTestResourceName, subnet) +} + +func testAccNsxtPolicyTier0GMUpdateTemplate() string { + return testAccNsxtPolicyGMGatewayDeps() + fmt.Sprintf(` +resource "nsxt_policy_tier0_gateway" "test" { + display_name = "%s" + ha_mode = "ACTIVE_ACTIVE" + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.ec_site1.path + preferred_edge_paths = [data.nsxt_policy_edge_node.en_site1.path] + } + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.ec_site2.path + } + + intersite_config { + primary_site_path = data.nsxt_policy_site.site2.path + transit_subnet = "%s" + } +}`, defaultTestResourceName, testAccGmGatewayIntersiteSubnet) +} + +func testAccNsxtPolicyTier0GMMinimalistic() string { + return testAccNsxtPolicyGMGatewayDeps() + fmt.Sprintf(` +resource "nsxt_policy_tier0_gateway" "test" { + display_name = "%s" +}`, defaultTestResourceName) +} diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_interface.go b/nsxt/resource_nsxt_policy_tier0_gateway_interface.go index 7680265c9..06a825ea0 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_interface.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_interface.go @@ -119,7 +119,7 @@ func resourceNsxtPolicyTier0GatewayInterfaceCreate(d *schema.ResourceData, m int return fmt.Errorf("segment_path is mandatory for interface of type %s", ifType) } - localeService, err := resourceNsxtPolicyTier0GatewayGetLocaleServiceEntry(tier0ID, connector) + localeService, err := getPolicyTier0GatewayLocaleServiceWithEdgeCluster(tier0ID, connector) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_interface_test.go b/nsxt/resource_nsxt_policy_tier0_gateway_interface_test.go index 2a787b5fe..ff4efe27b 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_interface_test.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_interface_test.go @@ -26,7 +26,7 @@ func TestAccResourceNsxtPolicyTier0GatewayInterface_service(t *testing.T) { testResourceName := "nsxt_policy_tier0_gateway_interface.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0InterfaceCheckDestroy(state, name) @@ -109,7 +109,7 @@ func TestAccResourceNsxtPolicyTier0GatewayInterface_external(t *testing.T) { testResourceName := "nsxt_policy_tier0_gateway_interface.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0InterfaceCheckDestroy(state, name) @@ -179,7 +179,7 @@ func TestAccResourceNsxtPolicyTier0GatewayInterface_withID(t *testing.T) { testResourceName := "nsxt_policy_tier0_gateway_interface.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0InterfaceCheckDestroy(state, name) @@ -256,7 +256,7 @@ func TestAccResourceNsxtPolicyTier0GatewayInterface_importBasic(t *testing.T) { subnet := "1.1.12.2/24" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0InterfaceCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_test.go b/nsxt/resource_nsxt_policy_tier0_gateway_test.go index 13197e2cb..9ef7a02b9 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_test.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_test.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "testing" ) @@ -35,8 +34,8 @@ func TestAccResourceNsxtPolicyTier0Gateway_basic(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "enable_firewall", "false"), resource.TestCheckResourceAttr(testResourceName, "ha_mode", "ACTIVE_STANDBY"), resource.TestCheckResourceAttr(testResourceName, "force_whitelisting", "false"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_ndra_profile_path", "/infra/ipv6-ndra-profiles/default"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_dad_profile_path", "/infra/ipv6-dad-profiles/default"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_ndra_profile_path"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_dad_profile_path"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), ), @@ -46,16 +45,15 @@ func TestAccResourceNsxtPolicyTier0Gateway_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccNsxtPolicyTier0Exists(testResourceName), resource.TestCheckResourceAttr(testResourceName, "display_name", updateName), - // TODO: file a bug for description updates not sticking - //resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test Update"), + resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test Update"), resource.TestCheckResourceAttr(testResourceName, "tag.#", "1"), resource.TestCheckResourceAttr(testResourceName, "failover_mode", failoverMode), resource.TestCheckResourceAttr(testResourceName, "default_rule_logging", "false"), resource.TestCheckResourceAttr(testResourceName, "enable_firewall", "true"), resource.TestCheckResourceAttr(testResourceName, "force_whitelisting", "true"), resource.TestCheckResourceAttr(testResourceName, "ha_mode", "ACTIVE_ACTIVE"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_ndra_profile_path", "/infra/ipv6-ndra-profiles/default"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_dad_profile_path", "/infra/ipv6-dad-profiles/default"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_ndra_profile_path"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_dad_profile_path"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), ), @@ -85,7 +83,6 @@ func TestAccResourceNsxtPolicyTier0Gateway_withId(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "id", id), resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), resource.TestCheckResourceAttr(testResourceName, "tag.#", "2"), - resource.TestCheckResourceAttr(realizationResourceName, "state", "REALIZED"), ), }, { @@ -96,7 +93,6 @@ func TestAccResourceNsxtPolicyTier0Gateway_withId(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "id", id), resource.TestCheckResourceAttr(testResourceName, "description", "Acceptance Test"), resource.TestCheckResourceAttr(testResourceName, "tag.#", "2"), - resource.TestCheckResourceAttr(realizationResourceName, "state", "REALIZED"), ), }, }, @@ -108,7 +104,7 @@ func TestAccResourceNsxtPolicyTier0Gateway_withSubnets(t *testing.T) { testResourceName := "nsxt_policy_tier0_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0CheckDestroy(state, name) @@ -135,7 +131,7 @@ func TestAccResourceNsxtPolicyTier0Gateway_withDHCP(t *testing.T) { testResourceName := "nsxt_policy_tier0_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0CheckDestroy(state, name) @@ -176,7 +172,7 @@ func TestAccResourceNsxtPolicyTier0Gateway_withEdgeCluster(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0CheckDestroy(state, name) @@ -264,7 +260,7 @@ func TestAccResourceNsxtPolicyTier0Gateway_createWithBGP(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0CheckDestroy(state, name) @@ -305,7 +301,7 @@ func TestAccResourceNsxtPolicyTier0Gateway_withVRF(t *testing.T) { testInterfaceName := "nsxt_policy_tier0_gateway_interface.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0CheckDestroy(state, name) @@ -354,7 +350,7 @@ func TestAccResourceNsxtPolicyTier0Gateway_importBasic(t *testing.T) { failoverMode := "PREEMPTIVE" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier0CheckDestroy(state, name) @@ -376,7 +372,6 @@ func testAccNsxtPolicyTier0Exists(resourceName string) resource.TestCheckFunc { return func(state *terraform.State) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultTier0sClient(connector) rs, ok := state.RootModule().Resources[resourceName] if !ok { @@ -388,18 +383,16 @@ func testAccNsxtPolicyTier0Exists(resourceName string) resource.TestCheckFunc { return fmt.Errorf("Policy Tier0 resource ID not set in resources") } - _, err := nsxClient.Get(resourceID) - if err != nil { - return fmt.Errorf("Error while retrieving policy Tier0 ID %s. Error: %v", resourceID, err) + if !resourceNsxtPolicyTier0GatewayExists(resourceID, connector, testAccIsGlobalManager()) { + return fmt.Errorf("Policy Tier0 %s does not exist", resourceID) } - return nil } + } func testAccNsxtPolicyTier0CheckDestroy(state *terraform.State, displayName string) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultTier0sClient(connector) for _, rs := range state.RootModule().Resources { if rs.Type != "nsxt_policy_tier0_gateway" { @@ -407,8 +400,8 @@ func testAccNsxtPolicyTier0CheckDestroy(state *terraform.State, displayName stri } resourceID := rs.Primary.Attributes["id"] - _, err := nsxClient.Get(resourceID) - if err == nil { + exists := resourceNsxtPolicyTier0GatewayExists(resourceID, connector, testAccIsGlobalManager()) + if exists { return fmt.Errorf("Policy Tier0 %s still exists", displayName) } } @@ -533,7 +526,7 @@ data "nsxt_policy_realization_info" "realization_info" { } func testAccNsxtPolicyTier0CreateTemplate(name string, failoverMode string) string { - return fmt.Sprintf(` + config := fmt.Sprintf(` resource "nsxt_policy_tier0_gateway" "test" { display_name = "%s" description = "Acceptance Test" @@ -543,6 +536,7 @@ resource "nsxt_policy_tier0_gateway" "test" { force_whitelisting = "false" ha_mode = "ACTIVE_STANDBY" ipv6_ndra_profile_path = "/infra/ipv6-ndra-profiles/default" + ipv6_dad_profile_path = "/infra/ipv6-dad-profiles/default" tag { scope = "scope1" @@ -554,34 +548,31 @@ resource "nsxt_policy_tier0_gateway" "test" { tag = "tag2" } -} - -data "nsxt_policy_realization_info" "realization_info" { - path = nsxt_policy_tier0_gateway.test.path }`, name, failoverMode) + + return testAccAdjustPolicyInfraConfig(config) } func testAccNsxtPolicyTier0UpdateTemplate(name string, failoverMode string) string { - return fmt.Sprintf(` + config := fmt.Sprintf(` resource "nsxt_policy_tier0_gateway" "test" { display_name = "%s" - description = "Acceptance Test" + description = "Acceptance Test Update" failover_mode = "%s" default_rule_logging = "false" enable_firewall = "true" force_whitelisting = "true" ha_mode = "ACTIVE_ACTIVE" + ipv6_ndra_profile_path = "/infra/ipv6-ndra-profiles/default" ipv6_dad_profile_path = "/infra/ipv6-dad-profiles/default" tag { scope = "scope3" tag = "tag3" } -} +} `, name, failoverMode) -data "nsxt_policy_realization_info" "realization_info" { - path = nsxt_policy_tier0_gateway.test.path -}`, name, failoverMode) + return testAccAdjustPolicyInfraConfig(config) } func testAccNsxtPolicyTier0SetTemplateWithID(name string, id string) string { @@ -601,10 +592,6 @@ resource "nsxt_policy_tier0_gateway" "test" { scope = "scope2" tag = "tag2" } -} - -data "nsxt_policy_realization_info" "realization_info" { - path = nsxt_policy_tier0_gateway.test.path }`, id, name) } diff --git a/nsxt/resource_nsxt_policy_tier1_gateway.go b/nsxt/resource_nsxt_policy_tier1_gateway.go index aba8e4663..8c38a3ed0 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway.go @@ -7,7 +7,12 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + gm_infra "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra" + gm_tier_1s "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/tier_1s" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" @@ -55,6 +60,7 @@ func resourceNsxtPolicyTier1Gateway() *schema.Resource { "revision": getRevisionSchema(), "tag": getTagsSchema(), "edge_cluster_path": getPolicyEdgeClusterPathSchema(), + "locale_service": getPolicyLocaleServiceSchema(true), "failover_mode": getFailoverModeSchema(failOverModeDefaultValue), "default_rule_logging": { Type: schema.TypeBool, @@ -109,6 +115,7 @@ func resourceNsxtPolicyTier1Gateway() *schema.Resource { }, "ingress_qos_profile_path": getPolicyPathSchema(false, false, "Policy path to gateway QoS profile in ingress direction"), "egress_qos_profile_path": getPolicyPathSchema(false, false, "Policy path to gateway QoS profile in egress direction"), + "intersite_config": getGatewayIntersiteConfigSchema(), }, } } @@ -162,48 +169,38 @@ func getAdvRulesSchema() *schema.Schema { } } -func resourceNsxtPolicyTier1GatewayListLocaleServiceEntries(connector *client.RestConnector, t1ID string) ([]model.LocaleServices, error) { - client := tier_1s.NewDefaultLocaleServicesClient(connector) - var results []model.LocaleServices - var cursor *string - total := 0 +func listGlobalManagerTier1GatewayLocaleServices(connector *client.RestConnector, gwID string, cursor *string) (model.LocaleServicesListResult, error) { + client := gm_tier_1s.NewDefaultLocaleServicesClient(connector) + markForDelete := false + listResponse, err := client.List(gwID, cursor, &markForDelete, nil, nil, nil, nil) + if err != nil { + return model.LocaleServicesListResult{}, err + } - for { - includeMarkForDeleteObjectsParam := false - searchResponse, err := client.List(t1ID, cursor, &includeMarkForDeleteObjectsParam, nil, nil, nil, nil) - if err != nil { - return results, err - } - results = append(results, searchResponse.Results...) - if total == 0 { - // first response - total = int(*searchResponse.ResultCount) - } - cursor = searchResponse.Cursor - if len(results) >= total { - return results, nil - } + convertedResult, conversionErr := convertModelBindingType(listResponse, gm_model.LocaleServicesListResultBindingType(), model.LocaleServicesListResultBindingType()) + if conversionErr != nil { + return model.LocaleServicesListResult{}, conversionErr } + + return convertedResult.(model.LocaleServicesListResult), nil } -func resourceNsxtPolicyTier1GatewayCreateEdgeCluster(d *schema.ResourceData, connector *client.RestConnector) error { - // Create a Tier1 locale service with the edge-cluster ID +func listLocalManagerTier1GatewayLocaleServices(connector *client.RestConnector, gwID string, cursor *string) (model.LocaleServicesListResult, error) { client := tier_1s.NewDefaultLocaleServicesClient(connector) - edgeClusterPath := d.Get("edge_cluster_path").(string) - objID := d.Id() - // The default ID of the locale service will be the Tier1 ID - obj := model.LocaleServices{ - EdgeClusterPath: &edgeClusterPath, - } + markForDelete := false + return client.List(gwID, cursor, &markForDelete, nil, nil, nil, nil) +} - err := client.Patch(objID, defaultPolicyLocaleServiceID, obj) - if err != nil { - return handleCreateError("Tier1 locale service", objID, err) +func listPolicyTier1GatewayLocaleServices(connector *client.RestConnector, gwID string, isGlobalManager bool) ([]model.LocaleServices, error) { + + if isGlobalManager { + return listPolicyGatewayLocaleServices(connector, gwID, listGlobalManagerTier1GatewayLocaleServices) } - return nil + + return listPolicyGatewayLocaleServices(connector, gwID, listLocalManagerTier1GatewayLocaleServices) } -func resourceNsxtPolicyTier1GatewayGetLocaleServiceEntry(gwID string, connector *client.RestConnector) (*model.LocaleServices, error) { +func getPolicyTier1GatewayLocaleServiceEntry(gwID string, connector *client.RestConnector) (*model.LocaleServices, error) { // Get the locale services of this Tier1 for the edge-cluster id client := tier_1s.NewDefaultLocaleServicesClient(connector) obj, err := client.Get(gwID, defaultPolicyLocaleServiceID) @@ -213,7 +210,7 @@ func resourceNsxtPolicyTier1GatewayGetLocaleServiceEntry(gwID string, connector // No locale-service with the default ID // List all the locale services - objList, errList := resourceNsxtPolicyTier1GatewayListLocaleServiceEntries(connector, gwID) + objList, errList := listPolicyTier1GatewayLocaleServices(connector, gwID, false) if errList != nil { return nil, fmt.Errorf("Error while reading Tier1 %v locale-services: %v", gwID, err) } @@ -233,29 +230,9 @@ func resourceNsxtPolicyTier1GatewayGetLocaleServiceEntry(gwID string, connector return nil, nil } -func resourceNsxtPolicyTier1GatewayUpdateEdgeCluster(d *schema.ResourceData, connector *client.RestConnector) error { - // Create or update a Tier1 locale service with the edge-cluster ID - // The ID if the locale service should be searches as in case of imported Tier1 it is unknown - client := tier_1s.NewDefaultLocaleServicesClient(connector) - edgeClusterPath := d.Get("edge_cluster_path").(string) - if edgeClusterPath == "" { - return resourceNsxtPolicyTier1GatewayDeleteEdgeCluster(d, connector) - } - obj := model.LocaleServices{ - EdgeClusterPath: &edgeClusterPath, - } - objID := d.Id() - - err := client.Patch(objID, defaultPolicyLocaleServiceID, obj) - if err != nil { - return handleUpdateError("Tier1 locale service", defaultPolicyLocaleServiceID, err) - } - return nil -} - func resourceNsxtPolicyTier1GatewayReadEdgeCluster(d *schema.ResourceData, connector *client.RestConnector) error { // Get the locale services of this Tier1 for the edge-cluster id - obj, err := resourceNsxtPolicyTier1GatewayGetLocaleServiceEntry(d.Id(), connector) + obj, err := getPolicyTier1GatewayLocaleServiceEntry(d.Id(), connector) if err != nil || obj == nil { // No locale-service found return nil @@ -268,26 +245,16 @@ func resourceNsxtPolicyTier1GatewayReadEdgeCluster(d *schema.ResourceData, conne return nil } -func resourceNsxtPolicyTier1GatewayDeleteEdgeCluster(d *schema.ResourceData, connector *client.RestConnector) error { - // Find and delete the locale service of this Tier1 for the edge-cluster id - client := tier_1s.NewDefaultLocaleServicesClient(connector) - objID := d.Id() - - _, err := client.Get(objID, defaultPolicyLocaleServiceID) - if err == nil { - err = client.Delete(objID, defaultPolicyLocaleServiceID) - if err != nil { - logAPIError("Error During Tier1 locale-services deletion", err) - return fmt.Errorf("Failed to delete Tier1 %s locale-services", objID) - } +func resourceNsxtPolicyTier1GatewayExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { + var err error + if isGlobalManager { + client := gm_infra.NewDefaultTier1sClient(connector) + _, err = client.Get(id) + } else { + client := infra.NewDefaultTier1sClient(connector) + _, err = client.Get(id) } - return nil -} - -func resourceNsxtPolicyTier1GatewayExists(id string, connector *client.RestConnector) bool { - client := infra.NewDefaultTier1sClient(connector) - _, err := client.Get(id) if err == nil { return true } @@ -362,16 +329,42 @@ func resourceNsxtPolicyTier1GatewaySetVersionDependentAttrs(d *schema.ResourceDa } -func resourceNsxtPolicyTier1GatewayCreate(d *schema.ResourceData, m interface{}) error { - connector := getPolicyConnector(m) - client := infra.NewDefaultTier1sClient(connector) +func initSingleTier1GatewayLocaleService(d *schema.ResourceData, connector *client.RestConnector) (*data.StructValue, error) { - // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicyTier1GatewayExists) - if err != nil { - return err + edgeClusterPath := d.Get("edge_cluster_path").(string) + var serviceStruct *model.LocaleServices + var err error + if len(d.Id()) > 0 { + // This is an update flow - fetch existing locale service to reuse if needed + serviceStruct, err = getPolicyTier1GatewayLocaleServiceEntry(d.Id(), connector) + if err != nil { + return nil, err + } + } + + if serviceStruct == nil { + lsType := "LocaleServices" + serviceStruct = &model.LocaleServices{ + Id: &defaultPolicyLocaleServiceID, + ResourceType: &lsType, + } + } + if len(edgeClusterPath) > 0 { + serviceStruct.EdgeClusterPath = &edgeClusterPath + } else { + serviceStruct.EdgeClusterPath = nil } + log.Printf("[DEBUG] Using Locale Service with ID %s and Edge Cluster %v", *serviceStruct.Id, serviceStruct.EdgeClusterPath) + return initChildLocaleService(serviceStruct, false) +} + +func policyTier1GatewayResourceToInfraStruct(d *schema.ResourceData, connector *client.RestConnector, id string, isGlobalManager bool) (model.Infra, error) { + var infraChildren, gwChildren []*data.StructValue + var infraStruct model.Infra + converter := bindings.NewTypeConverter() + converter.SetMode(bindings.REST) + displayName := d.Get("display_name").(string) description := d.Get("description").(string) tags := getPolicyTagsFromSchema(d) @@ -385,8 +378,11 @@ func resourceNsxtPolicyTier1GatewayCreate(d *schema.ResourceData, m interface{}) routeAdvertisementRules := getAdvRulesFromSchema(d) ipv6ProfilePaths := getIpv6ProfilePathsFromSchema(d) dhcpPath := d.Get("dhcp_config_path").(string) + revision := int64(d.Get("revision").(int)) + t1Type := "Tier1" obj := model.Tier1{ + Id: &id, DisplayName: &displayName, Description: &description, Tags: tags, @@ -399,6 +395,7 @@ func resourceNsxtPolicyTier1GatewayCreate(d *schema.ResourceData, m interface{}) RouteAdvertisementTypes: routeAdvertisementTypes, RouteAdvertisementRules: routeAdvertisementRules, Ipv6ProfilePaths: ipv6ProfilePaths, + ResourceType: &t1Type, } if dhcpPath != "" { @@ -407,41 +404,115 @@ func resourceNsxtPolicyTier1GatewayCreate(d *schema.ResourceData, m interface{}) } else { obj.DhcpConfigPaths = []string{} } + if len(d.Id()) > 0 { + // This is update flow + obj.Revision = &revision + } resourceNsxtPolicyTier1GatewaySetVersionDependentAttrs(d, &obj) + if isGlobalManager { + intersiteConfig := getPolicyGatewayIntersiteConfigFromSchema(d) + obj.IntersiteConfig = intersiteConfig + } + + // set edge cluster for local manager if needed + if d.HasChange("edge_cluster_path") && !isGlobalManager { + dataValue, err := initSingleTier1GatewayLocaleService(d, connector) + if err != nil { + return infraStruct, err + } + + gwChildren = append(gwChildren, dataValue) + } + + if isGlobalManager { + localeServices, err := initGatewayLocaleServices(d, connector, listPolicyTier1GatewayLocaleServices) + if err != nil { + return infraStruct, err + } + + if len(localeServices) > 0 { + gwChildren = append(gwChildren, localeServices...) + } + } + + obj.Children = gwChildren + childTier1 := model.ChildTier1{ + Tier1: &obj, + ResourceType: "ChildTier1", + } + + dataValue, errors := converter.ConvertToVapi(childTier1, model.ChildTier1BindingType()) + if errors != nil { + return infraStruct, fmt.Errorf("Error converting Tier1 Child: %v", errors[0]) + } + infraChildren = append(infraChildren, dataValue.(*data.StructValue)) + + infraType := "Infra" + infraStruct = model.Infra{ + Children: infraChildren, + ResourceType: &infraType, + } + + return infraStruct, nil +} + +func resourceNsxtPolicyTier1GatewayCreate(d *schema.ResourceData, m interface{}) error { + connector := getPolicyConnector(m) + + // Initialize resource Id and verify this ID is not yet used + id, err := getOrGenerateID(d, m, resourceNsxtPolicyTier1GatewayExists) + if err != nil { + return err + } + + obj, err := policyTier1GatewayResourceToInfraStruct(d, connector, id, isPolicyGlobalManager(m)) + if err != nil { + return err + } + // Create the resource using PATCH - log.Printf("[INFO] Creating tier1 with ID %s", id) - err = client.Patch(id, obj) + log.Printf("[INFO] Using H-API to create Tier1 with ID %s", id) + err = policyInfraPatch(obj, isPolicyGlobalManager(m), connector, false) if err != nil { return handleCreateError("Tier1", id, err) } d.SetId(id) d.Set("nsx_id", id) - // Add the edge cluster - if d.Get("edge_cluster_path") != "" { - err = resourceNsxtPolicyTier1GatewayCreateEdgeCluster(d, connector) - if err != nil { - log.Printf("[INFO] Rolling back Tier1 creation") - client.Delete(id) - return err - } - } return resourceNsxtPolicyTier1GatewayRead(d, m) } func resourceNsxtPolicyTier1GatewayRead(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := infra.NewDefaultTier1sClient(connector) + var obj model.Tier1 + var err error id := d.Id() if id == "" { return fmt.Errorf("Error obtaining Tier1 id") } - obj, err := client.Get(id) + isGlobalManager := isPolicyGlobalManager(m) + if isGlobalManager { + client := gm_infra.NewDefaultTier1sClient(connector) + gmObj, err := client.Get(id) + if err != nil { + return handleReadError(d, "Tier0", id, err) + } + + convertedObj, err := convertModelBindingType(gmObj, model.Tier1BindingType(), model.Tier1BindingType()) + if err != nil { + return err + } + obj = convertedObj.(model.Tier1) + } else { + client := infra.NewDefaultTier1sClient(connector) + obj, err = client.Get(id) + } + if err != nil { return handleReadError(d, "Tier1", id, err) } @@ -478,10 +549,36 @@ func resourceNsxtPolicyTier1GatewayRead(d *schema.ResourceData, m interface{}) e d.Set("egressQosProfile", obj.QosProfile.EgressQosProfilePath) } - // Get the edge cluster Id - err = resourceNsxtPolicyTier1GatewayReadEdgeCluster(d, connector) + // Get the edge cluster Id or locale services + localeServices, err := listPolicyTier1GatewayLocaleServices(connector, id, isGlobalManager) if err != nil { - return fmt.Errorf("Failed to get Tier1 %s locale-services: %v", *obj.Id, err) + return handleReadError(d, "Locale Service for T1", id, err) + } + var services []map[string]interface{} + if len(localeServices) > 0 { + + for _, service := range localeServices { + if isGlobalManager { + cfgMap := make(map[string]interface{}) + cfgMap["path"] = service.Path + cfgMap["edge_cluster_path"] = service.EdgeClusterPath + cfgMap["preferred_edge_paths"] = service.PreferredEdgePaths + cfgMap["revision"] = service.Revision + services = append(services, cfgMap) + + } else { + if service.EdgeClusterPath != nil { + d.Set("edge_cluster_path", service.EdgeClusterPath) + } + } + } + + } else { + d.Set("edge_cluster_path", "") + } + + if isGlobalManager { + d.Set("locale_service", services) } err = setAdvRulesInSchema(d, obj.RouteAdvertisementRules) @@ -494,73 +591,35 @@ func resourceNsxtPolicyTier1GatewayRead(d *schema.ResourceData, m interface{}) e return fmt.Errorf("Failed to get Tier1 %s ipv6 profiles: %v", *obj.Id, err) } + if isGlobalManager { + err = setPolicyGatewayIntersiteConfigInSchema(d, obj.IntersiteConfig) + if err != nil { + return fmt.Errorf("Failed to get Tier1 %s interset config: %v", *obj.Id, err) + } + } + return nil } func resourceNsxtPolicyTier1GatewayUpdate(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) - client := infra.NewDefaultTier1sClient(connector) id := d.Id() if id == "" { return fmt.Errorf("Error obtaining Tier1 id") } - // Read the rest of the configured parameters - description := d.Get("description").(string) - displayName := d.Get("display_name").(string) - tags := getPolicyTagsFromSchema(d) - failoverMode := d.Get("failover_mode").(string) - defaultRuleLogging := d.Get("default_rule_logging").(bool) - disableFirewall := !d.Get("enable_firewall").(bool) - enableStandbyRelocation := d.Get("enable_standby_relocation").(bool) - forceWhitelisting := d.Get("force_whitelisting").(bool) - tier0Path := d.Get("tier0_path").(string) - routeAdvertisementTypes := getStringListFromSchemaSet(d, "route_advertisement_types") - routeAdvertisementRules := getAdvRulesFromSchema(d) - ipv6ProfilePaths := getIpv6ProfilePathsFromSchema(d) - dhcpPath := d.Get("dhcp_config_path").(string) - revision := int64(d.Get("revision").(int)) - - obj := model.Tier1{ - DisplayName: &displayName, - Description: &description, - Tags: tags, - FailoverMode: &failoverMode, - DefaultRuleLogging: &defaultRuleLogging, - DisableFirewall: &disableFirewall, - EnableStandbyRelocation: &enableStandbyRelocation, - ForceWhitelisting: &forceWhitelisting, - Tier0Path: &tier0Path, - RouteAdvertisementTypes: routeAdvertisementTypes, - RouteAdvertisementRules: routeAdvertisementRules, - Ipv6ProfilePaths: ipv6ProfilePaths, - Revision: &revision, - } - - if dhcpPath != "" { - dhcpPaths := []string{dhcpPath} - obj.DhcpConfigPaths = dhcpPaths - } else { - obj.DhcpConfigPaths = []string{} + obj, err := policyTier1GatewayResourceToInfraStruct(d, connector, id, isPolicyGlobalManager(m)) + if err != nil { + return err } - resourceNsxtPolicyTier1GatewaySetVersionDependentAttrs(d, &obj) - - // Update the resource using PUT - _, err := client.Update(id, obj) + log.Printf("[INFO] Using H-API to update Tier1 with ID %s", id) + err = policyInfraPatch(obj, isPolicyGlobalManager(m), connector, true) if err != nil { return handleUpdateError("Tier1", id, err) } - if d.HasChange("edge_cluster_path") { - // Update edge cluster - err = resourceNsxtPolicyTier1GatewayUpdateEdgeCluster(d, connector) - if err != nil { - return err - } - } - return resourceNsxtPolicyTier1GatewayRead(d, m) } @@ -570,20 +629,37 @@ func resourceNsxtPolicyTier1GatewayDelete(d *schema.ResourceData, m interface{}) return fmt.Errorf("Error obtaining Tier1 id") } - connector := getPolicyConnector(m) - err := resourceNsxtPolicyTier1GatewayDeleteEdgeCluster(d, connector) - if err != nil { - err = handleDeleteError("Tier1 locale service", id, err) - if err != nil { - return err - } + var infraChildren []*data.StructValue + converter := bindings.NewTypeConverter() + converter.SetMode(bindings.REST) + boolTrue := true + + t1Type := "Tier1" + t1obj := model.Tier1{ + Id: &id, + ResourceType: &t1Type, + } + childT1 := model.ChildTier1{ + MarkedForDelete: &boolTrue, + Tier1: &t1obj, ResourceType: "ChildTier1", + } + dataValue, errors := converter.ConvertToVapi(childT1, model.ChildTier1BindingType()) + if errors != nil { + return fmt.Errorf("Error converting Child Tier1: %v", errors[0]) + } + infraChildren = append(infraChildren, dataValue.(*data.StructValue)) + infraType := "Infra" + obj := model.Infra{ + Children: infraChildren, + ResourceType: &infraType, } - client := infra.NewDefaultTier1sClient(connector) - err = client.Delete(id) + log.Printf("[DEBUG] Using H-API to delete Tier1 with ID %s", id) + err := policyInfraPatch(obj, isPolicyGlobalManager(m), getPolicyConnector(m), false) if err != nil { - return handleDeleteError("Tier1", id, err) + return err } + log.Printf("[DEBUG] Success deleting Tier1 with ID %s", id) return nil } diff --git a/nsxt/resource_nsxt_policy_tier1_gateway_gm_test.go b/nsxt/resource_nsxt_policy_tier1_gateway_gm_test.go new file mode 100644 index 000000000..2aa08f644 --- /dev/null +++ b/nsxt/resource_nsxt_policy_tier1_gateway_gm_test.go @@ -0,0 +1,188 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: MPL-2.0 */ + +package nsxt + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "testing" +) + +// NOTE: This test assumes single edge cluster on both sites +func TestAccResourceNsxtPolicyTier1Gateway_globalManager(t *testing.T) { + testResourceName := "nsxt_policy_tier1_gateway.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccOnlyGlobalManager(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + testAccEnvDefined(t, "NSXT_TEST_ANOTHER_SITE_NAME") + }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtPolicyTier1CheckDestroy(state, defaultTestResourceName) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicyTier1GMCreateTemplate(true), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier1Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.0.transit_subnet", testAccGmGatewayIntersiteSubnet), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.primary_site_path"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + { + Config: testAccNsxtPolicyTier1GMUpdateTemplate(), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier1Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.0.transit_subnet", testAccGmGatewayIntersiteSubnet), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.primary_site_path"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + { + Config: testAccNsxtPolicyTier1GMMinimalistic(), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier1Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + }, + }) +} + +// NOTE: This test assumes single edge cluster on both sites +func TestAccResourceNsxtPolicyTier1Gateway_globalManagerNoSubnet(t *testing.T) { + testResourceName := "nsxt_policy_tier1_gateway.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccOnlyGlobalManager(t) + testAccEnvDefined(t, "NSXT_TEST_SITE_NAME") + testAccEnvDefined(t, "NSXT_TEST_ANOTHER_SITE_NAME") + }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtPolicyTier1CheckDestroy(state, defaultTestResourceName) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtPolicyTier1GMCreateTemplate(false), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier1Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.transit_subnet"), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.primary_site_path"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + { + Config: testAccNsxtPolicyTier1GMUpdateTemplate(), + Check: resource.ComposeTestCheckFunc( + testAccNsxtPolicyTier1Exists(testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", defaultTestResourceName), + resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "locale_service.#", "2"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "intersite_config.0.transit_subnet", testAccGmGatewayIntersiteSubnet), + resource.TestCheckResourceAttrSet(testResourceName, "intersite_config.0.primary_site_path"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + ), + }, + }, + }) +} + +func testAccNsxtPolicyTier1GMCreateTemplate(withSubnet bool) string { + + subnet := "" + if withSubnet { + subnet = fmt.Sprintf(`transit_subnet = "%s"`, testAccGmGatewayIntersiteSubnet) + } + return testAccNsxtPolicyGMGatewayDeps() + fmt.Sprintf(` +resource "nsxt_policy_tier1_gateway" "test" { + display_name = "%s" + route_advertisement_types = ["TIER1_STATIC_ROUTES", "TIER1_CONNECTED"] + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.ec_site1.path + preferred_edge_paths = [data.nsxt_policy_edge_node.en_site1.path] + } + + intersite_config { + primary_site_path = data.nsxt_policy_site.site1.path + %s + } +}`, defaultTestResourceName, subnet) +} + +func testAccNsxtPolicyTier1GMUpdateTemplate() string { + return testAccNsxtPolicyGMGatewayDeps() + fmt.Sprintf(` +resource "nsxt_policy_tier1_gateway" "test" { + display_name = "%s" + route_advertisement_types = ["TIER1_STATIC_ROUTES", "TIER1_CONNECTED"] + + route_advertisement_rule { + name = "rule1" + action = "PERMIT" + subnets = ["30.0.0.0/24", "31.0.0.0/24"] + prefix_operator = "GE" + } + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.ec_site1.path + preferred_edge_paths = [data.nsxt_policy_edge_node.en_site1.path] + } + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.ec_site2.path + } + + intersite_config { + primary_site_path = data.nsxt_policy_site.site2.path + transit_subnet = "%s" + } +}`, defaultTestResourceName, testAccGmGatewayIntersiteSubnet) +} + +func testAccNsxtPolicyTier1GMMinimalistic() string { + return testAccNsxtPolicyGMGatewayDeps() + fmt.Sprintf(` +resource "nsxt_policy_tier1_gateway" "test" { + display_name = "%s" +}`, defaultTestResourceName) +} diff --git a/nsxt/resource_nsxt_policy_tier1_gateway_interface.go b/nsxt/resource_nsxt_policy_tier1_gateway_interface.go index f4c3b59c7..4dbe4fae5 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway_interface.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway_interface.go @@ -72,7 +72,7 @@ func resourceNsxtPolicyTier1GatewayInterfaceCreate(d *schema.ResourceData, m int id := d.Get("nsx_id").(string) tier1Path := d.Get("gateway_path").(string) tier1ID := getPolicyIDFromPath(tier1Path) - localeService, err := resourceNsxtPolicyTier1GatewayGetLocaleServiceEntry(tier1ID, connector) + localeService, err := getPolicyTier1GatewayLocaleServiceEntry(tier1ID, connector) if err != nil { return err } diff --git a/nsxt/resource_nsxt_policy_tier1_gateway_interface_test.go b/nsxt/resource_nsxt_policy_tier1_gateway_interface_test.go index 848322d2e..1b312ee2d 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway_interface_test.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway_interface_test.go @@ -24,7 +24,7 @@ func TestAccResourceNsxtPolicyTier1GatewayInterface_basic(t *testing.T) { testResourceName := "nsxt_policy_tier1_gateway_interface.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier1InterfaceCheckDestroy(state, name) @@ -97,7 +97,7 @@ func TestAccResourceNsxtPolicyTier1GatewayInterface_withID(t *testing.T) { testResourceName := "nsxt_policy_tier1_gateway_interface.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier1InterfaceCheckDestroy(state, name) @@ -171,7 +171,7 @@ func TestAccResourceNsxtPolicyTier1GatewayInterface_importBasic(t *testing.T) { subnet := "1.1.12.2/24" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier1InterfaceCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_policy_tier1_gateway_test.go b/nsxt/resource_nsxt_policy_tier1_gateway_test.go index 52943cddb..c9aada8d0 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway_test.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway_test.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "testing" ) @@ -38,8 +37,8 @@ func TestAccResourceNsxtPolicyTier1Gateway_basic(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "2"), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_ndra_profile_path", "/infra/ipv6-ndra-profiles/default"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_dad_profile_path", "/infra/ipv6-dad-profiles/default"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_ndra_profile_path"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_dad_profile_path"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), ), @@ -59,8 +58,8 @@ func TestAccResourceNsxtPolicyTier1Gateway_basic(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "1"), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_ndra_profile_path", "/infra/ipv6-ndra-profiles/default"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_dad_profile_path", "/infra/ipv6-dad-profiles/default"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_ndra_profile_path"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_dad_profile_path"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), ), @@ -80,8 +79,8 @@ func TestAccResourceNsxtPolicyTier1Gateway_basic(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "1"), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_ndra_profile_path", "/infra/ipv6-ndra-profiles/default"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_dad_profile_path", "/infra/ipv6-dad-profiles/default"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_ndra_profile_path"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_dad_profile_path"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), ), @@ -118,8 +117,8 @@ func TestAccResourceNsxtPolicyTier1Gateway_withPoolAllocation(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "pool_allocation", "ROUTING"), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "2"), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_ndra_profile_path", "/infra/ipv6-ndra-profiles/default"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_dad_profile_path", "/infra/ipv6-dad-profiles/default"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_ndra_profile_path"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_dad_profile_path"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), ), @@ -140,8 +139,8 @@ func TestAccResourceNsxtPolicyTier1Gateway_withPoolAllocation(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "pool_allocation", "ROUTING"), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "1"), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_ndra_profile_path", "/infra/ipv6-ndra-profiles/default"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_dad_profile_path", "/infra/ipv6-dad-profiles/default"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_ndra_profile_path"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_dad_profile_path"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), ), @@ -162,8 +161,8 @@ func TestAccResourceNsxtPolicyTier1Gateway_withPoolAllocation(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_types.#", "1"), resource.TestCheckResourceAttr(testResourceName, "route_advertisement_rule.#", "0"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_ndra_profile_path", "/infra/ipv6-ndra-profiles/default"), - resource.TestCheckResourceAttr(testResourceName, "ipv6_dad_profile_path", "/infra/ipv6-dad-profiles/default"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_ndra_profile_path"), + resource.TestCheckResourceAttrSet(testResourceName, "ipv6_dad_profile_path"), resource.TestCheckResourceAttr(testResourceName, "pool_allocation", "LB_SMALL"), resource.TestCheckResourceAttrSet(testResourceName, "path"), resource.TestCheckResourceAttrSet(testResourceName, "revision"), @@ -178,7 +177,7 @@ func TestAccResourceNsxtPolicyTier1Gateway_withDHCP(t *testing.T) { testResourceName := "nsxt_policy_tier1_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier1CheckDestroy(state, name) @@ -218,7 +217,7 @@ func TestAccResourceNsxtPolicyTier1Gateway_withEdgeCluster(t *testing.T) { edgeClusterName := getEdgeClusterName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier1CheckDestroy(state, name) @@ -268,7 +267,7 @@ func TestAccResourceNsxtPolicyTier1Gateway_withId(t *testing.T) { testResourceName := "nsxt_policy_tier1_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier1CheckDestroy(state, name) @@ -308,7 +307,7 @@ func TestAccResourceNsxtPolicyTier1Gateway_withQos(t *testing.T) { testResourceName := "nsxt_policy_tier1_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { if err := testAccDataSourceNsxtPolicyGatewayQosProfileDeleteByName(profileName); err != nil { @@ -355,7 +354,7 @@ func TestAccResourceNsxtPolicyTier1Gateway_withRules(t *testing.T) { testResourceName := "nsxt_policy_tier1_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier1CheckDestroy(state, name) @@ -397,7 +396,7 @@ func TestAccResourceNsxtPolicyTier1Gateway_withTier0(t *testing.T) { failoverMode := "NON_PREEMPTIVE" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { testAccDataSourceNsxtPolicyTier0DeleteByName(tier0Name) @@ -426,7 +425,6 @@ func TestAccResourceNsxtPolicyTier1Gateway_withTier0(t *testing.T) { testAccNsxtPolicyTier1Exists(testResourceName), resource.TestCheckResourceAttr(testResourceName, "display_name", updateName), resource.TestCheckResourceAttr(testResourceName, "tier0_path", ""), - resource.TestCheckResourceAttr(realizationResourceName, "state", "REALIZED"), ), }, }, @@ -439,7 +437,7 @@ func TestAccResourceNsxtPolicyTier1Gateway_importBasic(t *testing.T) { failoverMode := "PREEMPTIVE" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicyTier1CheckDestroy(state, name) @@ -461,7 +459,6 @@ func testAccNsxtPolicyTier1Exists(resourceName string) resource.TestCheckFunc { return func(state *terraform.State) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultTier1sClient(connector) rs, ok := state.RootModule().Resources[resourceName] if !ok { @@ -473,9 +470,8 @@ func testAccNsxtPolicyTier1Exists(resourceName string) resource.TestCheckFunc { return fmt.Errorf("Policy Tier1 resource ID not set in resources") } - _, err := nsxClient.Get(resourceID) - if err != nil { - return fmt.Errorf("Error while retrieving policy Tier1 ID %s. Error: %v", resourceID, err) + if !resourceNsxtPolicyTier1GatewayExists(resourceID, connector, testAccIsGlobalManager()) { + return fmt.Errorf("Policy Tier0 %s does not exist", resourceID) } return nil @@ -484,7 +480,6 @@ func testAccNsxtPolicyTier1Exists(resourceName string) resource.TestCheckFunc { func testAccNsxtPolicyTier1CheckDestroy(state *terraform.State, displayName string) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultTier1sClient(connector) for _, rs := range state.RootModule().Resources { if rs.Type != "nsxt_policy_tier1_gateway" { @@ -492,9 +487,9 @@ func testAccNsxtPolicyTier1CheckDestroy(state *terraform.State, displayName stri } resourceID := rs.Primary.Attributes["id"] - _, err := nsxClient.Get(resourceID) - if err == nil { - return fmt.Errorf("Policy Tier1 %s still exists", displayName) + exists := resourceNsxtPolicyTier1GatewayExists(resourceID, connector, testAccIsGlobalManager()) + if exists { + return fmt.Errorf("Policy Tier0 %s still exists", displayName) } } return nil @@ -548,7 +543,7 @@ func testAccNsxtPolicyTier1CreateTemplate(name string, failoverMode string, with poolAllocation = `pool_allocation = "ROUTING"` } - return fmt.Sprintf(` + config := fmt.Sprintf(` resource "nsxt_policy_tier1_gateway" "test" { display_name = "%s" description = "Acceptance Test" @@ -559,6 +554,7 @@ resource "nsxt_policy_tier1_gateway" "test" { force_whitelisting = "false" route_advertisement_types = ["TIER1_STATIC_ROUTES", "TIER1_CONNECTED"] ipv6_ndra_profile_path = "/infra/ipv6-ndra-profiles/default" + ipv6_dad_profile_path = "/infra/ipv6-dad-profiles/default" %s tag { @@ -570,11 +566,8 @@ resource "nsxt_policy_tier1_gateway" "test" { scope = "scope2" tag = "tag2" } -} - -data "nsxt_policy_realization_info" "realization_info" { - path = nsxt_policy_tier1_gateway.test.path }`, name, failoverMode, poolAllocation) + return testAccAdjustPolicyInfraConfig(config) } func testAccNsxtPolicyTier1UpdateTemplate(name string, failoverMode string, withPoolAllocation bool) string { @@ -582,7 +575,7 @@ func testAccNsxtPolicyTier1UpdateTemplate(name string, failoverMode string, with if withPoolAllocation { poolAllocation = `pool_allocation = "ROUTING"` } - return fmt.Sprintf(` + config := fmt.Sprintf(` resource "nsxt_policy_tier1_gateway" "test" { display_name = "%s" description = "Acceptance Test Update" @@ -592,6 +585,7 @@ resource "nsxt_policy_tier1_gateway" "test" { enable_standby_relocation = "false" force_whitelisting = "true" route_advertisement_types = ["TIER1_CONNECTED"] + ipv6_ndra_profile_path = "/infra/ipv6-ndra-profiles/default" ipv6_dad_profile_path = "/infra/ipv6-dad-profiles/default" %s @@ -599,11 +593,8 @@ resource "nsxt_policy_tier1_gateway" "test" { scope = "scope3" tag = "tag3" } -} - -data "nsxt_policy_realization_info" "realization_info" { - path = nsxt_policy_tier1_gateway.test.path }`, name, failoverMode, poolAllocation) + return testAccAdjustPolicyInfraConfig(config) } func testAccNsxtPolicyTier1Update2Template(name string, failoverMode string, withPoolAllocation bool) string { @@ -611,7 +602,7 @@ func testAccNsxtPolicyTier1Update2Template(name string, failoverMode string, wit if withPoolAllocation { poolAllocation = `pool_allocation = "LB_SMALL"` } - return fmt.Sprintf(` + config := fmt.Sprintf(` resource "nsxt_policy_tier1_gateway" "test" { display_name = "%s" description = "Acceptance Test Update" @@ -621,6 +612,7 @@ resource "nsxt_policy_tier1_gateway" "test" { enable_standby_relocation = "false" force_whitelisting = "true" route_advertisement_types = ["TIER1_CONNECTED"] + ipv6_ndra_profile_path = "/infra/ipv6-ndra-profiles/default" ipv6_dad_profile_path = "/infra/ipv6-dad-profiles/default" %s @@ -628,11 +620,9 @@ resource "nsxt_policy_tier1_gateway" "test" { scope = "scope3" tag = "tag3" } -} - -data "nsxt_policy_realization_info" "realization_info" { - path = nsxt_policy_tier1_gateway.test.path }`, name, failoverMode, poolAllocation) + + return testAccAdjustPolicyInfraConfig(config) } func testAccNsxtPolicyTier1ImportTemplate(name string, failoverMode string) string { diff --git a/nsxt/resource_nsxt_policy_vlan_segment_test.go b/nsxt/resource_nsxt_policy_vlan_segment_test.go index 2fe4337c4..b8911079f 100644 --- a/nsxt/resource_nsxt_policy_vlan_segment_test.go +++ b/nsxt/resource_nsxt_policy_vlan_segment_test.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "testing" ) @@ -119,7 +118,7 @@ func TestAccResourceNsxtPolicyVlanSegment_withDhcp(t *testing.T) { dnsServersV6 := []string{"2000::2", "3000::3"} resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccNSXVersion(t, "3.0.0") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNsxtPolicySegmentCheckDestroy(state, name) @@ -189,7 +188,6 @@ func testAccNsxtPolicyVlanSegmentExists(resourceName string) resource.TestCheckF return func(state *terraform.State) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultSegmentsClient(connector) rs, ok := state.RootModule().Resources[resourceName] if !ok { @@ -200,10 +198,8 @@ func testAccNsxtPolicyVlanSegmentExists(resourceName string) resource.TestCheckF if resourceID == "" { return fmt.Errorf("Policy VLAN Segment resource ID not set in resources") } - - _, err := nsxClient.Get(resourceID) - if err != nil { - return fmt.Errorf("Error while retrieving policy VLAN Segment ID %s. Error: %v", resourceID, err) + if !resourceNsxtPolicySegmentExists(resourceID, connector, testAccIsGlobalManager()) { + return fmt.Errorf("Error while retrieving policy VLAN Segment ID %s", resourceID) } return nil @@ -212,7 +208,6 @@ func testAccNsxtPolicyVlanSegmentExists(resourceName string) resource.TestCheckF func testAccNsxtPolicyVlanSegmentCheckDestroy(state *terraform.State, displayName string) error { connector := getPolicyConnector(testAccProvider.Meta().(nsxtClients)) - nsxClient := infra.NewDefaultSegmentsClient(connector) for _, rs := range state.RootModule().Resources { if rs.Type != "nsxt_policy_vlan_segment" { @@ -220,21 +215,16 @@ func testAccNsxtPolicyVlanSegmentCheckDestroy(state *terraform.State, displayNam } resourceID := rs.Primary.Attributes["id"] - _, err := nsxClient.Get(resourceID) - if err == nil { - return fmt.Errorf("Policy VLAN Segment %s still exists", displayName) + + if resourceNsxtPolicySegmentExists(resourceID, connector, testAccIsGlobalManager()) { + return fmt.Errorf("Policy VLAN Segment %s (%s) still exists", displayName, resourceID) } } return nil } func testAccNsxtPolicyVlanSegmentDeps() string { - return fmt.Sprintf(` -data "nsxt_policy_transport_zone" "vlantz" { - display_name = "%s" -} - -`, getVlanTransportZoneName()) + return testAccNSXPolicyTransportZoneReadTemplate(getVlanTransportZoneName()) } func testAccNsxtPolicyVlanSegmentImportTemplate(name string) string { @@ -243,7 +233,7 @@ resource "nsxt_policy_vlan_segment" "test" { display_name = "%s" description = "Acceptance Test" vlan_ids = ["101"] - transport_zone_path = data.nsxt_policy_transport_zone.vlantz.path + transport_zone_path = data.nsxt_policy_transport_zone.test.path } `, name) } @@ -254,7 +244,7 @@ func testAccNsxtPolicyVlanSegmentBasicTemplate(name string) string { resource "nsxt_policy_vlan_segment" "test" { display_name = "%s" description = "Acceptance Test" - transport_zone_path = data.nsxt_policy_transport_zone.vlantz.path + transport_zone_path = data.nsxt_policy_transport_zone.test.path domain_name = "tftest.org" vlan_ids = ["101"] @@ -272,7 +262,7 @@ func testAccNsxtPolicyVlanSegmentBasicUpdateTemplate(name string) string { resource "nsxt_policy_vlan_segment" "test" { display_name = "%s" description = "Acceptance Test2" - transport_zone_path = data.nsxt_policy_transport_zone.vlantz.path + transport_zone_path = data.nsxt_policy_transport_zone.test.path domain_name = "tftest2.org" vlan_ids = ["101", "104-110"] @@ -295,7 +285,7 @@ resource "nsxt_policy_vlan_segment" "test" { display_name = "%s" description = "Acceptance Test" domain_name = "tftest.org" - transport_zone_path = data.nsxt_policy_transport_zone.vlantz.path + transport_zone_path = data.nsxt_policy_transport_zone.test.path vlan_ids = ["101", "102"] tag { @@ -318,7 +308,7 @@ resource "nsxt_policy_vlan_segment" "test" { display_name = "%s" description = "Acceptance Test" domain_name = "tftest.org" - transport_zone_path = data.nsxt_policy_transport_zone.vlantz.path + transport_zone_path = data.nsxt_policy_transport_zone.test.path vlan_ids = ["101", "102"] tag { @@ -348,7 +338,7 @@ resource "nsxt_policy_dhcp_server" "test" { resource "nsxt_policy_vlan_segment" "test" { display_name = "%s" - transport_zone_path = data.nsxt_policy_transport_zone.vlantz.path + transport_zone_path = data.nsxt_policy_transport_zone.test.path vlan_ids = ["101", "102"] subnet { diff --git a/nsxt/resource_nsxt_policy_vm_tags_test.go b/nsxt/resource_nsxt_policy_vm_tags_test.go index 59df3873e..57d82b1b8 100644 --- a/nsxt/resource_nsxt_policy_vm_tags_test.go +++ b/nsxt/resource_nsxt_policy_vm_tags_test.go @@ -15,7 +15,7 @@ func TestAccResourceNsxtPolicyVMTags_basic(t *testing.T) { testResourceName := "nsxt_policy_vm_tags.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_VM_ID") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_VM_ID") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyVMTagsCheckDestroy(state) @@ -49,7 +49,7 @@ func TestAccResourceNsxtPolicyVMTags_import_basic(t *testing.T) { testResourceName := "nsxt_policy_vm_tags.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_VM_ID") }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t); testAccEnvDefined(t, "NSXT_TEST_VM_ID") }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXPolicyVMTagsCheckDestroy(state) diff --git a/nsxt/resource_nsxt_static_route_test.go b/nsxt/resource_nsxt_static_route_test.go index 01dca8e60..ad1fc8dfa 100644 --- a/nsxt/resource_nsxt_static_route_test.go +++ b/nsxt/resource_nsxt_static_route_test.go @@ -28,7 +28,7 @@ func testAccResourceNsxtStaticRoute(t *testing.T, tier string) { transportZoneName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXStaticRouteCheckDestroy(state, name) @@ -79,7 +79,7 @@ func testAccResourceNsxtStaticRouteImport(t *testing.T, tier string) { transportZoneName := getOverlayTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXStaticRouteCheckDestroy(state, name) diff --git a/nsxt/resource_nsxt_vlan_logical_switch_test.go b/nsxt/resource_nsxt_vlan_logical_switch_test.go index d0bdead42..f6acf6b4d 100644 --- a/nsxt/resource_nsxt_vlan_logical_switch_test.go +++ b/nsxt/resource_nsxt_vlan_logical_switch_test.go @@ -22,7 +22,7 @@ func TestAccResourceNsxtVlanLogicalSwitch_basic(t *testing.T) { updatedvlan := "2" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalSwitchCheckDestroy(state, switchName, "nsxt_vlan_logical_switch") @@ -63,7 +63,7 @@ func TestAccResourceNsxtVlanLogicalSwitch_withProfiles(t *testing.T) { profileType := "SwitchSecuritySwitchingProfile" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { // Verify that the LS was deleted @@ -117,7 +117,7 @@ func TestAccResourceNsxtVlanLogicalSwitch_withMacPool(t *testing.T) { novlan := "0" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalSwitchCheckDestroy(state, switchName, "nsxt_vlan_logical_switch") @@ -150,7 +150,7 @@ func TestAccResourceNsxtVlanLogicalSwitch_importBasic(t *testing.T) { transportZoneName := getVlanTransportZoneName() resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccOnlyLocalManager(t); testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: func(state *terraform.State) error { return testAccNSXLogicalSwitchCheckDestroy(state, switchName, "nsxt_vlan_logical_switch") diff --git a/nsxt/segment_common.go b/nsxt/segment_common.go index 706e9ec24..dc671fab4 100644 --- a/nsxt/segment_common.go +++ b/nsxt/segment_common.go @@ -8,6 +8,9 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" "github.com/vmware/vsphere-automation-sdk-go/runtime/data" "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + gm_infra "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra" + gm_segments "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments" + gm_model "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/segments" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" @@ -109,18 +112,16 @@ func getPolicySegmentSubnetSchema() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ "dhcp_v4_config": { - Type: schema.TypeList, - Optional: true, - Elem: getPolicySegmentDhcpV4ConfigSchema(), - MaxItems: 1, - ConflictsWith: []string{"subnet.dhcp_v6_config"}, + Type: schema.TypeList, + Optional: true, + Elem: getPolicySegmentDhcpV4ConfigSchema(), + MaxItems: 1, }, "dhcp_v6_config": { - Type: schema.TypeList, - Optional: true, - Elem: getPolicySegmentDhcpV6ConfigSchema(), - MaxItems: 1, - ConflictsWith: []string{"subnet.dhcp_v4_config"}, + Type: schema.TypeList, + Optional: true, + Elem: getPolicySegmentDhcpV6ConfigSchema(), + MaxItems: 1, }, "dhcp_ranges": { Type: schema.TypeList, @@ -619,10 +620,16 @@ func policySegmentResourceToStruct(d *schema.ResourceData, isVlan bool) (model.S return obj, nil } -func resourceNsxtPolicySegmentExists(id string, connector *client.RestConnector) bool { - client := infra.NewDefaultSegmentsClient(connector) +func resourceNsxtPolicySegmentExists(id string, connector *client.RestConnector, isGlobalManager bool) bool { + var err error - _, err := client.Get(id) + if isGlobalManager { + client := gm_infra.NewDefaultSegmentsClient(connector) + _, err = client.Get(id) + } else { + client := infra.NewDefaultSegmentsClient(connector) + _, err = client.Get(id) + } if err == nil { return true } @@ -637,16 +644,31 @@ func resourceNsxtPolicySegmentExists(id string, connector *client.RestConnector) func nsxtPolicySegmentRead(d *schema.ResourceData, m interface{}, isVlan bool) error { connector := getPolicyConnector(m) - client := infra.NewDefaultSegmentsClient(connector) id := d.Id() if id == "" { return fmt.Errorf("Error obtaining Segment ID") } - obj, err := client.Get(id) - if err != nil { - return handleReadError(d, "Segment", id, err) + var obj model.Segment + if isPolicyGlobalManager(m) { + client := gm_infra.NewDefaultSegmentsClient(connector) + gmObj, err := client.Get(id) + if err != nil { + return handleReadError(d, "Segment", id, err) + } + lmObj, err := convertModelBindingType(gmObj, gm_model.SegmentBindingType(), model.SegmentBindingType()) + if err != nil { + return err + } + obj = lmObj.(model.Segment) + } else { + client := infra.NewDefaultSegmentsClient(connector) + var err error + obj, err = client.Get(id) + if err != nil { + return handleReadError(d, "Segment", id, err) + } } d.Set("display_name", obj.DisplayName) @@ -715,10 +737,9 @@ func nsxtPolicySegmentRead(d *schema.ResourceData, m interface{}, isVlan bool) e func nsxtPolicySegmentCreate(d *schema.ResourceData, m interface{}, isVlan bool) error { connector := getPolicyConnector(m) - client := infra.NewDefaultSegmentsClient(connector) // Initialize resource Id and verify this ID is not yet used - id, err := getOrGenerateID(d, connector, resourceNsxtPolicySegmentExists) + id, err := getOrGenerateID(d, m, resourceNsxtPolicySegmentExists) if err != nil { return err } @@ -729,7 +750,17 @@ func nsxtPolicySegmentCreate(d *schema.ResourceData, m interface{}, isVlan bool) if err != nil { return err } - err = client.Patch(id, obj) + if isPolicyGlobalManager(m) { + gmObj, err := convertModelBindingType(obj, model.SegmentBindingType(), gm_model.SegmentBindingType()) + if err != nil { + return err + } + client := gm_infra.NewDefaultSegmentsClient(connector) + err = client.Patch(id, gmObj.(gm_model.Segment)) + } else { + client := infra.NewDefaultSegmentsClient(connector) + err = client.Patch(id, obj) + } if err != nil { return handleCreateError("Segment", id, err) } @@ -742,7 +773,6 @@ func nsxtPolicySegmentCreate(d *schema.ResourceData, m interface{}, isVlan bool) func nsxtPolicySegmentUpdate(d *schema.ResourceData, m interface{}, isVlan bool) error { connector := getPolicyConnector(m) - client := infra.NewDefaultSegmentsClient(connector) id := d.Id() if id == "" { @@ -753,7 +783,18 @@ func nsxtPolicySegmentUpdate(d *schema.ResourceData, m interface{}, isVlan bool) if err != nil { return err } - _, err = client.Update(id, obj) + + if isPolicyGlobalManager(m) { + gmObj, err := convertModelBindingType(obj, model.SegmentBindingType(), gm_model.SegmentBindingType()) + if err != nil { + return err + } + client := gm_infra.NewDefaultSegmentsClient(connector) + _, err = client.Update(id, gmObj.(gm_model.Segment)) + } else { + client := infra.NewDefaultSegmentsClient(connector) + _, err = client.Update(id, obj) + } if err != nil { return handleUpdateError("Segment", id, err) } @@ -768,10 +809,8 @@ func nsxtPolicySegmentDelete(d *schema.ResourceData, m interface{}) error { } connector := getPolicyConnector(m) - client := infra.NewDefaultSegmentsClient(connector) - portsClient := segments.NewDefaultPortsClient(connector) - // During buld destroy, VMs might be destroyed before segments, but + // During bulk destroy, VMs might be destroyed before segments, but // VIF release is not yet propagated to NSX. NSX will reply with // InvalidRequest on attempted delete if ports are present on the // segment. The code below waits till possible ports are deleted. @@ -781,14 +820,29 @@ func nsxtPolicySegmentDelete(d *schema.ResourceData, m interface{}) error { Pending: pendingStates, Target: targetStates, Refresh: func() (interface{}, string, error) { - ports, err := portsClient.List(id, nil, nil, nil, nil, nil, nil) - if err != nil { - return ports, "error", logAPIError("Error listing segment ports", err) + var ports interface{} + var numOfPorts int + if isPolicyGlobalManager(m) { + portsClient := gm_segments.NewDefaultPortsClient(connector) + gm_ports, err := portsClient.List(id, nil, nil, nil, nil, nil, nil) + if err != nil { + return gm_ports, "error", logAPIError("Error listing segment ports", err) + } + numOfPorts = len(gm_ports.Results) + ports = gm_ports + } else { + portsClient := segments.NewDefaultPortsClient(connector) + lm_ports, err := portsClient.List(id, nil, nil, nil, nil, nil, nil) + if err != nil { + return lm_ports, "error", logAPIError("Error listing segment ports", err) + } + numOfPorts = len(lm_ports.Results) + ports = lm_ports } - log.Printf("[DEBUG] Current number of ports on segment %s is %d", id, len(ports.Results)) + log.Printf("[DEBUG] Current number of ports on segment %s is %d", id, numOfPorts) - if len(ports.Results) > 0 { + if numOfPorts > 0 { return ports, "pending", nil } return ports, "ok", nil @@ -802,7 +856,15 @@ func nsxtPolicySegmentDelete(d *schema.ResourceData, m interface{}) error { if err != nil { return fmt.Errorf("Failed to get port information for segment %s: %v", id, err) } - err = client.Delete(id) + + if isPolicyGlobalManager(m) { + client := gm_infra.NewDefaultSegmentsClient(connector) + err = client.Delete(id) + } else { + client := infra.NewDefaultSegmentsClient(connector) + err = client.Delete(id) + } + if err != nil { return handleDeleteError("Segment", id, err) } diff --git a/nsxt/utils_test.go b/nsxt/utils_test.go index ef9794ce3..9151ca216 100644 --- a/nsxt/utils_test.go +++ b/nsxt/utils_test.go @@ -6,8 +6,11 @@ package nsxt import ( "fmt" "github.com/vmware/go-vmware-nsxt/trust" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" "net/http" "os" + "strings" "testing" ) @@ -20,6 +23,7 @@ const overlayTransportZoneNamePrefix string = "1-transportzone" const macPoolDefaultName string = "DefaultMacPool" const realizationResourceName string = "data.nsxt_policy_realization_info.realization_info" +const defaultTestResourceName string = "terraform-acctest" const singleTag string = ` tag { @@ -89,6 +93,14 @@ func getTestVMName() string { return os.Getenv("NSXT_TEST_VM_NAME") } +func getTestSiteName() string { + return os.Getenv("NSXT_TEST_SITE_NAME") +} + +func getTestAnotherSiteName() string { + return os.Getenv("NSXT_TEST_ANOTHER_SITE_NAME") +} + func getTestCertificateName(isClient bool) string { if isClient { return os.Getenv("NSXT_TEST_CLIENT_CERTIFICATE_NAME") @@ -102,6 +114,35 @@ func testAccEnvDefined(t *testing.T, envVar string) { } } +func testAccIsGlobalManager() bool { + return os.Getenv("NSXT_GLOBAL_MANAGER") == "true" || os.Getenv("NSXT_GLOBAL_MANAGER") == "1" +} + +func testAccOnlyGlobalManager(t *testing.T) { + if !testAccIsGlobalManager() { + t.Skipf("This test requires a global manager environment") + } +} + +func testAccOnlyLocalManager(t *testing.T) { + if testAccIsGlobalManager() { + t.Skipf("This test requires a local manager environment") + } +} + +func testAccNSXGlobalManagerSitePrecheck(t *testing.T) { + if testAccIsGlobalManager() && getTestSiteName() == "" { + str := fmt.Sprintf("%s must be set for this acceptance test", "NSXT_TEST_SITE_NAME") + t.Fatal(str) + } +} + +func testAccSkipIfIsLocalManager(t *testing.T) { + if !testAccIsGlobalManager() { + t.Skipf("This test is for global manager only") + } +} + // Create and delete CA and client cert for various tests func testAccNSXCreateCert(t *testing.T, name string, certPem string, certPK string, certType string) string { nsxClient, err := testAccGetClient() @@ -287,3 +328,47 @@ func testAccNSXDeleteCerts(t *testing.T, certID string, clientCertID string, caC func testAccNsxtPolicyEmptyTemplate() string { return " " } + +func testGetObjIDByName(objName string, resourceType string) (string, error) { + connector, err1 := testAccGetPolicyConnector() + if err1 != nil { + return "", fmt.Errorf("Error during test client initialization: %v", err1) + } + + resultValues, err2 := listPolicyResourcesByType(connector, &resourceType, nil) + if err2 != nil { + return "", err2 + } + + converter := bindings.NewTypeConverter() + converter.SetMode(bindings.REST) + + for _, result := range resultValues { + dataValue, errors := converter.ConvertToGolang(result, model.PolicyResourceBindingType()) + if len(errors) > 0 { + return "", errors[0] + } + policyResource := dataValue.(model.PolicyResource) + + if *policyResource.DisplayName == objName { + return *policyResource.Id, nil + } + } + + return "", fmt.Errorf("%s with name '%s' was not found", resourceType, objName) +} + +func testAccNsxtGlobalPolicySite(domainName string) string { + return fmt.Sprintf(` +data "nsxt_policy_site" "test" { + display_name = "%s" +}`, domainName) +} + +func testAccAdjustPolicyInfraConfig(config string) string { + if testAccIsGlobalManager() { + return strings.Replace(config, "/infra/", "/global-infra/", -1) + } + + return config +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go index a2c5817c4..9cf7eaf40 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go @@ -208,7 +208,7 @@ func (e errorList) Error() string { // How do we want to handle the array size being zero if size := len(e); size > 0 { for i := 0; i < size; i++ { - msg += fmt.Sprintf("%s", e[i].Error()) + msg += e[i].Error() // We check the next index to see if it is within the slice. // If it is, then we append a newline. We do this, because unit tests // could be broken with the additional '\n' diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index 11c52c389..285e54d67 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go @@ -185,13 +185,12 @@ func ValuesAtPath(i interface{}, path string) ([]interface{}, error) { // SetValueAtPath sets a value at the case insensitive lexical path inside // of a structure. func SetValueAtPath(i interface{}, path string, v interface{}) { - if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil { - for _, rval := range rvals { - if rval.Kind() == reflect.Ptr && rval.IsNil() { - continue - } - setValue(rval, v) + rvals := rValuesAtPath(i, path, true, false, v == nil) + for _, rval := range rvals { + if rval.Kind() == reflect.Ptr && rval.IsNil() { + continue } + setValue(rval, v) } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go index 709605384..c022407f5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go @@ -64,7 +64,7 @@ func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, op default: maxRetries := aws.IntValue(cfg.MaxRetries) if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { - maxRetries = 3 + maxRetries = DefaultRetryerMaxNumRetries } svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries} } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go index a397b0d04..0fda42510 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go @@ -1,6 +1,7 @@ package client import ( + "math" "strconv" "time" @@ -9,82 +10,142 @@ import ( ) // DefaultRetryer implements basic retry logic using exponential backoff for -// most services. If you want to implement custom retry logic, implement the -// request.Retryer interface or create a structure type that composes this -// struct and override the specific methods. For example, to override only -// the MaxRetries method: +// most services. If you want to implement custom retry logic, you can implement the +// request.Retryer interface. // -// type retryer struct { -// client.DefaultRetryer -// } -// -// // This implementation always has 100 max retries -// func (d retryer) MaxRetries() int { return 100 } type DefaultRetryer struct { - NumMaxRetries int + // Num max Retries is the number of max retries that will be performed. + // By default, this is zero. + NumMaxRetries int + + // MinRetryDelay is the minimum retry delay after which retry will be performed. + // If not set, the value is 0ns. + MinRetryDelay time.Duration + + // MinThrottleRetryDelay is the minimum retry delay when throttled. + // If not set, the value is 0ns. + MinThrottleDelay time.Duration + + // MaxRetryDelay is the maximum retry delay before which retry must be performed. + // If not set, the value is 0ns. + MaxRetryDelay time.Duration + + // MaxThrottleDelay is the maximum retry delay when throttled. + // If not set, the value is 0ns. + MaxThrottleDelay time.Duration } +const ( + // DefaultRetryerMaxNumRetries sets maximum number of retries + DefaultRetryerMaxNumRetries = 3 + + // DefaultRetryerMinRetryDelay sets minimum retry delay + DefaultRetryerMinRetryDelay = 30 * time.Millisecond + + // DefaultRetryerMinThrottleDelay sets minimum delay when throttled + DefaultRetryerMinThrottleDelay = 500 * time.Millisecond + + // DefaultRetryerMaxRetryDelay sets maximum retry delay + DefaultRetryerMaxRetryDelay = 300 * time.Second + + // DefaultRetryerMaxThrottleDelay sets maximum delay when throttled + DefaultRetryerMaxThrottleDelay = 300 * time.Second +) + // MaxRetries returns the number of maximum returns the service will use to make // an individual API request. func (d DefaultRetryer) MaxRetries() int { return d.NumMaxRetries } +// setRetryerDefaults sets the default values of the retryer if not set +func (d *DefaultRetryer) setRetryerDefaults() { + if d.MinRetryDelay == 0 { + d.MinRetryDelay = DefaultRetryerMinRetryDelay + } + if d.MaxRetryDelay == 0 { + d.MaxRetryDelay = DefaultRetryerMaxRetryDelay + } + if d.MinThrottleDelay == 0 { + d.MinThrottleDelay = DefaultRetryerMinThrottleDelay + } + if d.MaxThrottleDelay == 0 { + d.MaxThrottleDelay = DefaultRetryerMaxThrottleDelay + } +} + // RetryRules returns the delay duration before retrying this request again func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { - // Set the upper limit of delay in retrying at ~five minutes - minTime := 30 - throttle := d.shouldThrottle(r) - if throttle { - if delay, ok := getRetryDelay(r); ok { - return delay - } - minTime = 500 + // if number of max retries is zero, no retries will be performed. + if d.NumMaxRetries == 0 { + return 0 + } + + // Sets default value for retryer members + d.setRetryerDefaults() + + // minDelay is the minimum retryer delay + minDelay := d.MinRetryDelay + + var initialDelay time.Duration + + isThrottle := r.IsErrorThrottle() + if isThrottle { + if delay, ok := getRetryAfterDelay(r); ok { + initialDelay = delay + } + minDelay = d.MinThrottleDelay } retryCount := r.RetryCount - if throttle && retryCount > 8 { - retryCount = 8 - } else if retryCount > 13 { - retryCount = 13 + + // maxDelay the maximum retryer delay + maxDelay := d.MaxRetryDelay + + if isThrottle { + maxDelay = d.MaxThrottleDelay + } + + var delay time.Duration + + // Logic to cap the retry count based on the minDelay provided + actualRetryCount := int(math.Log2(float64(minDelay))) + 1 + if actualRetryCount < 63-retryCount { + delay = time.Duration(1< maxDelay { + delay = getJitterDelay(maxDelay / 2) + } + } else { + delay = getJitterDelay(maxDelay / 2) } + return delay + initialDelay +} - delay := (1 << uint(retryCount)) * (sdkrand.SeededRand.Intn(minTime) + minTime) - return time.Duration(delay) * time.Millisecond +// getJitterDelay returns a jittered delay for retry +func getJitterDelay(duration time.Duration) time.Duration { + return time.Duration(sdkrand.SeededRand.Int63n(int64(duration)) + int64(duration)) } // ShouldRetry returns true if the request should be retried. func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { + + // ShouldRetry returns false if number of max retries is 0. + if d.NumMaxRetries == 0 { + return false + } + // If one of the other handlers already set the retry state // we don't want to override it based on the service's state if r.Retryable != nil { return *r.Retryable } - - if r.HTTPResponse.StatusCode >= 500 && r.HTTPResponse.StatusCode != 501 { - return true - } - return r.IsErrorRetryable() || d.shouldThrottle(r) -} - -// ShouldThrottle returns true if the request should be throttled. -func (d DefaultRetryer) shouldThrottle(r *request.Request) bool { - switch r.HTTPResponse.StatusCode { - case 429: - case 502: - case 503: - case 504: - default: - return r.IsErrorThrottle() - } - - return true + return r.IsErrorRetryable() || r.IsErrorThrottle() } // This will look in the Retry-After header, RFC 7231, for how long // it will wait before attempting another request -func getRetryDelay(r *request.Request) (time.Duration, bool) { +func getRetryAfterDelay(r *request.Request) (time.Duration, bool) { if !canUseRetryAfterHeader(r) { return 0, false } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go index 7b5e1276a..8958c32d4 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go @@ -67,10 +67,14 @@ func logRequest(r *request.Request) { if !bodySeekable { r.SetReaderBody(aws.ReadSeekCloser(r.HTTPRequest.Body)) } - // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's - // Body as a NoOpCloser and will not be reset after read by the HTTP - // client reader. - r.ResetBody() + // Reset the request body because dumpRequest will re-wrap the + // r.HTTPRequest's Body as a NoOpCloser and will not be reset after + // read by the HTTP client reader. + if err := r.Error; err != nil { + r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, + r.ClientInfo.ServiceName, r.Operation.Name, err)) + return + } } r.Config.Logger.Log(fmt.Sprintf(logReqMsg, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go new file mode 100644 index 000000000..881d575f0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go @@ -0,0 +1,28 @@ +package client + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws/request" +) + +// NoOpRetryer provides a retryer that performs no retries. +// It should be used when we do not want retries to be performed. +type NoOpRetryer struct{} + +// MaxRetries returns the number of maximum returns the service will use to make +// an individual API; For NoOpRetryer the MaxRetries will always be zero. +func (d NoOpRetryer) MaxRetries() int { + return 0 +} + +// ShouldRetry will always return false for NoOpRetryer, as it should never retry. +func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool { + return false +} + +// RetryRules returns the delay duration before retrying this request again; +// since NoOpRetryer does not retry, RetryRules always returns 0. +func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration { + return 0 +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go index 10634d173..fd1e240f6 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -20,7 +20,7 @@ type RequestRetryer interface{} // A Config provides service configuration for service clients. By default, // all clients will use the defaults.DefaultConfig structure. // -// // Create Session with MaxRetry configuration to be shared by multiple +// // Create Session with MaxRetries configuration to be shared by multiple // // service clients. // sess := session.Must(session.NewSession(&aws.Config{ // MaxRetries: aws.Int(3), @@ -251,7 +251,7 @@ type Config struct { // NewConfig returns a new Config pointer that can be chained with builder // methods to set multiple configuration values inline without using pointers. // -// // Create Session with MaxRetry configuration to be shared by multiple +// // Create Session with MaxRetries configuration to be shared by multiple // // service clients. // sess := session.Must(session.NewSession(aws.NewConfig(). // WithMaxRetries(3), diff --git a/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go b/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go index ff5d58e06..4e076c183 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go @@ -179,6 +179,242 @@ func IntValueMap(src map[string]*int) map[string]int { return dst } +// Uint returns a pointer to the uint value passed in. +func Uint(v uint) *uint { + return &v +} + +// UintValue returns the value of the uint pointer passed in or +// 0 if the pointer is nil. +func UintValue(v *uint) uint { + if v != nil { + return *v + } + return 0 +} + +// UintSlice converts a slice of uint values uinto a slice of +// uint pointers +func UintSlice(src []uint) []*uint { + dst := make([]*uint, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// UintValueSlice converts a slice of uint pointers uinto a slice of +// uint values +func UintValueSlice(src []*uint) []uint { + dst := make([]uint, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// UintMap converts a string map of uint values uinto a string +// map of uint pointers +func UintMap(src map[string]uint) map[string]*uint { + dst := make(map[string]*uint) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// UintValueMap converts a string map of uint pointers uinto a string +// map of uint values +func UintValueMap(src map[string]*uint) map[string]uint { + dst := make(map[string]uint) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int8 returns a pointer to the int8 value passed in. +func Int8(v int8) *int8 { + return &v +} + +// Int8Value returns the value of the int8 pointer passed in or +// 0 if the pointer is nil. +func Int8Value(v *int8) int8 { + if v != nil { + return *v + } + return 0 +} + +// Int8Slice converts a slice of int8 values into a slice of +// int8 pointers +func Int8Slice(src []int8) []*int8 { + dst := make([]*int8, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int8ValueSlice converts a slice of int8 pointers into a slice of +// int8 values +func Int8ValueSlice(src []*int8) []int8 { + dst := make([]int8, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int8Map converts a string map of int8 values into a string +// map of int8 pointers +func Int8Map(src map[string]int8) map[string]*int8 { + dst := make(map[string]*int8) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int8ValueMap converts a string map of int8 pointers into a string +// map of int8 values +func Int8ValueMap(src map[string]*int8) map[string]int8 { + dst := make(map[string]int8) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int16 returns a pointer to the int16 value passed in. +func Int16(v int16) *int16 { + return &v +} + +// Int16Value returns the value of the int16 pointer passed in or +// 0 if the pointer is nil. +func Int16Value(v *int16) int16 { + if v != nil { + return *v + } + return 0 +} + +// Int16Slice converts a slice of int16 values into a slice of +// int16 pointers +func Int16Slice(src []int16) []*int16 { + dst := make([]*int16, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int16ValueSlice converts a slice of int16 pointers into a slice of +// int16 values +func Int16ValueSlice(src []*int16) []int16 { + dst := make([]int16, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int16Map converts a string map of int16 values into a string +// map of int16 pointers +func Int16Map(src map[string]int16) map[string]*int16 { + dst := make(map[string]*int16) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int16ValueMap converts a string map of int16 pointers into a string +// map of int16 values +func Int16ValueMap(src map[string]*int16) map[string]int16 { + dst := make(map[string]int16) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int32 returns a pointer to the int32 value passed in. +func Int32(v int32) *int32 { + return &v +} + +// Int32Value returns the value of the int32 pointer passed in or +// 0 if the pointer is nil. +func Int32Value(v *int32) int32 { + if v != nil { + return *v + } + return 0 +} + +// Int32Slice converts a slice of int32 values into a slice of +// int32 pointers +func Int32Slice(src []int32) []*int32 { + dst := make([]*int32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int32ValueSlice converts a slice of int32 pointers into a slice of +// int32 values +func Int32ValueSlice(src []*int32) []int32 { + dst := make([]int32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int32Map converts a string map of int32 values into a string +// map of int32 pointers +func Int32Map(src map[string]int32) map[string]*int32 { + dst := make(map[string]*int32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int32ValueMap converts a string map of int32 pointers into a string +// map of int32 values +func Int32ValueMap(src map[string]*int32) map[string]int32 { + dst := make(map[string]int32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + // Int64 returns a pointer to the int64 value passed in. func Int64(v int64) *int64 { return &v @@ -238,6 +474,301 @@ func Int64ValueMap(src map[string]*int64) map[string]int64 { return dst } +// Uint8 returns a pointer to the uint8 value passed in. +func Uint8(v uint8) *uint8 { + return &v +} + +// Uint8Value returns the value of the uint8 pointer passed in or +// 0 if the pointer is nil. +func Uint8Value(v *uint8) uint8 { + if v != nil { + return *v + } + return 0 +} + +// Uint8Slice converts a slice of uint8 values into a slice of +// uint8 pointers +func Uint8Slice(src []uint8) []*uint8 { + dst := make([]*uint8, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint8ValueSlice converts a slice of uint8 pointers into a slice of +// uint8 values +func Uint8ValueSlice(src []*uint8) []uint8 { + dst := make([]uint8, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint8Map converts a string map of uint8 values into a string +// map of uint8 pointers +func Uint8Map(src map[string]uint8) map[string]*uint8 { + dst := make(map[string]*uint8) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint8ValueMap converts a string map of uint8 pointers into a string +// map of uint8 values +func Uint8ValueMap(src map[string]*uint8) map[string]uint8 { + dst := make(map[string]uint8) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint16 returns a pointer to the uint16 value passed in. +func Uint16(v uint16) *uint16 { + return &v +} + +// Uint16Value returns the value of the uint16 pointer passed in or +// 0 if the pointer is nil. +func Uint16Value(v *uint16) uint16 { + if v != nil { + return *v + } + return 0 +} + +// Uint16Slice converts a slice of uint16 values into a slice of +// uint16 pointers +func Uint16Slice(src []uint16) []*uint16 { + dst := make([]*uint16, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint16ValueSlice converts a slice of uint16 pointers into a slice of +// uint16 values +func Uint16ValueSlice(src []*uint16) []uint16 { + dst := make([]uint16, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint16Map converts a string map of uint16 values into a string +// map of uint16 pointers +func Uint16Map(src map[string]uint16) map[string]*uint16 { + dst := make(map[string]*uint16) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint16ValueMap converts a string map of uint16 pointers into a string +// map of uint16 values +func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { + dst := make(map[string]uint16) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint32 returns a pointer to the uint32 value passed in. +func Uint32(v uint32) *uint32 { + return &v +} + +// Uint32Value returns the value of the uint32 pointer passed in or +// 0 if the pointer is nil. +func Uint32Value(v *uint32) uint32 { + if v != nil { + return *v + } + return 0 +} + +// Uint32Slice converts a slice of uint32 values into a slice of +// uint32 pointers +func Uint32Slice(src []uint32) []*uint32 { + dst := make([]*uint32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint32ValueSlice converts a slice of uint32 pointers into a slice of +// uint32 values +func Uint32ValueSlice(src []*uint32) []uint32 { + dst := make([]uint32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint32Map converts a string map of uint32 values into a string +// map of uint32 pointers +func Uint32Map(src map[string]uint32) map[string]*uint32 { + dst := make(map[string]*uint32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint32ValueMap converts a string map of uint32 pointers into a string +// map of uint32 values +func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { + dst := make(map[string]uint32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint64 returns a pointer to the uint64 value passed in. +func Uint64(v uint64) *uint64 { + return &v +} + +// Uint64Value returns the value of the uint64 pointer passed in or +// 0 if the pointer is nil. +func Uint64Value(v *uint64) uint64 { + if v != nil { + return *v + } + return 0 +} + +// Uint64Slice converts a slice of uint64 values into a slice of +// uint64 pointers +func Uint64Slice(src []uint64) []*uint64 { + dst := make([]*uint64, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint64ValueSlice converts a slice of uint64 pointers into a slice of +// uint64 values +func Uint64ValueSlice(src []*uint64) []uint64 { + dst := make([]uint64, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint64Map converts a string map of uint64 values into a string +// map of uint64 pointers +func Uint64Map(src map[string]uint64) map[string]*uint64 { + dst := make(map[string]*uint64) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint64ValueMap converts a string map of uint64 pointers into a string +// map of uint64 values +func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { + dst := make(map[string]uint64) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Float32 returns a pointer to the float32 value passed in. +func Float32(v float32) *float32 { + return &v +} + +// Float32Value returns the value of the float32 pointer passed in or +// 0 if the pointer is nil. +func Float32Value(v *float32) float32 { + if v != nil { + return *v + } + return 0 +} + +// Float32Slice converts a slice of float32 values into a slice of +// float32 pointers +func Float32Slice(src []float32) []*float32 { + dst := make([]*float32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Float32ValueSlice converts a slice of float32 pointers into a slice of +// float32 values +func Float32ValueSlice(src []*float32) []float32 { + dst := make([]float32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Float32Map converts a string map of float32 values into a string +// map of float32 pointers +func Float32Map(src map[string]float32) map[string]*float32 { + dst := make(map[string]*float32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Float32ValueMap converts a string map of float32 pointers into a string +// map of float32 values +func Float32ValueMap(src map[string]*float32) map[string]float32 { + dst := make(map[string]float32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + // Float64 returns a pointer to the float64 value passed in. func Float64(v float64) *float64 { return &v diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index f8853d78a..0c60e612e 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -159,9 +159,9 @@ func handleSendError(r *request.Request, err error) { Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } } - // Catch all other request errors. + // Catch all request errors, and let the default retrier determine + // if the error is retryable. r.Error = awserr.New("RequestError", "send request failed", err) - r.Retryable = aws.Bool(true) // network errors are retryable // Override the error with a context canceled error, if that was canceled. ctx := r.Context() @@ -184,37 +184,39 @@ var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseH // AfterRetryHandler performs final checks to determine if the request should // be retried and how long to delay. -var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: func(r *request.Request) { - // If one of the other handlers already set the retry state - // we don't want to override it based on the service's state - if r.Retryable == nil || aws.BoolValue(r.Config.EnforceShouldRetryCheck) { - r.Retryable = aws.Bool(r.ShouldRetry(r)) - } +var AfterRetryHandler = request.NamedHandler{ + Name: "core.AfterRetryHandler", + Fn: func(r *request.Request) { + // If one of the other handlers already set the retry state + // we don't want to override it based on the service's state + if r.Retryable == nil || aws.BoolValue(r.Config.EnforceShouldRetryCheck) { + r.Retryable = aws.Bool(r.ShouldRetry(r)) + } - if r.WillRetry() { - r.RetryDelay = r.RetryRules(r) + if r.WillRetry() { + r.RetryDelay = r.RetryRules(r) - if sleepFn := r.Config.SleepDelay; sleepFn != nil { - // Support SleepDelay for backwards compatibility and testing - sleepFn(r.RetryDelay) - } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { - r.Error = awserr.New(request.CanceledErrorCode, - "request context canceled", err) - r.Retryable = aws.Bool(false) - return - } + if sleepFn := r.Config.SleepDelay; sleepFn != nil { + // Support SleepDelay for backwards compatibility and testing + sleepFn(r.RetryDelay) + } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { + r.Error = awserr.New(request.CanceledErrorCode, + "request context canceled", err) + r.Retryable = aws.Bool(false) + return + } - // when the expired token exception occurs the credentials - // need to be expired locally so that the next request to - // get credentials will trigger a credentials refresh. - if r.IsErrorExpired() { - r.Config.Credentials.Expire() - } + // when the expired token exception occurs the credentials + // need to be expired locally so that the next request to + // get credentials will trigger a credentials refresh. + if r.IsErrorExpired() { + r.Config.Credentials.Expire() + } - r.RetryCount++ - r.Error = nil - } -}} + r.RetryCount++ + r.Error = nil + } + }} // ValidateEndpointHandler is a request handler to validate a request had the // appropriate Region and Endpoint set. Will set r.Error if the endpoint or diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go index 894bbc7f8..4af592158 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go @@ -50,9 +50,10 @@ package credentials import ( "fmt" - "github.com/aws/aws-sdk-go/aws/awserr" "sync" "time" + + "github.com/aws/aws-sdk-go/aws/awserr" ) // AnonymousCredentials is an empty Credential object that can be used as @@ -83,6 +84,12 @@ type Value struct { ProviderName string } +// HasKeys returns if the credentials Value has both AccessKeyID and +// SecretAccessKey value set. +func (v Value) HasKeys() bool { + return len(v.AccessKeyID) != 0 && len(v.SecretAccessKey) != 0 +} + // A Provider is the interface for any component which will provide credentials // Value. A provider is required to manage its own Expired state, and what to // be expired means. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go index c2b2c5d65..1a7af53a4 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go @@ -98,8 +98,8 @@ func NewProviderClient(cfg aws.Config, handlers request.Handlers, endpoint strin return p } -// NewCredentialsClient returns a Credentials wrapper for retrieving credentials -// from an arbitrary endpoint concurrently. The client will request the +// NewCredentialsClient returns a pointer to a new Credentials object +// wrapping the endpoint credentials Provider. func NewCredentialsClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials { return credentials.NewCredentials(NewProviderClient(cfg, handlers, endpoint, options...)) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go index b6dbfd246..2e528d130 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -200,7 +200,7 @@ type AssumeRoleProvider struct { // by a random percentage between 0 and MaxJitterFraction. MaxJitterFrac must // have a value between 0 and 1. Any other value may lead to expected behavior. // With a MaxJitterFrac value of 0, default) will no jitter will be used. - // + // // For example, with a Duration of 30m and a MaxJitterFrac of 0.1, the // AssumeRole call will be made with an arbitrary Duration between 27m and // 30m. @@ -258,7 +258,6 @@ func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(* // Retrieve generates a new set of temporary credentials using STS. func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { - // Apply defaults where parameters are not set. if p.RoleSessionName == "" { // Try to work out a role name that will hopefully end up unique. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go new file mode 100644 index 000000000..b20b63394 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go @@ -0,0 +1,100 @@ +package stscreds + +import ( + "fmt" + "io/ioutil" + "strconv" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/service/sts" + "github.com/aws/aws-sdk-go/service/sts/stsiface" +) + +const ( + // ErrCodeWebIdentity will be used as an error code when constructing + // a new error to be returned during session creation or retrieval. + ErrCodeWebIdentity = "WebIdentityErr" + + // WebIdentityProviderName is the web identity provider name + WebIdentityProviderName = "WebIdentityCredentials" +) + +// now is used to return a time.Time object representing +// the current time. This can be used to easily test and +// compare test values. +var now = time.Now + +// WebIdentityRoleProvider is used to retrieve credentials using +// an OIDC token. +type WebIdentityRoleProvider struct { + credentials.Expiry + + client stsiface.STSAPI + ExpiryWindow time.Duration + + tokenFilePath string + roleARN string + roleSessionName string +} + +// NewWebIdentityCredentials will return a new set of credentials with a given +// configuration, role arn, and token file path. +func NewWebIdentityCredentials(c client.ConfigProvider, roleARN, roleSessionName, path string) *credentials.Credentials { + svc := sts.New(c) + p := NewWebIdentityRoleProvider(svc, roleARN, roleSessionName, path) + return credentials.NewCredentials(p) +} + +// NewWebIdentityRoleProvider will return a new WebIdentityRoleProvider with the +// provided stsiface.STSAPI +func NewWebIdentityRoleProvider(svc stsiface.STSAPI, roleARN, roleSessionName, path string) *WebIdentityRoleProvider { + return &WebIdentityRoleProvider{ + client: svc, + tokenFilePath: path, + roleARN: roleARN, + roleSessionName: roleSessionName, + } +} + +// Retrieve will attempt to assume a role from a token which is located at +// 'WebIdentityTokenFilePath' specified destination and if that is empty an +// error will be returned. +func (p *WebIdentityRoleProvider) Retrieve() (credentials.Value, error) { + b, err := ioutil.ReadFile(p.tokenFilePath) + if err != nil { + errMsg := fmt.Sprintf("unable to read file at %s", p.tokenFilePath) + return credentials.Value{}, awserr.New(ErrCodeWebIdentity, errMsg, err) + } + + sessionName := p.roleSessionName + if len(sessionName) == 0 { + // session name is used to uniquely identify a session. This simply + // uses unix time in nanoseconds to uniquely identify sessions. + sessionName = strconv.FormatInt(now().UnixNano(), 10) + } + req, resp := p.client.AssumeRoleWithWebIdentityRequest(&sts.AssumeRoleWithWebIdentityInput{ + RoleArn: &p.roleARN, + RoleSessionName: &sessionName, + WebIdentityToken: aws.String(string(b)), + }) + // InvalidIdentityToken error is a temporary error that can occur + // when assuming an Role with a JWT web identity token. + req.RetryErrorCodes = append(req.RetryErrorCodes, sts.ErrCodeInvalidIdentityTokenException) + if err := req.Send(); err != nil { + return credentials.Value{}, awserr.New(ErrCodeWebIdentity, "failed to retrieve credentials", err) + } + + p.SetExpiration(aws.TimeValue(resp.Credentials.Expiration), p.ExpiryWindow) + + value := credentials.Value{ + AccessKeyID: aws.StringValue(resp.Credentials.AccessKeyId), + SecretAccessKey: aws.StringValue(resp.Credentials.SecretAccessKey), + SessionToken: aws.StringValue(resp.Credentials.SessionToken), + ProviderName: WebIdentityProviderName, + } + return value, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go index 152d785b3..25a66d1dd 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go @@ -1,30 +1,61 @@ -// Package csm provides Client Side Monitoring (CSM) which enables sending metrics -// via UDP connection. Using the Start function will enable the reporting of -// metrics on a given port. If Start is called, with different parameters, again, -// a panic will occur. +// Package csm provides the Client Side Monitoring (CSM) client which enables +// sending metrics via UDP connection to the CSM agent. This package provides +// control options, and configuration for the CSM client. The client can be +// controlled manually, or automatically via the SDK's Session configuration. // -// Pause can be called to pause any metrics publishing on a given port. Sessions -// that have had their handlers modified via InjectHandlers may still be used. -// However, the handlers will act as a no-op meaning no metrics will be published. +// Enabling CSM client via SDK's Session configuration +// +// The CSM client can be enabled automatically via SDK's Session configuration. +// The SDK's session configuration enables the CSM client if the AWS_CSM_PORT +// environment variable is set to a non-empty value. +// +// The configuration options for the CSM client via the SDK's session +// configuration are: +// +// * AWS_CSM_PORT= +// The port number the CSM agent will receive metrics on. +// +// * AWS_CSM_HOST= +// The hostname, or IP address the CSM agent will receive metrics on. +// Without port number. +// +// Manually enabling the CSM client +// +// The CSM client can be started, paused, and resumed manually. The Start +// function will enable the CSM client to publish metrics to the CSM agent. It +// is safe to call Start concurrently, but if Start is called additional times +// with different ClientID or address it will panic. // -// Example: // r, err := csm.Start("clientID", ":31000") // if err != nil { // panic(fmt.Errorf("failed starting CSM: %v", err)) // } // +// When controlling the CSM client manually, you must also inject its request +// handlers into the SDK's Session configuration for the SDK's API clients to +// publish metrics. +// // sess, err := session.NewSession(&aws.Config{}) // if err != nil { // panic(fmt.Errorf("failed loading session: %v", err)) // } // +// // Add CSM client's metric publishing request handlers to the SDK's +// // Session Configuration. // r.InjectHandlers(&sess.Handlers) // -// client := s3.New(sess) -// resp, err := client.GetObject(&s3.GetObjectInput{ -// Bucket: aws.String("bucket"), -// Key: aws.String("key"), -// }) +// Controlling CSM client +// +// Once the CSM client has been enabled the Get function will return a Reporter +// value that you can use to pause and resume the metrics published to the CSM +// agent. If Get function is called before the reporter is enabled with the +// Start function or via SDK's Session configuration nil will be returned. +// +// The Pause method can be called to stop the CSM client publishing metrics to +// the CSM agent. The Continue method will resume metric publishing. +// +// // Get the CSM client Reporter. +// r := csm.Get() // // // Will pause monitoring // r.Pause() @@ -35,12 +66,4 @@ // // // Resume monitoring // r.Continue() -// -// Start returns a Reporter that is used to enable or disable monitoring. If -// access to the Reporter is required later, calling Get will return the Reporter -// singleton. -// -// Example: -// r := csm.Get() -// r.Continue() package csm diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go index 2f0c6eac9..4b19e2800 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go @@ -2,6 +2,7 @@ package csm import ( "fmt" + "strings" "sync" ) @@ -9,19 +10,40 @@ var ( lock sync.Mutex ) -// Client side metric handler names const ( - APICallMetricHandlerName = "awscsm.SendAPICallMetric" - APICallAttemptMetricHandlerName = "awscsm.SendAPICallAttemptMetric" + // DefaultPort is used when no port is specified. + DefaultPort = "31000" + + // DefaultHost is the host that will be used when none is specified. + DefaultHost = "127.0.0.1" ) -// Start will start the a long running go routine to capture +// AddressWithDefaults returns a CSM address built from the host and port +// values. If the host or port is not set, default values will be used +// instead. If host is "localhost" it will be replaced with "127.0.0.1". +func AddressWithDefaults(host, port string) string { + if len(host) == 0 || strings.EqualFold(host, "localhost") { + host = DefaultHost + } + + if len(port) == 0 { + port = DefaultPort + } + + // Only IP6 host can contain a colon + if strings.Contains(host, ":") { + return "[" + host + "]:" + port + } + + return host + ":" + port +} + +// Start will start a long running go routine to capture // client side metrics. Calling start multiple time will only // start the metric listener once and will panic if a different // client ID or port is passed in. // -// Example: -// r, err := csm.Start("clientID", "127.0.0.1:8094") +// r, err := csm.Start("clientID", "127.0.0.1:31000") // if err != nil { // panic(fmt.Errorf("expected no error, but received %v", err)) // } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go index 514fc3739..82a3e345e 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go @@ -16,25 +16,26 @@ var ( type metricChan struct { ch chan metric - paused int64 + paused *int64 } func newMetricChan(size int) metricChan { return metricChan{ - ch: make(chan metric, size), + ch: make(chan metric, size), + paused: new(int64), } } func (ch *metricChan) Pause() { - atomic.StoreInt64(&ch.paused, pausedEnum) + atomic.StoreInt64(ch.paused, pausedEnum) } func (ch *metricChan) Continue() { - atomic.StoreInt64(&ch.paused, runningEnum) + atomic.StoreInt64(ch.paused, runningEnum) } func (ch *metricChan) IsPaused() bool { - v := atomic.LoadInt64(&ch.paused) + v := atomic.LoadInt64(ch.paused) return v == pausedEnum } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go index d9aa5b062..c7008d8c3 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go @@ -10,11 +10,6 @@ import ( "github.com/aws/aws-sdk-go/aws/request" ) -const ( - // DefaultPort is used when no port is specified - DefaultPort = "31000" -) - // Reporter will gather metrics of API requests made and // send those metrics to the CSM endpoint. type Reporter struct { @@ -123,7 +118,7 @@ func (rep *Reporter) sendAPICallMetric(r *request.Request) { Type: aws.String("ApiCall"), AttemptCount: aws.Int(r.RetryCount + 1), Region: r.Config.Region, - Latency: aws.Int(int(time.Now().Sub(r.Time) / time.Millisecond)), + Latency: aws.Int(int(time.Since(r.Time) / time.Millisecond)), XAmzRequestID: aws.String(r.RequestID), MaxRetriesExceeded: aws.Int(boolIntValue(r.RetryCount >= r.MaxRetries())), } @@ -190,8 +185,9 @@ func (rep *Reporter) start() { } } -// Pause will pause the metric channel preventing any new metrics from -// being added. +// Pause will pause the metric channel preventing any new metrics from being +// added. It is safe to call concurrently with other calls to Pause, but if +// called concurently with Continue can lead to unexpected state. func (rep *Reporter) Pause() { lock.Lock() defer lock.Unlock() @@ -203,8 +199,9 @@ func (rep *Reporter) Pause() { rep.close() } -// Continue will reopen the metric channel and allow for monitoring -// to be resumed. +// Continue will reopen the metric channel and allow for monitoring to be +// resumed. It is safe to call concurrently with other calls to Continue, but +// if called concurently with Pause can lead to unexpected state. func (rep *Reporter) Continue() { lock.Lock() defer lock.Unlock() @@ -219,10 +216,18 @@ func (rep *Reporter) Continue() { rep.metricsCh.Continue() } +// Client side metric handler names +const ( + APICallMetricHandlerName = "awscsm.SendAPICallMetric" + APICallAttemptMetricHandlerName = "awscsm.SendAPICallAttemptMetric" +) + // InjectHandlers will will enable client side metrics and inject the proper // handlers to handle how metrics are sent. // -// Example: +// InjectHandlers is NOT safe to call concurrently. Calling InjectHandlers +// multiple times may lead to unexpected behavior, (e.g. duplicate metrics). +// // // Start must be called in order to inject the correct handlers // r, err := csm.Start("clientID", "127.0.0.1:8094") // if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go index 2c8d5f56d..d126764ce 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -152,18 +152,19 @@ type EC2IAMInfo struct { // An EC2InstanceIdentityDocument provides the shape for unmarshaling // an instance identity document type EC2InstanceIdentityDocument struct { - DevpayProductCodes []string `json:"devpayProductCodes"` - AvailabilityZone string `json:"availabilityZone"` - PrivateIP string `json:"privateIp"` - Version string `json:"version"` - Region string `json:"region"` - InstanceID string `json:"instanceId"` - BillingProducts []string `json:"billingProducts"` - InstanceType string `json:"instanceType"` - AccountID string `json:"accountId"` - PendingTime time.Time `json:"pendingTime"` - ImageID string `json:"imageId"` - KernelID string `json:"kernelId"` - RamdiskID string `json:"ramdiskId"` - Architecture string `json:"architecture"` + DevpayProductCodes []string `json:"devpayProductCodes"` + MarketplaceProductCodes []string `json:"marketplaceProductCodes"` + AvailabilityZone string `json:"availabilityZone"` + PrivateIP string `json:"privateIp"` + Version string `json:"version"` + Region string `json:"region"` + InstanceID string `json:"instanceId"` + BillingProducts []string `json:"billingProducts"` + InstanceType string `json:"instanceType"` + AccountID string `json:"accountId"` + PendingTime time.Time `json:"pendingTime"` + ImageID string `json:"imageId"` + KernelID string `json:"kernelId"` + RamdiskID string `json:"ramdiskId"` + Architecture string `json:"architecture"` } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go index f0c1d31e7..4c5636e35 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go @@ -123,7 +123,7 @@ func unmarshalHandler(r *request.Request) { defer r.HTTPResponse.Body.Close() b := &bytes.Buffer{} if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata respose", err) + r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata response", err) return } @@ -136,7 +136,7 @@ func unmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() b := &bytes.Buffer{} if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error respose", err) + r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error response", err) return } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 14e32bc42..452cefda6 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -11,6 +11,8 @@ const ( AwsPartitionID = "aws" // AWS Standard partition. AwsCnPartitionID = "aws-cn" // AWS China partition. AwsUsGovPartitionID = "aws-us-gov" // AWS GovCloud (US) partition. + AwsIsoPartitionID = "aws-iso" // AWS ISO (US) partition. + AwsIsoBPartitionID = "aws-iso-b" // AWS ISOB (US) partition. ) // AWS Standard partition's regions. @@ -27,6 +29,7 @@ const ( EuWest1RegionID = "eu-west-1" // EU (Ireland). EuWest2RegionID = "eu-west-2" // EU (London). EuWest3RegionID = "eu-west-3" // EU (Paris). + MeSouth1RegionID = "me-south-1" // Middle East (Bahrain). SaEast1RegionID = "sa-east-1" // South America (Sao Paulo). UsEast1RegionID = "us-east-1" // US East (N. Virginia). UsEast2RegionID = "us-east-2" // US East (Ohio). @@ -46,8 +49,18 @@ const ( UsGovWest1RegionID = "us-gov-west-1" // AWS GovCloud (US). ) +// AWS ISO (US) partition's regions. +const ( + UsIsoEast1RegionID = "us-iso-east-1" // US ISO East. +) + +// AWS ISOB (US) partition's regions. +const ( + UsIsobEast1RegionID = "us-isob-east-1" // US ISOB East (Ohio). +) + // DefaultResolver returns an Endpoint resolver that will be able -// to resolve endpoints for: AWS Standard, AWS China, and AWS GovCloud (US). +// to resolve endpoints for: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // // Use DefaultPartitions() to get the list of the default partitions. func DefaultResolver() Resolver { @@ -55,7 +68,7 @@ func DefaultResolver() Resolver { } // DefaultPartitions returns a list of the partitions the SDK is bundled -// with. The available partitions are: AWS Standard, AWS China, and AWS GovCloud (US). +// with. The available partitions are: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // // partitions := endpoints.DefaultPartitions // for _, p := range partitions { @@ -69,6 +82,8 @@ var defaultPartitions = partitions{ awsPartition, awscnPartition, awsusgovPartition, + awsisoPartition, + awsisobPartition, } // AwsPartition returns the Resolver for AWS Standard. @@ -82,7 +97,7 @@ var awsPartition = partition{ DNSSuffix: "amazonaws.com", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$") + reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$") return reg }(), }, @@ -128,6 +143,9 @@ var awsPartition = partition{ "eu-west-3": region{ Description: "EU (Paris)", }, + "me-south-1": region{ + Description: "Middle East (Bahrain)", + }, "sa-east-1": region{ Description: "South America (Sao Paulo)", }, @@ -166,6 +184,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -178,6 +197,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -270,6 +290,12 @@ var awsPartition = partition{ Region: "eu-west-3", }, }, + "me-south-1": endpoint{ + Hostname: "api.ecr.me-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "me-south-1", + }, + }, "sa-east-1": endpoint{ Hostname: "api.ecr.sa-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -308,6 +334,7 @@ var awsPartition = partition{ "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, @@ -327,6 +354,7 @@ var awsPartition = partition{ "api.sagemaker": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -334,8 +362,11 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "api-fips.sagemaker.us-east-1.amazonaws.com", @@ -381,6 +412,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -409,6 +441,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -471,6 +504,7 @@ var awsPartition = partition{ "athena": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -478,6 +512,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "us-east-1": endpoint{}, @@ -502,6 +537,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -533,9 +569,27 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "backup": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "batch": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -547,6 +601,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -638,6 +693,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -693,6 +749,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -729,6 +786,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -739,6 +797,7 @@ var awsPartition = partition{ "codebuild": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -750,6 +809,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -791,6 +851,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -822,6 +883,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -863,6 +925,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -959,10 +1022,13 @@ var awsPartition = partition{ "comprehendmedical": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "config": service{ @@ -980,6 +1046,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -987,6 +1054,16 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "connect": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "cur": service{ Endpoints: endpoints{ @@ -1025,10 +1102,35 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "datasync-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "datasync-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "datasync-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "datasync-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "dax": service{ @@ -1056,6 +1158,7 @@ var awsPartition = partition{ "directconnect": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1067,6 +1170,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1095,6 +1199,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1117,6 +1222,12 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "ap-southeast-2": endpoint{ + Hostname: "rds.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, "eu-central-1": endpoint{ Hostname: "rds.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1129,6 +1240,12 @@ var awsPartition = partition{ Region: "eu-west-1", }, }, + "eu-west-2": endpoint{ + Hostname: "rds.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1159,6 +1276,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "sa-east-1": endpoint{}, @@ -1180,11 +1298,17 @@ var awsPartition = partition{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, + "ca-central-1-fips": endpoint{ + Hostname: "dynamodb-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "local": endpoint{ Hostname: "localhost:8000", Protocols: []string{"http"}, @@ -1192,11 +1316,36 @@ var awsPartition = partition{ Region: "us-east-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "dynamodb-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "dynamodb-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "dynamodb-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "dynamodb-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "ec2": service{ @@ -1216,6 +1365,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1249,6 +1399,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1277,11 +1428,12 @@ var awsPartition = partition{ Region: "us-west-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "elasticbeanstalk": service{ @@ -1299,6 +1451,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1311,12 +1464,14 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -1340,6 +1495,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1367,6 +1523,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "{service}.{region}.{dnsSuffix}", @@ -1431,11 +1588,12 @@ var awsPartition = partition{ Region: "us-west-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "events": service{ @@ -1453,6 +1611,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1463,6 +1622,7 @@ var awsPartition = partition{ "firehose": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1503,10 +1663,15 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -1546,6 +1711,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1556,6 +1722,7 @@ var awsPartition = partition{ "glue": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1563,9 +1730,12 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -1579,19 +1749,32 @@ var awsPartition = partition{ }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, + "groundstation": service{ + + Endpoints: endpoints{ + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "guardduty": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1603,11 +1786,36 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "guardduty-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "guardduty-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "guardduty-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "guardduty-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "health": service{ @@ -1652,7 +1860,9 @@ var awsPartition = partition{ "ap-south-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -1665,45 +1875,6 @@ var awsPartition = partition{ Service: "execute-api", }, }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "iotanalytics": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "kafka": service{ - - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "kinesis": service{ - Endpoints: endpoints{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, @@ -1717,6 +1888,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1724,22 +1896,18 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "kinesisanalytics": service{ + "iotanalytics": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, - "kinesisvideo": service{ + "iotevents": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, @@ -1747,30 +1915,157 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, - "kms": service{ + "ioteventsdata": service{ Endpoints: endpoints{ - "ProdFips": endpoint{ - Hostname: "kms-fips.ca-central-1.amazonaws.com", + "ap-northeast-1": endpoint{ + Hostname: "data.iotevents.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ - Region: "ca-central-1", + Region: "ap-northeast-1", }, }, - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, + "ap-southeast-2": endpoint{ + Hostname: "data.iotevents.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "eu-central-1": endpoint{ + Hostname: "data.iotevents.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "data.iotevents.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "us-east-1": endpoint{ + Hostname: "data.iotevents.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "data.iotevents.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "data.iotevents.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "iotthingsgraph": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "iotthingsgraph", + }, + }, + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "kafka": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "kinesis": service{ + + Endpoints: endpoints{ + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "kinesisanalytics": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "kinesisvideo": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "kms": service{ + + Endpoints: endpoints{ + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1778,6 +2073,16 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "lakeformation": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "lambda": service{ Endpoints: endpoints{ @@ -1793,6 +2098,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1803,6 +2109,7 @@ var awsPartition = partition{ "license-manager": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1814,6 +2121,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1854,6 +2162,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1883,6 +2192,7 @@ var awsPartition = partition{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -1922,6 +2232,7 @@ var awsPartition = partition{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, @@ -1938,6 +2249,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, @@ -1977,6 +2289,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2025,6 +2338,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2037,11 +2351,14 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -2097,6 +2414,12 @@ var awsPartition = partition{ Region: "eu-central-1", }, }, + "eu-north-1": endpoint{ + Hostname: "rds.eu-north-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-north-1", + }, + }, "eu-west-1": endpoint{ Hostname: "rds.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2224,6 +2547,16 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "qldb": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "ram": service{ Endpoints: endpoints{ @@ -2234,6 +2567,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2258,6 +2592,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "{service}.{dnsSuffix}", @@ -2282,6 +2617,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2295,10 +2631,14 @@ var awsPartition = partition{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2317,19 +2657,47 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "resource-groups-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "resource-groups-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "resource-groups-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "resource-groups-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "robomaker": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2388,6 +2756,7 @@ var awsPartition = partition{ "runtime.sagemaker": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2395,12 +2764,39 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "runtime-fips.sagemaker.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "runtime-fips.sagemaker.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "runtime-fips.sagemaker.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "runtime-fips.sagemaker.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "s3": service{ @@ -2436,8 +2832,9 @@ var awsPartition = partition{ Hostname: "s3.eu-west-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "s3-external-1": endpoint{ Hostname: "s3-external-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, @@ -2681,6 +3078,7 @@ var awsPartition = partition{ "securityhub": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2688,6 +3086,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2801,6 +3200,7 @@ var awsPartition = partition{ "servicediscovery": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2808,9 +3208,11 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2818,6 +3220,16 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "session.qldb": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "shield": service{ IsRegionalized: boxedFalse, Defaults: endpoint{ @@ -2831,6 +3243,7 @@ var awsPartition = partition{ "sms": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2842,6 +3255,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2853,6 +3267,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2885,6 +3300,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2934,7 +3350,8 @@ var awsPartition = partition{ Region: "us-west-2", }, }, - "sa-east-1": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{ SSLCommonName: "queue.{dnsSuffix}", }, @@ -2958,6 +3375,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2980,6 +3398,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2990,6 +3409,7 @@ var awsPartition = partition{ "storagegateway": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -3001,6 +3421,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3022,11 +3443,17 @@ var awsPartition = partition{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, + "ca-central-1-fips": endpoint{ + Hostname: "dynamodb-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "local": endpoint{ Hostname: "localhost:8000", Protocols: []string{"http"}, @@ -3034,13 +3461,38 @@ var awsPartition = partition{ Region: "us-east-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "dynamodb-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "dynamodb-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "dynamodb-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "dynamodb-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, "sts": service{ PartitionEndpoint: "aws-global", Defaults: endpoint{ @@ -3073,8 +3525,14 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, + "me-south-1": endpoint{ + Hostname: "sts.me-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "me-south-1", + }, + }, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "sts-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -3105,9 +3563,15 @@ var awsPartition = partition{ }, }, "support": service{ + PartitionEndpoint: "aws-global", Endpoints: endpoints{ - "us-east-1": endpoint{}, + "aws-global": endpoint{ + Hostname: "support.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, }, }, "swf": service{ @@ -3125,6 +3589,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3147,6 +3612,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3164,9 +3630,11 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -3226,12 +3694,16 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -3278,6 +3750,7 @@ var awsPartition = partition{ "xray": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -3289,6 +3762,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3554,6 +4028,15 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "greengrass": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, "iam": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, @@ -3574,7 +4057,8 @@ var awscnPartition = partition{ }, }, Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, }, }, "kinesis": service{ @@ -3584,6 +4068,13 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "kms": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "lambda": service{ Endpoints: endpoints{ @@ -3591,6 +4082,13 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "license-manager": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "logs": service{ Endpoints: endpoints{ @@ -3741,6 +4239,18 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "support": service{ + PartitionEndpoint: "aws-cn-global", + + Endpoints: endpoints{ + "aws-cn-global": endpoint{ + Hostname: "support.cn-north-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "cn-north-1", + }, + }, + }, + }, "swf": service{ Endpoints: endpoints{ @@ -3898,9 +4408,17 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "codebuild": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "codecommit": service{ Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -3938,6 +4456,18 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "datasync": service{ + + Endpoints: endpoints{ + "fips-us-gov-west-1": endpoint{ + Hostname: "datasync-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-west-1": endpoint{}, + }, + }, "directconnect": service{ Endpoints: endpoints{ @@ -3963,6 +4493,12 @@ var awsusgovPartition = partition{ Endpoints: endpoints{ "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "dynamodb.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "dynamodb.us-gov-west-1.amazonaws.com", @@ -4064,6 +4600,7 @@ var awsusgovPartition = partition{ "firehose": service{ Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -4078,6 +4615,16 @@ var awsusgovPartition = partition{ }, "glue": service{ + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "greengrass": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, Endpoints: endpoints{ "us-gov-west-1": endpoint{}, }, @@ -4091,6 +4638,12 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "health": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "iam": service{ PartitionEndpoint: "aws-us-gov-global", IsRegionalized: boxedFalse, @@ -4175,6 +4728,7 @@ var awsusgovPartition = partition{ }, }, Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -4185,6 +4739,23 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "neptune": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Hostname: "rds.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "rds.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "organizations": service{ PartitionEndpoint: "aws-us-gov-global", IsRegionalized: boxedFalse, @@ -4204,6 +4775,13 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "ram": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "rds": service{ Endpoints: endpoints{ @@ -4224,6 +4802,19 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "route53": service{ + PartitionEndpoint: "aws-us-gov-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-us-gov-global": endpoint{ + Hostname: "route53.us-gov.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "runtime.sagemaker": service{ Endpoints: endpoints{ @@ -4287,6 +4878,43 @@ var awsusgovPartition = partition{ }, }, }, + "secretsmanager": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "serverlessrepo": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Protocols: []string{"https"}, + }, + "us-gov-west-1": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + "servicecatalog": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "servicecatalog-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "sms": service{ Endpoints: endpoints{ @@ -4348,6 +4976,12 @@ var awsusgovPartition = partition{ }, Endpoints: endpoints{ "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "dynamodb.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "dynamodb.us-gov-west-1.amazonaws.com", @@ -4406,3 +5040,612 @@ var awsusgovPartition = partition{ }, }, } + +// AwsIsoPartition returns the Resolver for AWS ISO (US). +func AwsIsoPartition() Partition { + return awsisoPartition.Partition() +} + +var awsisoPartition = partition{ + ID: "aws-iso", + Name: "AWS ISO (US)", + DNSSuffix: "c2s.ic.gov", + RegionRegex: regionRegex{ + Regexp: func() *regexp.Regexp { + reg, _ := regexp.Compile("^us\\-iso\\-\\w+\\-\\d+$") + return reg + }(), + }, + Defaults: endpoint{ + Hostname: "{service}.{region}.{dnsSuffix}", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + Regions: regions{ + "us-iso-east-1": region{ + Description: "US ISO East", + }, + }, + Services: services{ + "api.ecr": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Hostname: "api.ecr.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "application-autoscaling": service{ + Defaults: endpoint{ + Hostname: "autoscaling.{region}.amazonaws.com", + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "application-autoscaling", + }, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "autoscaling": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "cloudformation": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "cloudtrail": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "codedeploy": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "config": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "datapipeline": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "directconnect": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "dms": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "ds": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "dynamodb": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "ec2": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "ec2metadata": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "169.254.169.254/latest", + Protocols: []string{"http"}, + }, + }, + }, + "ecs": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "elasticache": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "elasticloadbalancing": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "elasticmapreduce": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + "events": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "glacier": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "health": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "iam": service{ + PartitionEndpoint: "aws-iso-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-global": endpoint{ + Hostname: "iam.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "kinesis": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "kms": service{ + + Endpoints: endpoints{ + "ProdFips": endpoint{ + Hostname: "kms-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + "us-iso-east-1": endpoint{}, + }, + }, + "lambda": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "logs": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "monitoring": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "rds": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "redshift": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "route53": service{ + PartitionEndpoint: "aws-iso-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-global": endpoint{ + Hostname: "route53.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "s3": service{ + Defaults: endpoint{ + SignatureVersions: []string{"s3v4"}, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, + }, + }, + }, + "snowball": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "sns": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "sqs": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "states": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "streams.dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "dynamodb", + }, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "sts": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "support": service{ + PartitionEndpoint: "aws-iso-global", + + Endpoints: endpoints{ + "aws-iso-global": endpoint{ + Hostname: "support.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "swf": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "workspaces": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + }, +} + +// AwsIsoBPartition returns the Resolver for AWS ISOB (US). +func AwsIsoBPartition() Partition { + return awsisobPartition.Partition() +} + +var awsisobPartition = partition{ + ID: "aws-iso-b", + Name: "AWS ISOB (US)", + DNSSuffix: "sc2s.sgov.gov", + RegionRegex: regionRegex{ + Regexp: func() *regexp.Regexp { + reg, _ := regexp.Compile("^us\\-isob\\-\\w+\\-\\d+$") + return reg + }(), + }, + Defaults: endpoint{ + Hostname: "{service}.{region}.{dnsSuffix}", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + Regions: regions{ + "us-isob-east-1": region{ + Description: "US ISOB East (Ohio)", + }, + }, + Services: services{ + "application-autoscaling": service{ + Defaults: endpoint{ + Hostname: "autoscaling.{region}.amazonaws.com", + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "application-autoscaling", + }, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "autoscaling": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "cloudformation": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "cloudtrail": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "config": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "directconnect": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "dms": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "ec2": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "ec2metadata": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "169.254.169.254/latest", + Protocols: []string{"http"}, + }, + }, + }, + "elasticache": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "elasticloadbalancing": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + "elasticmapreduce": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "events": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "glacier": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "health": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "iam": service{ + PartitionEndpoint: "aws-iso-b-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-b-global": endpoint{ + Hostname: "iam.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + }, + }, + "kinesis": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "kms": service{ + + Endpoints: endpoints{ + "ProdFips": endpoint{ + Hostname: "kms-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + "us-isob-east-1": endpoint{}, + }, + }, + "logs": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "monitoring": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "rds": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "redshift": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "s3": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "snowball": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "sns": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "sqs": service{ + Defaults: endpoint{ + SSLCommonName: "{region}.queue.{dnsSuffix}", + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "states": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "streams.dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "dynamodb", + }, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "sts": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "support": service{ + PartitionEndpoint: "aws-iso-b-global", + + Endpoints: endpoints{ + "aws-iso-b-global": endpoint{ + Hostname: "support.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + }, + }, + "swf": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go index f82babf6f..9c936be6c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go @@ -170,10 +170,13 @@ func PartitionForRegion(ps []Partition, regionID string) (Partition, bool) { // A Partition provides the ability to enumerate the partition's regions // and services. type Partition struct { - id string - p *partition + id, dnsSuffix string + p *partition } +// DNSSuffix returns the base domain name of the partition. +func (p Partition) DNSSuffix() string { return p.dnsSuffix } + // ID returns the identifier of the partition. func (p Partition) ID() string { return p.id } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go index ff6f76db6..523ad79ac 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go @@ -54,8 +54,9 @@ type partition struct { func (p partition) Partition() Partition { return Partition{ - id: p.ID, - p: &p, + dnsSuffix: p.DNSSuffix, + id: p.ID, + p: &p, } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go index 271da432c..d9b37f4d3 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go @@ -1,18 +1,17 @@ -// +build !appengine,!plan9 - package request import ( - "net" - "os" - "syscall" + "strings" ) func isErrConnectionReset(err error) bool { - if opErr, ok := err.(*net.OpError); ok { - if sysErr, ok := opErr.Err.(*os.SyscallError); ok { - return sysErr.Err == syscall.ECONNRESET - } + if strings.Contains(err.Error(), "read: connection reset") { + return false + } + + if strings.Contains(err.Error(), "connection reset") || + strings.Contains(err.Error(), "broken pipe") { + return true } return false diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go deleted file mode 100644 index daf9eca43..000000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build appengine plan9 - -package request - -import ( - "strings" -) - -func isErrConnectionReset(err error) bool { - return strings.Contains(err.Error(), "connection reset") -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go index 8ef8548a9..185b07318 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go @@ -23,7 +23,7 @@ type Handlers struct { Complete HandlerList } -// Copy returns of this handler's lists. +// Copy returns a copy of this handler's lists. func (h *Handlers) Copy() Handlers { return Handlers{ Validate: h.Validate.copy(), @@ -42,7 +42,7 @@ func (h *Handlers) Copy() Handlers { } } -// Clear removes callback functions for all handlers +// Clear removes callback functions for all handlers. func (h *Handlers) Clear() { h.Validate.Clear() h.Build.Clear() @@ -59,6 +59,51 @@ func (h *Handlers) Clear() { h.Complete.Clear() } +// IsEmpty returns if there are no handlers in any of the handlerlists. +func (h *Handlers) IsEmpty() bool { + if h.Validate.Len() != 0 { + return false + } + if h.Build.Len() != 0 { + return false + } + if h.Send.Len() != 0 { + return false + } + if h.Sign.Len() != 0 { + return false + } + if h.Unmarshal.Len() != 0 { + return false + } + if h.UnmarshalStream.Len() != 0 { + return false + } + if h.UnmarshalMeta.Len() != 0 { + return false + } + if h.UnmarshalError.Len() != 0 { + return false + } + if h.ValidateResponse.Len() != 0 { + return false + } + if h.Retry.Len() != 0 { + return false + } + if h.AfterRetry.Len() != 0 { + return false + } + if h.CompleteAttempt.Len() != 0 { + return false + } + if h.Complete.Len() != 0 { + return false + } + + return true +} + // A HandlerListRunItem represents an entry in the HandlerList which // is being run. type HandlerListRunItem struct { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go index b0c2ef4fe..9370fa50c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go @@ -15,12 +15,15 @@ type offsetReader struct { closed bool } -func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader { +func newOffsetReader(buf io.ReadSeeker, offset int64) (*offsetReader, error) { reader := &offsetReader{} - buf.Seek(offset, sdkio.SeekStart) + _, err := buf.Seek(offset, sdkio.SeekStart) + if err != nil { + return nil, err + } reader.buf = buf - return reader + return reader, nil } // Close will close the instance of the offset reader's access to @@ -54,7 +57,9 @@ func (o *offsetReader) Seek(offset int64, whence int) (int64, error) { // CloseAndCopy will return a new offsetReader with a copy of the old buffer // and close the old buffer. -func (o *offsetReader) CloseAndCopy(offset int64) *offsetReader { - o.Close() +func (o *offsetReader) CloseAndCopy(offset int64) (*offsetReader, error) { + if err := o.Close(); err != nil { + return nil, err + } return newOffsetReader(o.buf, offset) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go index 19da3fcd8..8e332cce6 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go @@ -64,6 +64,15 @@ type Request struct { LastSignedAt time.Time DisableFollowRedirects bool + // Additional API error codes that should be retried. IsErrorRetryable + // will consider these codes in addition to its built in cases. + RetryErrorCodes []string + + // Additional API error codes that should be retried with throttle backoff + // delay. IsErrorThrottle will consider these codes in addition to its + // built in cases. + ThrottleErrorCodes []string + // A value greater than 0 instructs the request to be signed as Presigned URL // You should not set this field directly. Instead use Request's // Presign or PresignRequest methods. @@ -231,6 +240,10 @@ func (r *Request) WillRetry() bool { return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() } +func fmtAttemptCount(retryCount, maxRetries int) string { + return fmt.Sprintf("attempt %v/%v", retryCount, maxRetries) +} + // ParamsFilled returns if the request's parameters have been populated // and the parameters are valid. False is returned if no parameters are // provided or invalid. @@ -259,7 +272,18 @@ func (r *Request) SetStringBody(s string) { // SetReaderBody will set the request's body reader. func (r *Request) SetReaderBody(reader io.ReadSeeker) { r.Body = reader - r.BodyStart, _ = reader.Seek(0, sdkio.SeekCurrent) // Get the Bodies current offset. + + if aws.IsReaderSeekable(reader) { + var err error + // Get the Bodies current offset so retries will start from the same + // initial position. + r.BodyStart, err = reader.Seek(0, sdkio.SeekCurrent) + if err != nil { + r.Error = awserr.New(ErrCodeSerialization, + "failed to determine start of request body", err) + return + } + } r.ResetBody() } @@ -330,16 +354,15 @@ func getPresignedURL(r *Request, expire time.Duration) (string, http.Header, err return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil } -func debugLogReqError(r *Request, stage string, retrying bool, err error) { +const ( + notRetrying = "not retrying" +) + +func debugLogReqError(r *Request, stage, retryStr string, err error) { if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) { return } - retryStr := "not retrying" - if retrying { - retryStr = "will retry" - } - r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v", stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err)) } @@ -358,12 +381,12 @@ func (r *Request) Build() error { if !r.built { r.Handlers.Validate.Run(r) if r.Error != nil { - debugLogReqError(r, "Validate Request", false, r.Error) + debugLogReqError(r, "Validate Request", notRetrying, r.Error) return r.Error } r.Handlers.Build.Run(r) if r.Error != nil { - debugLogReqError(r, "Build Request", false, r.Error) + debugLogReqError(r, "Build Request", notRetrying, r.Error) return r.Error } r.built = true @@ -379,7 +402,7 @@ func (r *Request) Build() error { func (r *Request) Sign() error { r.Build() if r.Error != nil { - debugLogReqError(r, "Build Request", false, r.Error) + debugLogReqError(r, "Build Request", notRetrying, r.Error) return r.Error } @@ -387,12 +410,16 @@ func (r *Request) Sign() error { return r.Error } -func (r *Request) getNextRequestBody() (io.ReadCloser, error) { +func (r *Request) getNextRequestBody() (body io.ReadCloser, err error) { if r.safeBody != nil { r.safeBody.Close() } - r.safeBody = newOffsetReader(r.Body, r.BodyStart) + r.safeBody, err = newOffsetReader(r.Body, r.BodyStart) + if err != nil { + return nil, awserr.New(ErrCodeSerialization, + "failed to get next request body reader", err) + } // Go 1.8 tightened and clarified the rules code needs to use when building // requests with the http package. Go 1.8 removed the automatic detection @@ -409,10 +436,10 @@ func (r *Request) getNextRequestBody() (io.ReadCloser, error) { // Related golang/go#18257 l, err := aws.SeekerLen(r.Body) if err != nil { - return nil, awserr.New(ErrCodeSerialization, "failed to compute request body size", err) + return nil, awserr.New(ErrCodeSerialization, + "failed to compute request body size", err) } - var body io.ReadCloser if l == 0 { body = NoBody } else if l > 0 { @@ -473,29 +500,28 @@ func (r *Request) Send() error { r.AttemptTime = time.Now() if err := r.Sign(); err != nil { - debugLogReqError(r, "Sign Request", false, err) + debugLogReqError(r, "Sign Request", notRetrying, err) return err } if err := r.sendRequest(); err == nil { return nil - } else if !shouldRetryCancel(r.Error) { - return err - } else { - r.Handlers.Retry.Run(r) - r.Handlers.AfterRetry.Run(r) + } + r.Handlers.Retry.Run(r) + r.Handlers.AfterRetry.Run(r) - if r.Error != nil || !aws.BoolValue(r.Retryable) { - return r.Error - } + if r.Error != nil || !aws.BoolValue(r.Retryable) { + return r.Error + } - r.prepareRetry() - continue + if err := r.prepareRetry(); err != nil { + r.Error = err + return err } } } -func (r *Request) prepareRetry() { +func (r *Request) prepareRetry() error { if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) @@ -506,12 +532,19 @@ func (r *Request) prepareRetry() { // the request's body even though the Client's Do returned. r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil) r.ResetBody() + if err := r.Error; err != nil { + return awserr.New(ErrCodeSerialization, + "failed to prepare body for retry", err) + + } // Closing response body to ensure that no response body is leaked // between retry attempts. if r.HTTPResponse != nil && r.HTTPResponse.Body != nil { r.HTTPResponse.Body.Close() } + + return nil } func (r *Request) sendRequest() (sendErr error) { @@ -520,7 +553,9 @@ func (r *Request) sendRequest() (sendErr error) { r.Retryable = nil r.Handlers.Send.Run(r) if r.Error != nil { - debugLogReqError(r, "Send Request", r.WillRetry(), r.Error) + debugLogReqError(r, "Send Request", + fmtAttemptCount(r.RetryCount, r.MaxRetries()), + r.Error) return r.Error } @@ -528,13 +563,17 @@ func (r *Request) sendRequest() (sendErr error) { r.Handlers.ValidateResponse.Run(r) if r.Error != nil { r.Handlers.UnmarshalError.Run(r) - debugLogReqError(r, "Validate Response", r.WillRetry(), r.Error) + debugLogReqError(r, "Validate Response", + fmtAttemptCount(r.RetryCount, r.MaxRetries()), + r.Error) return r.Error } r.Handlers.Unmarshal.Run(r) if r.Error != nil { - debugLogReqError(r, "Unmarshal Response", r.WillRetry(), r.Error) + debugLogReqError(r, "Unmarshal Response", + fmtAttemptCount(r.RetryCount, r.MaxRetries()), + r.Error) return r.Error } @@ -561,48 +600,6 @@ func AddToUserAgent(r *Request, s string) { r.HTTPRequest.Header.Set("User-Agent", s) } -type temporary interface { - Temporary() bool -} - -func shouldRetryCancel(err error) bool { - switch err := err.(type) { - case awserr.Error: - if err.Code() == CanceledErrorCode { - return false - } - return shouldRetryCancel(err.OrigErr()) - case *url.Error: - if strings.Contains(err.Error(), "connection refused") { - // Refused connections should be retried as the service may not yet - // be running on the port. Go TCP dial considers refused - // connections as not temporary. - return true - } - // *url.Error only implements Temporary after golang 1.6 but since - // url.Error only wraps the error: - return shouldRetryCancel(err.Err) - case temporary: - // If the error is temporary, we want to allow continuation of the - // retry process - return err.Temporary() - case nil: - // `awserr.Error.OrigErr()` can be nil, meaning there was an error but - // because we don't know the cause, it is marked as retryable. See - // TestRequest4xxUnretryable for an example. - return true - default: - switch err.Error() { - case "net/http: request canceled", - "net/http: request canceled while waiting for connection": - // known 1.5 error case when an http request is cancelled - return false - } - // here we don't know the error; so we allow a retry. - return true - } -} - // SanitizeHostForHeader removes default port from host and updates request.Host func SanitizeHostForHeader(r *http.Request) { host := getHost(r) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go index 7c6a8000f..de1292f45 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go @@ -4,6 +4,8 @@ package request import ( "net/http" + + "github.com/aws/aws-sdk-go/aws/awserr" ) // NoBody is a http.NoBody reader instructing Go HTTP client to not include @@ -24,7 +26,8 @@ var NoBody = http.NoBody func (r *Request) ResetBody() { body, err := r.getNextRequestBody() if err != nil { - r.Error = err + r.Error = awserr.New(ErrCodeSerialization, + "failed to reset request body", err) return } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go index a633ed5ac..f093fc542 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go @@ -146,7 +146,7 @@ func (r *Request) nextPageTokens() []interface{} { return nil } case bool: - if v == false { + if !v { return nil } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go index d0aa54c6d..e84084da5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go @@ -1,23 +1,41 @@ package request import ( + "net" + "net/url" + "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" ) -// Retryer is an interface to control retry logic for a given service. -// The default implementation used by most services is the client.DefaultRetryer -// structure, which contains basic retry logic using exponential backoff. +// Retryer provides the interface drive the SDK's request retry behavior. The +// Retryer implementation is responsible for implementing exponential backoff, +// and determine if a request API error should be retried. +// +// client.DefaultRetryer is the SDK's default implementation of the Retryer. It +// uses the which uses the Request.IsErrorRetryable and Request.IsErrorThrottle +// methods to determine if the request is retried. type Retryer interface { + // RetryRules return the retry delay that should be used by the SDK before + // making another request attempt for the failed request. RetryRules(*Request) time.Duration + + // ShouldRetry returns if the failed request is retryable. + // + // Implementations may consider request attempt count when determining if a + // request is retryable, but the SDK will use MaxRetries to limit the + // number of attempts a request are made. ShouldRetry(*Request) bool + + // MaxRetries is the number of times a request may be retried before + // failing. MaxRetries() int } -// WithRetryer sets a config Retryer value to the given Config returning it -// for chaining. +// WithRetryer sets a Retryer value to the given Config returning the Config +// value for chaining. func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { cfg.Retryer = retryer return cfg @@ -76,10 +94,6 @@ var validParentCodes = map[string]struct{}{ ErrCodeRead: {}, } -type temporaryError interface { - Temporary() bool -} - func isNestedErrorRetryable(parentErr awserr.Error) bool { if parentErr == nil { return false @@ -98,7 +112,7 @@ func isNestedErrorRetryable(parentErr awserr.Error) bool { return isCodeRetryable(aerr.Code()) } - if t, ok := err.(temporaryError); ok { + if t, ok := err.(temporary); ok { return t.Temporary() || isErrConnectionReset(err) } @@ -108,32 +122,90 @@ func isNestedErrorRetryable(parentErr awserr.Error) bool { // IsErrorRetryable returns whether the error is retryable, based on its Code. // Returns false if error is nil. func IsErrorRetryable(err error) bool { - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - return isCodeRetryable(aerr.Code()) || isNestedErrorRetryable(aerr) + if err == nil { + return false + } + return shouldRetryError(err) +} + +type temporary interface { + Temporary() bool +} + +func shouldRetryError(origErr error) bool { + switch err := origErr.(type) { + case awserr.Error: + if err.Code() == CanceledErrorCode { + return false + } + if isNestedErrorRetryable(err) { + return true + } + + origErr := err.OrigErr() + var shouldRetry bool + if origErr != nil { + shouldRetry := shouldRetryError(origErr) + if err.Code() == "RequestError" && !shouldRetry { + return false + } + } + if isCodeRetryable(err.Code()) { + return true + } + return shouldRetry + + case *url.Error: + if strings.Contains(err.Error(), "connection refused") { + // Refused connections should be retried as the service may not yet + // be running on the port. Go TCP dial considers refused + // connections as not temporary. + return true + } + // *url.Error only implements Temporary after golang 1.6 but since + // url.Error only wraps the error: + return shouldRetryError(err.Err) + + case temporary: + if netErr, ok := err.(*net.OpError); ok && netErr.Op == "dial" { + return true } + // If the error is temporary, we want to allow continuation of the + // retry process + return err.Temporary() || isErrConnectionReset(origErr) + + case nil: + // `awserr.Error.OrigErr()` can be nil, meaning there was an error but + // because we don't know the cause, it is marked as retryable. See + // TestRequest4xxUnretryable for an example. + return true + + default: + switch err.Error() { + case "net/http: request canceled", + "net/http: request canceled while waiting for connection": + // known 1.5 error case when an http request is cancelled + return false + } + // here we don't know the error; so we allow a retry. + return true } - return false } // IsErrorThrottle returns whether the error is to be throttled based on its code. // Returns false if error is nil. func IsErrorThrottle(err error) bool { - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - return isCodeThrottle(aerr.Code()) - } + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + return isCodeThrottle(aerr.Code()) } return false } -// IsErrorExpiredCreds returns whether the error code is a credential expiry error. -// Returns false if error is nil. +// IsErrorExpiredCreds returns whether the error code is a credential expiry +// error. Returns false if error is nil. func IsErrorExpiredCreds(err error) bool { - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - return isCodeExpiredCreds(aerr.Code()) - } + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + return isCodeExpiredCreds(aerr.Code()) } return false } @@ -143,17 +215,58 @@ func IsErrorExpiredCreds(err error) bool { // // Alias for the utility function IsErrorRetryable func (r *Request) IsErrorRetryable() bool { + if isErrCode(r.Error, r.RetryErrorCodes) { + return true + } + + // HTTP response status code 501 should not be retried. + // 501 represents Not Implemented which means the request method is not + // supported by the server and cannot be handled. + if r.HTTPResponse != nil { + // HTTP response status code 500 represents internal server error and + // should be retried without any throttle. + if r.HTTPResponse.StatusCode == 500 { + return true + } + } return IsErrorRetryable(r.Error) } -// IsErrorThrottle returns whether the error is to be throttled based on its code. -// Returns false if the request has no Error set +// IsErrorThrottle returns whether the error is to be throttled based on its +// code. Returns false if the request has no Error set. // // Alias for the utility function IsErrorThrottle func (r *Request) IsErrorThrottle() bool { + if isErrCode(r.Error, r.ThrottleErrorCodes) { + return true + } + + if r.HTTPResponse != nil { + switch r.HTTPResponse.StatusCode { + case + 429, // error caused due to too many requests + 502, // Bad Gateway error should be throttled + 503, // caused when service is unavailable + 504: // error occurred due to gateway timeout + return true + } + } + return IsErrorThrottle(r.Error) } +func isErrCode(err error, codes []string) bool { + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + for _, code := range codes { + if code == aerr.Code() { + return true + } + } + } + + return false +} + // IsErrorExpired returns whether the error code is a credential expiry error. // Returns false if the request has no Error set. // diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go new file mode 100644 index 000000000..7713ccfca --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go @@ -0,0 +1,259 @@ +package session + +import ( + "fmt" + "os" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials/processcreds" + "github.com/aws/aws-sdk-go/aws/credentials/stscreds" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/shareddefaults" +) + +func resolveCredentials(cfg *aws.Config, + envCfg envConfig, sharedCfg sharedConfig, + handlers request.Handlers, + sessOpts Options, +) (*credentials.Credentials, error) { + + switch { + case len(sessOpts.Profile) != 0: + // User explicitly provided an Profile in the session's configuration + // so load that profile from shared config first. + // Github(aws/aws-sdk-go#2727) + return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) + + case envCfg.Creds.HasKeys(): + // Environment credentials + return credentials.NewStaticCredentialsFromCreds(envCfg.Creds), nil + + case len(envCfg.WebIdentityTokenFilePath) != 0: + // Web identity token from environment, RoleARN required to also be + // set. + return assumeWebIdentity(cfg, handlers, + envCfg.WebIdentityTokenFilePath, + envCfg.RoleARN, + envCfg.RoleSessionName, + ) + + default: + // Fallback to the "default" credential resolution chain. + return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) + } +} + +// WebIdentityEmptyRoleARNErr will occur if 'AWS_WEB_IDENTITY_TOKEN_FILE' was set but +// 'AWS_IAM_ROLE_ARN' was not set. +var WebIdentityEmptyRoleARNErr = awserr.New(stscreds.ErrCodeWebIdentity, "role ARN is not set", nil) + +// WebIdentityEmptyTokenFilePathErr will occur if 'AWS_IAM_ROLE_ARN' was set but +// 'AWS_WEB_IDENTITY_TOKEN_FILE' was not set. +var WebIdentityEmptyTokenFilePathErr = awserr.New(stscreds.ErrCodeWebIdentity, "token file path is not set", nil) + +func assumeWebIdentity(cfg *aws.Config, handlers request.Handlers, + filepath string, + roleARN, sessionName string, +) (*credentials.Credentials, error) { + + if len(filepath) == 0 { + return nil, WebIdentityEmptyTokenFilePathErr + } + + if len(roleARN) == 0 { + return nil, WebIdentityEmptyRoleARNErr + } + + creds := stscreds.NewWebIdentityCredentials( + &Session{ + Config: cfg, + Handlers: handlers.Copy(), + }, + roleARN, + sessionName, + filepath, + ) + + return creds, nil +} + +func resolveCredsFromProfile(cfg *aws.Config, + envCfg envConfig, sharedCfg sharedConfig, + handlers request.Handlers, + sessOpts Options, +) (creds *credentials.Credentials, err error) { + + switch { + case sharedCfg.SourceProfile != nil: + // Assume IAM role with credentials source from a different profile. + creds, err = resolveCredsFromProfile(cfg, envCfg, + *sharedCfg.SourceProfile, handlers, sessOpts, + ) + + case sharedCfg.Creds.HasKeys(): + // Static Credentials from Shared Config/Credentials file. + creds = credentials.NewStaticCredentialsFromCreds( + sharedCfg.Creds, + ) + + case len(sharedCfg.CredentialProcess) != 0: + // Get credentials from CredentialProcess + creds = processcreds.NewCredentials(sharedCfg.CredentialProcess) + + case len(sharedCfg.CredentialSource) != 0: + creds, err = resolveCredsFromSource(cfg, envCfg, + sharedCfg, handlers, sessOpts, + ) + + case len(sharedCfg.WebIdentityTokenFile) != 0: + // Credentials from Assume Web Identity token require an IAM Role, and + // that roll will be assumed. May be wrapped with another assume role + // via SourceProfile. + return assumeWebIdentity(cfg, handlers, + sharedCfg.WebIdentityTokenFile, + sharedCfg.RoleARN, + sharedCfg.RoleSessionName, + ) + + default: + // Fallback to default credentials provider, include mock errors for + // the credential chain so user can identify why credentials failed to + // be retrieved. + creds = credentials.NewCredentials(&credentials.ChainProvider{ + VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), + Providers: []credentials.Provider{ + &credProviderError{ + Err: awserr.New("EnvAccessKeyNotFound", + "failed to find credentials in the environment.", nil), + }, + &credProviderError{ + Err: awserr.New("SharedCredsLoad", + fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil), + }, + defaults.RemoteCredProvider(*cfg, handlers), + }, + }) + } + if err != nil { + return nil, err + } + + if len(sharedCfg.RoleARN) > 0 { + cfgCp := *cfg + cfgCp.Credentials = creds + return credsFromAssumeRole(cfgCp, handlers, sharedCfg, sessOpts) + } + + return creds, nil +} + +// valid credential source values +const ( + credSourceEc2Metadata = "Ec2InstanceMetadata" + credSourceEnvironment = "Environment" + credSourceECSContainer = "EcsContainer" +) + +func resolveCredsFromSource(cfg *aws.Config, + envCfg envConfig, sharedCfg sharedConfig, + handlers request.Handlers, + sessOpts Options, +) (creds *credentials.Credentials, err error) { + + switch sharedCfg.CredentialSource { + case credSourceEc2Metadata: + p := defaults.RemoteCredProvider(*cfg, handlers) + creds = credentials.NewCredentials(p) + + case credSourceEnvironment: + creds = credentials.NewStaticCredentialsFromCreds(envCfg.Creds) + + case credSourceECSContainer: + if len(os.Getenv(shareddefaults.ECSCredsProviderEnvVar)) == 0 { + return nil, ErrSharedConfigECSContainerEnvVarEmpty + } + + p := defaults.RemoteCredProvider(*cfg, handlers) + creds = credentials.NewCredentials(p) + + default: + return nil, ErrSharedConfigInvalidCredSource + } + + return creds, nil +} + +func credsFromAssumeRole(cfg aws.Config, + handlers request.Handlers, + sharedCfg sharedConfig, + sessOpts Options, +) (*credentials.Credentials, error) { + + if len(sharedCfg.MFASerial) != 0 && sessOpts.AssumeRoleTokenProvider == nil { + // AssumeRole Token provider is required if doing Assume Role + // with MFA. + return nil, AssumeRoleTokenProviderNotSetError{} + } + + return stscreds.NewCredentials( + &Session{ + Config: &cfg, + Handlers: handlers.Copy(), + }, + sharedCfg.RoleARN, + func(opt *stscreds.AssumeRoleProvider) { + opt.RoleSessionName = sharedCfg.RoleSessionName + opt.Duration = sessOpts.AssumeRoleDuration + + // Assume role with external ID + if len(sharedCfg.ExternalID) > 0 { + opt.ExternalID = aws.String(sharedCfg.ExternalID) + } + + // Assume role with MFA + if len(sharedCfg.MFASerial) > 0 { + opt.SerialNumber = aws.String(sharedCfg.MFASerial) + opt.TokenProvider = sessOpts.AssumeRoleTokenProvider + } + }, + ), nil +} + +// AssumeRoleTokenProviderNotSetError is an error returned when creating a +// session when the MFAToken option is not set when shared config is configured +// load assume a role with an MFA token. +type AssumeRoleTokenProviderNotSetError struct{} + +// Code is the short id of the error. +func (e AssumeRoleTokenProviderNotSetError) Code() string { + return "AssumeRoleTokenProviderNotSetError" +} + +// Message is the description of the error +func (e AssumeRoleTokenProviderNotSetError) Message() string { + return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.") +} + +// OrigErr is the underlying error that caused the failure. +func (e AssumeRoleTokenProviderNotSetError) OrigErr() error { + return nil +} + +// Error satisfies the error interface. +func (e AssumeRoleTokenProviderNotSetError) Error() string { + return awserr.SprintError(e.Code(), e.Message(), "", nil) +} + +type credProviderError struct { + Err error +} + +func (c credProviderError) Retrieve() (credentials.Value, error) { + return credentials.Value{}, c.Err +} +func (c credProviderError) IsExpired() bool { + return true +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go index 38a7b05a6..7ec66e7e5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go @@ -1,97 +1,93 @@ /* -Package session provides configuration for the SDK's service clients. - -Sessions can be shared across all service clients that share the same base -configuration. The Session is built from the SDK's default configuration and -request handlers. - -Sessions should be cached when possible, because creating a new Session will -load all configuration values from the environment, and config files each time -the Session is created. Sharing the Session value across all of your service -clients will ensure the configuration is loaded the fewest number of times possible. - -Concurrency +Package session provides configuration for the SDK's service clients. Sessions +can be shared across service clients that share the same base configuration. Sessions are safe to use concurrently as long as the Session is not being -modified. The SDK will not modify the Session once the Session has been created. -Creating service clients concurrently from a shared Session is safe. - -Sessions from Shared Config - -Sessions can be created using the method above that will only load the -additional config if the AWS_SDK_LOAD_CONFIG environment variable is set. -Alternatively you can explicitly create a Session with shared config enabled. -To do this you can use NewSessionWithOptions to configure how the Session will -be created. Using the NewSessionWithOptions with SharedConfigState set to -SharedConfigEnable will create the session as if the AWS_SDK_LOAD_CONFIG -environment variable was set. +modified. Sessions should be cached when possible, because creating a new +Session will load all configuration values from the environment, and config +files each time the Session is created. Sharing the Session value across all of +your service clients will ensure the configuration is loaded the fewest number +of times possible. -Creating Sessions - -When creating Sessions optional aws.Config values can be passed in that will -override the default, or loaded config values the Session is being created -with. This allows you to provide additional, or case based, configuration -as needed. +Sessions options from Shared Config By default NewSession will only load credentials from the shared credentials file (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value the Session will be created from the configuration values from the shared config (~/.aws/config) and shared credentials -(~/.aws/credentials) files. See the section Sessions from Shared Config for -more information. +(~/.aws/credentials) files. Using the NewSessionWithOptions with +SharedConfigState set to SharedConfigEnable will create the session as if the +AWS_SDK_LOAD_CONFIG environment variable was set. -Create a Session with the default config and request handlers. With credentials -region, and profile loaded from the environment and shared config automatically. -Requires the AWS_PROFILE to be set, or "default" is used. +Credential and config loading order - // Create Session - sess := session.Must(session.NewSession()) +The Session will attempt to load configuration and credentials from the +environment, configuration files, and other credential sources. The order +configuration is loaded in is: - // Create a Session with a custom region - sess := session.Must(session.NewSession(&aws.Config{ - Region: aws.String("us-east-1"), - })) + * Environment Variables + * Shared Credentials file + * Shared Configuration file (if SharedConfig is enabled) + * EC2 Instance Metadata (credentials only) - // Create a S3 client instance from a session - sess := session.Must(session.NewSession()) +The Environment variables for credentials will have precedence over shared +config even if SharedConfig is enabled. To override this behavior, and use +shared config credentials instead specify the session.Options.Profile, (e.g. +when using credential_source=Environment to assume a role). + + sess, err := session.NewSessionWithOptions(session.Options{ + Profile: "myProfile", + }) - svc := s3.New(sess) +Creating Sessions -Create Session With Option Overrides +Creating a Session without additional options will load credentials region, and +profile loaded from the environment and shared config automatically. See, +"Environment Variables" section for information on environment variables used +by Session. -In addition to NewSession, Sessions can be created using NewSessionWithOptions. -This func allows you to control and override how the Session will be created -through code instead of being driven by environment variables only. + // Create Session + sess, err := session.NewSession() -Use NewSessionWithOptions when you want to provide the config profile, or -override the shared config state (AWS_SDK_LOAD_CONFIG). + +When creating Sessions optional aws.Config values can be passed in that will +override the default, or loaded, config values the Session is being created +with. This allows you to provide additional, or case based, configuration +as needed. + + // Create a Session with a custom region + sess, err := session.NewSession(&aws.Config{ + Region: aws.String("us-west-2"), + }) + +Use NewSessionWithOptions to provide additional configuration driving how the +Session's configuration will be loaded. Such as, specifying shared config +profile, or override the shared config state, (AWS_SDK_LOAD_CONFIG). // Equivalent to session.NewSession() - sess := session.Must(session.NewSessionWithOptions(session.Options{ + sess, err := session.NewSessionWithOptions(session.Options{ // Options - })) + }) - // Specify profile to load for the session's config - sess := session.Must(session.NewSessionWithOptions(session.Options{ - Profile: "profile_name", - })) + sess, err := session.NewSessionWithOptions(session.Options{ + // Specify profile to load for the session's config + Profile: "profile_name", - // Specify profile for config and region for requests - sess := session.Must(session.NewSessionWithOptions(session.Options{ - Config: aws.Config{Region: aws.String("us-east-1")}, - Profile: "profile_name", - })) + // Provide SDK Config options, such as Region. + Config: aws.Config{ + Region: aws.String("us-west-2"), + }, - // Force enable Shared Config support - sess := session.Must(session.NewSessionWithOptions(session.Options{ + // Force enable Shared Config support SharedConfigState: session.SharedConfigEnable, - })) + }) Adding Handlers -You can add handlers to a session for processing HTTP requests. All service -clients that use the session inherit the handlers. For example, the following -handler logs every request and its payload made by a service client: +You can add handlers to a session to decorate API operation, (e.g. adding HTTP +headers). All clients that use the Session receive a copy of the Session's +handlers. For example, the following request handler added to the Session logs +every requests made. // Create a session, and add additional handlers for all service // clients created with the Session to inherit. Adds logging handler. @@ -99,22 +95,15 @@ handler logs every request and its payload made by a service client: sess.Handlers.Send.PushFront(func(r *request.Request) { // Log every request made and its payload - logger.Printf("Request: %s/%s, Payload: %s", + logger.Printf("Request: %s/%s, Params: %s", r.ClientInfo.ServiceName, r.Operation, r.Params) }) -Deprecated "New" function - -The New session function has been deprecated because it does not provide good -way to return errors that occur when loading the configuration files and values. -Because of this, NewSession was created so errors can be retrieved when -creating a session fails. - Shared Config Fields -By default the SDK will only load the shared credentials file's (~/.aws/credentials) -credentials values, and all other config is provided by the environment variables, -SDK defaults, and user provided aws.Config values. +By default the SDK will only load the shared credentials file's +(~/.aws/credentials) credentials values, and all other config is provided by +the environment variables, SDK defaults, and user provided aws.Config values. If the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable option is used to create the Session the full shared config values will be @@ -125,24 +114,31 @@ files have the same format. If both config files are present the configuration from both files will be read. The Session will be created from configuration values from the shared -credentials file (~/.aws/credentials) over those in the shared config file (~/.aws/config). +credentials file (~/.aws/credentials) over those in the shared config file +(~/.aws/config). -Credentials are the values the SDK should use for authenticating requests with -AWS Services. They are from a configuration file will need to include both -aws_access_key_id and aws_secret_access_key must be provided together in the -same file to be considered valid. The values will be ignored if not a complete -group. aws_session_token is an optional field that can be provided if both of -the other two fields are also provided. +Credentials are the values the SDK uses to authenticating requests with AWS +Services. When specified in a file, both aws_access_key_id and +aws_secret_access_key must be provided together in the same file to be +considered valid. They will be ignored if both are not present. +aws_session_token is an optional field that can be provided in addition to the +other two fields. aws_access_key_id = AKID aws_secret_access_key = SECRET aws_session_token = TOKEN -Assume Role values allow you to configure the SDK to assume an IAM role using -a set of credentials provided in a config file via the source_profile field. -Both "role_arn" and "source_profile" are required. The SDK supports assuming -a role with MFA token if the session option AssumeRoleTokenProvider -is set. + ; region only supported if SharedConfigEnabled. + region = us-east-1 + +Assume Role configuration + +The role_arn field allows you to configure the SDK to assume an IAM role using +a set of credentials from another source. Such as when paired with static +credentials, "profile_source", "credential_process", or "credential_source" +fields. If "role_arn" is provided, a source of credentials must also be +specified, such as "source_profile", "credential_source", or +"credential_process". role_arn = arn:aws:iam:::role/ source_profile = profile_with_creds @@ -150,40 +146,16 @@ is set. mfa_serial = role_session_name = session_name -Region is the region the SDK should use for looking up AWS service endpoints -and signing requests. - - region = us-east-1 - -Assume Role with MFA token -To create a session with support for assuming an IAM role with MFA set the -session option AssumeRoleTokenProvider to a function that will prompt for the -MFA token code when the SDK assumes the role and refreshes the role's credentials. -This allows you to configure the SDK via the shared config to assumea role -with MFA tokens. - -In order for the SDK to assume a role with MFA the SharedConfigState -session option must be set to SharedConfigEnable, or AWS_SDK_LOAD_CONFIG -environment variable set. - -The shared configuration instructs the SDK to assume an IAM role with MFA -when the mfa_serial configuration field is set in the shared config -(~/.aws/config) or shared credentials (~/.aws/credentials) file. - -If mfa_serial is set in the configuration, the SDK will assume the role, and -the AssumeRoleTokenProvider session option is not set an an error will -be returned when creating the session. +The SDK supports assuming a role with MFA token. If "mfa_serial" is set, you +must also set the Session Option.AssumeRoleTokenProvider. The Session will fail +to load if the AssumeRoleTokenProvider is not specified. sess := session.Must(session.NewSessionWithOptions(session.Options{ AssumeRoleTokenProvider: stscreds.StdinTokenProvider, })) - // Create service client value configured for credentials - // from assumed role. - svc := s3.New(sess) - -To setup assume role outside of a session see the stscreds.AssumeRoleProvider +To setup Assume Role outside of a session see the stscreds.AssumeRoleProvider documentation. Environment Variables diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go index e3959b959..60a6f9ce2 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go @@ -99,21 +99,41 @@ type envConfig struct { CustomCABundle string csmEnabled string - CSMEnabled bool + CSMEnabled *bool CSMPort string + CSMHost string CSMClientID string - enableEndpointDiscovery string // Enables endpoint discovery via environment variables. // // AWS_ENABLE_ENDPOINT_DISCOVERY=true EnableEndpointDiscovery *bool + enableEndpointDiscovery string + + // Specifies the WebIdentity token the SDK should use to assume a role + // with. + // + // AWS_WEB_IDENTITY_TOKEN_FILE=file_path + WebIdentityTokenFilePath string + + // Specifies the IAM role arn to use when assuming an role. + // + // AWS_ROLE_ARN=role_arn + RoleARN string + + // Specifies the IAM role session name to use when assuming a role. + // + // AWS_ROLE_SESSION_NAME=session_name + RoleSessionName string } var ( csmEnabledEnvKey = []string{ "AWS_CSM_ENABLED", } + csmHostEnvKey = []string{ + "AWS_CSM_HOST", + } csmPortEnvKey = []string{ "AWS_CSM_PORT", } @@ -150,6 +170,15 @@ var ( sharedConfigFileEnvKey = []string{ "AWS_CONFIG_FILE", } + webIdentityTokenFilePathEnvKey = []string{ + "AWS_WEB_IDENTITY_TOKEN_FILE", + } + roleARNEnvKey = []string{ + "AWS_ROLE_ARN", + } + roleSessionNameEnvKey = []string{ + "AWS_ROLE_SESSION_NAME", + } ) // loadEnvConfig retrieves the SDK's environment configuration. @@ -178,21 +207,33 @@ func envConfigLoad(enableSharedConfig bool) envConfig { cfg.EnableSharedConfig = enableSharedConfig - setFromEnvVal(&cfg.Creds.AccessKeyID, credAccessEnvKey) - setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey) - setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey) + // Static environment credentials + var creds credentials.Value + setFromEnvVal(&creds.AccessKeyID, credAccessEnvKey) + setFromEnvVal(&creds.SecretAccessKey, credSecretEnvKey) + setFromEnvVal(&creds.SessionToken, credSessionEnvKey) + if creds.HasKeys() { + // Require logical grouping of credentials + creds.ProviderName = EnvProviderName + cfg.Creds = creds + } + + // Role Metadata + setFromEnvVal(&cfg.RoleARN, roleARNEnvKey) + setFromEnvVal(&cfg.RoleSessionName, roleSessionNameEnvKey) + + // Web identity environment variables + setFromEnvVal(&cfg.WebIdentityTokenFilePath, webIdentityTokenFilePathEnvKey) // CSM environment variables setFromEnvVal(&cfg.csmEnabled, csmEnabledEnvKey) + setFromEnvVal(&cfg.CSMHost, csmHostEnvKey) setFromEnvVal(&cfg.CSMPort, csmPortEnvKey) setFromEnvVal(&cfg.CSMClientID, csmClientIDEnvKey) - cfg.CSMEnabled = len(cfg.csmEnabled) > 0 - // Require logical grouping of credentials - if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 { - cfg.Creds = credentials.Value{} - } else { - cfg.Creds.ProviderName = EnvProviderName + if len(cfg.csmEnabled) != 0 { + v, _ := strconv.ParseBool(cfg.csmEnabled) + cfg.CSMEnabled = &v } regionKeys := regionEnvKeys diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index be4b5f077..7b0a942e2 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -8,19 +8,17 @@ import ( "io/ioutil" "net/http" "os" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/corehandlers" "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/credentials/processcreds" - "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/csm" "github.com/aws/aws-sdk-go/aws/defaults" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/shareddefaults" ) const ( @@ -106,8 +104,20 @@ func New(cfgs ...*aws.Config) *Session { } s := deprecatedNewSession(cfgs...) - if envCfg.CSMEnabled { - enableCSM(&s.Handlers, envCfg.CSMClientID, envCfg.CSMPort, s.Config.Logger) + + if csmCfg, err := loadCSMConfig(envCfg, []string{}); err != nil { + if l := s.Config.Logger; l != nil { + l.Log(fmt.Sprintf("ERROR: failed to load CSM configuration, %v", err)) + } + } else if csmCfg.Enabled { + err := enableCSM(&s.Handlers, csmCfg, s.Config.Logger) + if err != nil { + err = fmt.Errorf("failed to enable CSM, %v", err) + s.Config.Logger.Log("ERROR:", err.Error()) + s.Handlers.Validate.PushBack(func(r *request.Request) { + r.Error = err + }) + } } return s @@ -126,7 +136,7 @@ func New(cfgs ...*aws.Config) *Session { // to be built with retrieving credentials with AssumeRole set in the config. // // See the NewSessionWithOptions func for information on how to override or -// control through code how the Session will be created. Such as specifying the +// control through code how the Session will be created, such as specifying the // config profile, and controlling if shared config is enabled or not. func NewSession(cfgs ...*aws.Config) (*Session, error) { opts := Options{} @@ -210,6 +220,12 @@ type Options struct { // the config enables assume role wit MFA via the mfa_serial field. AssumeRoleTokenProvider func() (string, error) + // When the SDK's shared config is configured to assume a role this option + // may be provided to set the expiry duration of the STS credentials. + // Defaults to 15 minutes if not set as documented in the + // stscreds.AssumeRoleProvider. + AssumeRoleDuration time.Duration + // Reader for a custom Credentials Authority (CA) bundle in PEM format that // the SDK will use instead of the default system's root CA bundle. Use this // only if you want to replace the CA bundle the SDK uses for TLS requests. @@ -224,6 +240,12 @@ type Options struct { // to also enable this feature. CustomCABundle session option field has priority // over the AWS_CA_BUNDLE environment variable, and will be used if both are set. CustomCABundle io.Reader + + // The handlers that the session and all API clients will be created with. + // This must be a complete set of handlers. Use the defaults.Handlers() + // function to initialize this value before changing the handlers to be + // used by the SDK. + Handlers request.Handlers } // NewSessionWithOptions returns a new Session created from SDK defaults, config files, @@ -263,7 +285,7 @@ func NewSessionWithOptions(opts Options) (*Session, error) { envCfg = loadEnvConfig() } - if len(opts.Profile) > 0 { + if len(opts.Profile) != 0 { envCfg.Profile = opts.Profile } @@ -329,27 +351,33 @@ func deprecatedNewSession(cfgs ...*aws.Config) *Session { return s } -func enableCSM(handlers *request.Handlers, clientID string, port string, logger aws.Logger) { - logger.Log("Enabling CSM") - if len(port) == 0 { - port = csm.DefaultPort +func enableCSM(handlers *request.Handlers, cfg csmConfig, logger aws.Logger) error { + if logger != nil { + logger.Log("Enabling CSM") } - r, err := csm.Start(clientID, "127.0.0.1:"+port) + r, err := csm.Start(cfg.ClientID, csm.AddressWithDefaults(cfg.Host, cfg.Port)) if err != nil { - return + return err } r.InjectHandlers(handlers) + + return nil } func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) { cfg := defaults.Config() - handlers := defaults.Handlers() + + handlers := opts.Handlers + if handlers.IsEmpty() { + handlers = defaults.Handlers() + } // Get a merged version of the user provided config to determine if // credentials were. userCfg := &aws.Config{} userCfg.MergeIn(cfgs...) + cfg.MergeIn(userCfg) // Ordered config files will be loaded in with later files overwriting // previous config file values. @@ -366,9 +394,17 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, } // Load additional config from file(s) - sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles) + sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles, envCfg.EnableSharedConfig) if err != nil { - return nil, err + if len(envCfg.Profile) == 0 && !envCfg.EnableSharedConfig && (envCfg.Creds.HasKeys() || userCfg.Credentials != nil) { + // Special case where the user has not explicitly specified an AWS_PROFILE, + // or session.Options.profile, shared config is not enabled, and the + // environment has credentials, allow the shared config file to fail to + // load since the user has already provided credentials, and nothing else + // is required to be read file. Github(aws/aws-sdk-go#2455) + } else if _, ok := err.(SharedConfigProfileNotExistsError); !ok { + return nil, err + } } if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil { @@ -381,8 +417,16 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, } initHandlers(s) - if envCfg.CSMEnabled { - enableCSM(&s.Handlers, envCfg.CSMClientID, envCfg.CSMPort, s.Config.Logger) + + if csmCfg, err := loadCSMConfig(envCfg, cfgFiles); err != nil { + if l := s.Config.Logger; l != nil { + l.Log(fmt.Sprintf("ERROR: failed to load CSM configuration, %v", err)) + } + } else if csmCfg.Enabled { + err = enableCSM(&s.Handlers, csmCfg, s.Config.Logger) + if err != nil { + return nil, err + } } // Setup HTTP client with custom cert bundle if enabled @@ -395,6 +439,46 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, return s, nil } +type csmConfig struct { + Enabled bool + Host string + Port string + ClientID string +} + +var csmProfileName = "aws_csm" + +func loadCSMConfig(envCfg envConfig, cfgFiles []string) (csmConfig, error) { + if envCfg.CSMEnabled != nil { + if *envCfg.CSMEnabled { + return csmConfig{ + Enabled: true, + ClientID: envCfg.CSMClientID, + Host: envCfg.CSMHost, + Port: envCfg.CSMPort, + }, nil + } + return csmConfig{}, nil + } + + sharedCfg, err := loadSharedConfig(csmProfileName, cfgFiles, false) + if err != nil { + if _, ok := err.(SharedConfigProfileNotExistsError); !ok { + return csmConfig{}, err + } + } + if sharedCfg.CSMEnabled != nil && *sharedCfg.CSMEnabled == true { + return csmConfig{ + Enabled: true, + ClientID: sharedCfg.CSMClientID, + Host: sharedCfg.CSMHost, + Port: sharedCfg.CSMPort, + }, nil + } + + return csmConfig{}, nil +} + func loadCustomCABundle(s *Session, bundle io.Reader) error { var t *http.Transport switch v := s.Config.HTTPClient.Transport.(type) { @@ -443,9 +527,11 @@ func loadCertPool(r io.Reader) (*x509.CertPool, error) { return p, nil } -func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options) error { - // Merge in user provided configuration - cfg.MergeIn(userCfg) +func mergeConfigSrcs(cfg, userCfg *aws.Config, + envCfg envConfig, sharedCfg sharedConfig, + handlers request.Handlers, + sessOpts Options, +) error { // Region if not already set by user if len(aws.StringValue(cfg.Region)) == 0 { @@ -464,164 +550,19 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share } } - // Configure credentials if not already set + // Configure credentials if not already set by the user when creating the + // Session. if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { - - // inspect the profile to see if a credential source has been specified. - if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.CredentialSource) > 0 { - - // if both credential_source and source_profile have been set, return an error - // as this is undefined behavior. - if len(sharedCfg.AssumeRole.SourceProfile) > 0 { - return ErrSharedConfigSourceCollision - } - - // valid credential source values - const ( - credSourceEc2Metadata = "Ec2InstanceMetadata" - credSourceEnvironment = "Environment" - credSourceECSContainer = "EcsContainer" - ) - - switch sharedCfg.AssumeRole.CredentialSource { - case credSourceEc2Metadata: - cfgCp := *cfg - p := defaults.RemoteCredProvider(cfgCp, handlers) - cfgCp.Credentials = credentials.NewCredentials(p) - - if len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil { - // AssumeRole Token provider is required if doing Assume Role - // with MFA. - return AssumeRoleTokenProviderNotSetError{} - } - - cfg.Credentials = assumeRoleCredentials(cfgCp, handlers, sharedCfg, sessOpts) - case credSourceEnvironment: - cfg.Credentials = credentials.NewStaticCredentialsFromCreds( - envCfg.Creds, - ) - case credSourceECSContainer: - if len(os.Getenv(shareddefaults.ECSCredsProviderEnvVar)) == 0 { - return ErrSharedConfigECSContainerEnvVarEmpty - } - - cfgCp := *cfg - p := defaults.RemoteCredProvider(cfgCp, handlers) - creds := credentials.NewCredentials(p) - - cfg.Credentials = creds - default: - return ErrSharedConfigInvalidCredSource - } - - return nil - } - - if len(envCfg.Creds.AccessKeyID) > 0 { - cfg.Credentials = credentials.NewStaticCredentialsFromCreds( - envCfg.Creds, - ) - } else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil { - cfgCp := *cfg - cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds( - sharedCfg.AssumeRoleSource.Creds, - ) - - if len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil { - // AssumeRole Token provider is required if doing Assume Role - // with MFA. - return AssumeRoleTokenProviderNotSetError{} - } - - cfg.Credentials = assumeRoleCredentials(cfgCp, handlers, sharedCfg, sessOpts) - } else if len(sharedCfg.Creds.AccessKeyID) > 0 { - cfg.Credentials = credentials.NewStaticCredentialsFromCreds( - sharedCfg.Creds, - ) - } else if len(sharedCfg.CredentialProcess) > 0 { - cfg.Credentials = processcreds.NewCredentials( - sharedCfg.CredentialProcess, - ) - } else { - // Fallback to default credentials provider, include mock errors - // for the credential chain so user can identify why credentials - // failed to be retrieved. - cfg.Credentials = credentials.NewCredentials(&credentials.ChainProvider{ - VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), - Providers: []credentials.Provider{ - &credProviderError{Err: awserr.New("EnvAccessKeyNotFound", "failed to find credentials in the environment.", nil)}, - &credProviderError{Err: awserr.New("SharedCredsLoad", fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil)}, - defaults.RemoteCredProvider(*cfg, handlers), - }, - }) + creds, err := resolveCredentials(cfg, envCfg, sharedCfg, handlers, sessOpts) + if err != nil { + return err } + cfg.Credentials = creds } return nil } -func assumeRoleCredentials(cfg aws.Config, handlers request.Handlers, sharedCfg sharedConfig, sessOpts Options) *credentials.Credentials { - return stscreds.NewCredentials( - &Session{ - Config: &cfg, - Handlers: handlers.Copy(), - }, - sharedCfg.AssumeRole.RoleARN, - func(opt *stscreds.AssumeRoleProvider) { - opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName - - // Assume role with external ID - if len(sharedCfg.AssumeRole.ExternalID) > 0 { - opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID) - } - - // Assume role with MFA - if len(sharedCfg.AssumeRole.MFASerial) > 0 { - opt.SerialNumber = aws.String(sharedCfg.AssumeRole.MFASerial) - opt.TokenProvider = sessOpts.AssumeRoleTokenProvider - } - }, - ) -} - -// AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the -// MFAToken option is not set when shared config is configured load assume a -// role with an MFA token. -type AssumeRoleTokenProviderNotSetError struct{} - -// Code is the short id of the error. -func (e AssumeRoleTokenProviderNotSetError) Code() string { - return "AssumeRoleTokenProviderNotSetError" -} - -// Message is the description of the error -func (e AssumeRoleTokenProviderNotSetError) Message() string { - return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.") -} - -// OrigErr is the underlying error that caused the failure. -func (e AssumeRoleTokenProviderNotSetError) OrigErr() error { - return nil -} - -// Error satisfies the error interface. -func (e AssumeRoleTokenProviderNotSetError) Error() string { - return awserr.SprintError(e.Code(), e.Message(), "", nil) -} - -type credProviderError struct { - Err error -} - -var emptyCreds = credentials.Value{} - -func (c credProviderError) Retrieve() (credentials.Value, error) { - return credentials.Value{}, c.Err -} -func (c credProviderError) IsExpired() bool { - return true -} - func initHandlers(s *Session) { // Add the Validate parameter handler if it is not disabled. s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler) @@ -630,7 +571,7 @@ func initHandlers(s *Session) { } } -// Copy creates and returns a copy of the current Session, coping the config +// Copy creates and returns a copy of the current Session, copying the config // and handlers. If any additional configs are provided they will be merged // on top of the Session's copied config. // diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go index 7cb44021b..d91ac93a5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go @@ -5,7 +5,6 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/internal/ini" ) @@ -23,13 +22,23 @@ const ( mfaSerialKey = `mfa_serial` // optional roleSessionNameKey = `role_session_name` // optional + // CSM options + csmEnabledKey = `csm_enabled` + csmHostKey = `csm_host` + csmPortKey = `csm_port` + csmClientIDKey = `csm_client_id` + // Additional Config fields regionKey = `region` // endpoint discovery group enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional + // External Credential Process - credentialProcessKey = `credential_process` + credentialProcessKey = `credential_process` // optional + + // Web Identity Token File + webIdentityTokenFileKey = `web_identity_token_file` // optional // DefaultSharedConfigProfile is the default profile to be used when // loading configuration from the config files if another profile name @@ -37,36 +46,33 @@ const ( DefaultSharedConfigProfile = `default` ) -type assumeRoleConfig struct { - RoleARN string - SourceProfile string - CredentialSource string - ExternalID string - MFASerial string - RoleSessionName string -} - // sharedConfig represents the configuration fields of the SDK config files. type sharedConfig struct { - // Credentials values from the config file. Both aws_access_key_id - // and aws_secret_access_key must be provided together in the same file - // to be considered valid. The values will be ignored if not a complete group. - // aws_session_token is an optional field that can be provided if both of the - // other two fields are also provided. + // Credentials values from the config file. Both aws_access_key_id and + // aws_secret_access_key must be provided together in the same file to be + // considered valid. The values will be ignored if not a complete group. + // aws_session_token is an optional field that can be provided if both of + // the other two fields are also provided. // // aws_access_key_id // aws_secret_access_key // aws_session_token Creds credentials.Value - AssumeRole assumeRoleConfig - AssumeRoleSource *sharedConfig + CredentialSource string + CredentialProcess string + WebIdentityTokenFile string - // An external process to request credentials - CredentialProcess string + RoleARN string + RoleSessionName string + ExternalID string + MFASerial string - // Region is the region the SDK should use for looking up AWS service endpoints - // and signing requests. + SourceProfileName string + SourceProfile *sharedConfig + + // Region is the region the SDK should use for looking up AWS service + // endpoints and signing requests. // // region Region string @@ -76,6 +82,12 @@ type sharedConfig struct { // // endpoint_discovery_enabled = true EnableEndpointDiscovery *bool + + // CSM Options + CSMEnabled *bool + CSMHost string + CSMPort string + CSMClientID string } type sharedConfigFile struct { @@ -83,17 +95,18 @@ type sharedConfigFile struct { IniData ini.Sections } -// loadSharedConfig retrieves the configuration from the list of files -// using the profile provided. The order the files are listed will determine +// loadSharedConfig retrieves the configuration from the list of files using +// the profile provided. The order the files are listed will determine // precedence. Values in subsequent files will overwrite values defined in // earlier files. // // For example, given two files A and B. Both define credentials. If the order -// of the files are A then B, B's credential values will be used instead of A's. +// of the files are A then B, B's credential values will be used instead of +// A's. // // See sharedConfig.setFromFile for information how the config files // will be loaded. -func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) { +func loadSharedConfig(profile string, filenames []string, exOpts bool) (sharedConfig, error) { if len(profile) == 0 { profile = DefaultSharedConfigProfile } @@ -104,16 +117,11 @@ func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) } cfg := sharedConfig{} - if err = cfg.setFromIniFiles(profile, files); err != nil { + profiles := map[string]struct{}{} + if err = cfg.setFromIniFiles(profiles, profile, files, exOpts); err != nil { return sharedConfig{}, err } - if len(cfg.AssumeRole.SourceProfile) > 0 { - if err := cfg.setAssumeRoleSource(profile, files); err != nil { - return sharedConfig{}, err - } - } - return cfg, nil } @@ -137,60 +145,88 @@ func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { return files, nil } -func (cfg *sharedConfig) setAssumeRoleSource(origProfile string, files []sharedConfigFile) error { - var assumeRoleSrc sharedConfig - - if len(cfg.AssumeRole.CredentialSource) > 0 { - // setAssumeRoleSource is only called when source_profile is found. - // If both source_profile and credential_source are set, then - // ErrSharedConfigSourceCollision will be returned - return ErrSharedConfigSourceCollision +func (cfg *sharedConfig) setFromIniFiles(profiles map[string]struct{}, profile string, files []sharedConfigFile, exOpts bool) error { + // Trim files from the list that don't exist. + var skippedFiles int + var profileNotFoundErr error + for _, f := range files { + if err := cfg.setFromIniFile(profile, f, exOpts); err != nil { + if _, ok := err.(SharedConfigProfileNotExistsError); ok { + // Ignore profiles not defined in individual files. + profileNotFoundErr = err + skippedFiles++ + continue + } + return err + } + } + if skippedFiles == len(files) { + // If all files were skipped because the profile is not found, return + // the original profile not found error. + return profileNotFoundErr } - // Multiple level assume role chains are not support - if cfg.AssumeRole.SourceProfile == origProfile { - assumeRoleSrc = *cfg - assumeRoleSrc.AssumeRole = assumeRoleConfig{} + if _, ok := profiles[profile]; ok { + // if this is the second instance of the profile the Assume Role + // options must be cleared because they are only valid for the + // first reference of a profile. The self linked instance of the + // profile only have credential provider options. + cfg.clearAssumeRoleOptions() } else { - err := assumeRoleSrc.setFromIniFiles(cfg.AssumeRole.SourceProfile, files) - if err != nil { + // First time a profile has been seen, It must either be a assume role + // or credentials. Assert if the credential type requires a role ARN, + // the ARN is also set. + if err := cfg.validateCredentialsRequireARN(profile); err != nil { return err } } + profiles[profile] = struct{}{} - if len(assumeRoleSrc.Creds.AccessKeyID) == 0 { - return SharedConfigAssumeRoleError{RoleARN: cfg.AssumeRole.RoleARN} + if err := cfg.validateCredentialType(); err != nil { + return err } - cfg.AssumeRoleSource = &assumeRoleSrc + // Link source profiles for assume roles + if len(cfg.SourceProfileName) != 0 { + // Linked profile via source_profile ignore credential provider + // options, the source profile must provide the credentials. + cfg.clearCredentialOptions() - return nil -} - -func (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFile) error { - // Trim files from the list that don't exist. - for _, f := range files { - if err := cfg.setFromIniFile(profile, f); err != nil { + srcCfg := &sharedConfig{} + err := srcCfg.setFromIniFiles(profiles, cfg.SourceProfileName, files, exOpts) + if err != nil { + // SourceProfile that doesn't exist is an error in configuration. if _, ok := err.(SharedConfigProfileNotExistsError); ok { - // Ignore proviles missings - continue + err = SharedConfigAssumeRoleError{ + RoleARN: cfg.RoleARN, + SourceProfile: cfg.SourceProfileName, + } } return err } + + if !srcCfg.hasCredentials() { + return SharedConfigAssumeRoleError{ + RoleARN: cfg.RoleARN, + SourceProfile: cfg.SourceProfileName, + } + } + + cfg.SourceProfile = srcCfg } return nil } -// setFromFile loads the configuration from the file using -// the profile provided. A sharedConfig pointer type value is used so that -// multiple config file loadings can be chained. +// setFromFile loads the configuration from the file using the profile +// provided. A sharedConfig pointer type value is used so that multiple config +// file loadings can be chained. // // Only loads complete logically grouped values, and will not set fields in cfg -// for incomplete grouped values in the config. Such as credentials. For example -// if a config file only includes aws_access_key_id but no aws_secret_access_key -// the aws_access_key_id will be ignored. -func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error { +// for incomplete grouped values in the config. Such as credentials. For +// example if a config file only includes aws_access_key_id but no +// aws_secret_access_key the aws_access_key_id will be ignored. +func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, exOpts bool) error { section, ok := file.IniData.GetSection(profile) if !ok { // Fallback to to alternate profile name: profile @@ -200,51 +236,141 @@ func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) e } } + if exOpts { + // Assume Role Parameters + updateString(&cfg.RoleARN, section, roleArnKey) + updateString(&cfg.ExternalID, section, externalIDKey) + updateString(&cfg.MFASerial, section, mfaSerialKey) + updateString(&cfg.RoleSessionName, section, roleSessionNameKey) + updateString(&cfg.SourceProfileName, section, sourceProfileKey) + updateString(&cfg.CredentialSource, section, credentialSourceKey) + + updateString(&cfg.Region, section, regionKey) + } + + updateString(&cfg.CredentialProcess, section, credentialProcessKey) + updateString(&cfg.WebIdentityTokenFile, section, webIdentityTokenFileKey) + // Shared Credentials - akid := section.String(accessKeyIDKey) - secret := section.String(secretAccessKey) - if len(akid) > 0 && len(secret) > 0 { - cfg.Creds = credentials.Value{ - AccessKeyID: akid, - SecretAccessKey: secret, - SessionToken: section.String(sessionTokenKey), - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), - } + creds := credentials.Value{ + AccessKeyID: section.String(accessKeyIDKey), + SecretAccessKey: section.String(secretAccessKey), + SessionToken: section.String(sessionTokenKey), + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), + } + if creds.HasKeys() { + cfg.Creds = creds + } + + // Endpoint discovery + updateBoolPtr(&cfg.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) + + // CSM options + updateBoolPtr(&cfg.CSMEnabled, section, csmEnabledKey) + updateString(&cfg.CSMHost, section, csmHostKey) + updateString(&cfg.CSMPort, section, csmPortKey) + updateString(&cfg.CSMClientID, section, csmClientIDKey) + + return nil +} + +func (cfg *sharedConfig) validateCredentialsRequireARN(profile string) error { + var credSource string + + switch { + case len(cfg.SourceProfileName) != 0: + credSource = sourceProfileKey + case len(cfg.CredentialSource) != 0: + credSource = credentialSourceKey + case len(cfg.WebIdentityTokenFile) != 0: + credSource = webIdentityTokenFileKey } - // Assume Role - roleArn := section.String(roleArnKey) - srcProfile := section.String(sourceProfileKey) - credentialSource := section.String(credentialSourceKey) - hasSource := len(srcProfile) > 0 || len(credentialSource) > 0 - if len(roleArn) > 0 && hasSource { - cfg.AssumeRole = assumeRoleConfig{ - RoleARN: roleArn, - SourceProfile: srcProfile, - CredentialSource: credentialSource, - ExternalID: section.String(externalIDKey), - MFASerial: section.String(mfaSerialKey), - RoleSessionName: section.String(roleSessionNameKey), + if len(credSource) != 0 && len(cfg.RoleARN) == 0 { + return CredentialRequiresARNError{ + Type: credSource, + Profile: profile, } } - // `credential_process` - if credProc := section.String(credentialProcessKey); len(credProc) > 0 { - cfg.CredentialProcess = credProc + return nil +} + +func (cfg *sharedConfig) validateCredentialType() error { + // Only one or no credential type can be defined. + if !oneOrNone( + len(cfg.SourceProfileName) != 0, + len(cfg.CredentialSource) != 0, + len(cfg.CredentialProcess) != 0, + len(cfg.WebIdentityTokenFile) != 0, + ) { + return ErrSharedConfigSourceCollision } - // Region - if v := section.String(regionKey); len(v) > 0 { - cfg.Region = v + return nil +} + +func (cfg *sharedConfig) hasCredentials() bool { + switch { + case len(cfg.SourceProfileName) != 0: + case len(cfg.CredentialSource) != 0: + case len(cfg.CredentialProcess) != 0: + case len(cfg.WebIdentityTokenFile) != 0: + case cfg.Creds.HasKeys(): + default: + return false } - // Endpoint discovery - if section.Has(enableEndpointDiscoveryKey) { - v := section.Bool(enableEndpointDiscoveryKey) - cfg.EnableEndpointDiscovery = &v + return true +} + +func (cfg *sharedConfig) clearCredentialOptions() { + cfg.CredentialSource = "" + cfg.CredentialProcess = "" + cfg.WebIdentityTokenFile = "" + cfg.Creds = credentials.Value{} +} + +func (cfg *sharedConfig) clearAssumeRoleOptions() { + cfg.RoleARN = "" + cfg.ExternalID = "" + cfg.MFASerial = "" + cfg.RoleSessionName = "" + cfg.SourceProfileName = "" +} + +func oneOrNone(bs ...bool) bool { + var count int + + for _, b := range bs { + if b { + count++ + if count > 1 { + return false + } + } } - return nil + return true +} + +// updateString will only update the dst with the value in the section key, key +// is present in the section. +func updateString(dst *string, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = section.String(key) +} + +// updateBoolPtr will only update the dst with the value in the section key, +// key is present in the section. +func updateBoolPtr(dst **bool, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = new(bool) + **dst = section.Bool(key) } // SharedConfigLoadError is an error for the shared config file failed to load. @@ -304,7 +430,8 @@ func (e SharedConfigProfileNotExistsError) Error() string { // profile contains assume role information, but that information is invalid // or not complete. type SharedConfigAssumeRoleError struct { - RoleARN string + RoleARN string + SourceProfile string } // Code is the short id of the error. @@ -314,8 +441,10 @@ func (e SharedConfigAssumeRoleError) Code() string { // Message is the description of the error func (e SharedConfigAssumeRoleError) Message() string { - return fmt.Sprintf("failed to load assume role for %s, source profile has no shared credentials", - e.RoleARN) + return fmt.Sprintf( + "failed to load assume role for %s, source profile %s has no shared credentials", + e.RoleARN, e.SourceProfile, + ) } // OrigErr is the underlying error that caused the failure. @@ -327,3 +456,36 @@ func (e SharedConfigAssumeRoleError) OrigErr() error { func (e SharedConfigAssumeRoleError) Error() string { return awserr.SprintError(e.Code(), e.Message(), "", nil) } + +// CredentialRequiresARNError provides the error for shared config credentials +// that are incorrectly configured in the shared config or credentials file. +type CredentialRequiresARNError struct { + // type of credentials that were configured. + Type string + + // Profile name the credentials were in. + Profile string +} + +// Code is the short id of the error. +func (e CredentialRequiresARNError) Code() string { + return "CredentialRequiresARNError" +} + +// Message is the description of the error +func (e CredentialRequiresARNError) Message() string { + return fmt.Sprintf( + "credential type %s requires role_arn, profile %s", + e.Type, e.Profile, + ) +} + +// OrigErr is the underlying error that caused the failure. +func (e CredentialRequiresARNError) OrigErr() error { + return nil +} + +// Error satisfies the error interface. +func (e CredentialRequiresARNError) Error() string { + return awserr.SprintError(e.Code(), e.Message(), "", nil) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index 523db79f8..8104793aa 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -687,7 +687,11 @@ func (ctx *signingCtx) buildBodyDigest() error { if !aws.IsReaderSeekable(ctx.Body) { return fmt.Errorf("cannot use unseekable request body %T, for signed request with body", ctx.Body) } - hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) + hashBytes, err := makeSha256Reader(ctx.Body) + if err != nil { + return err + } + hash = hex.EncodeToString(hashBytes) } if includeSHA256Header { @@ -734,10 +738,16 @@ func makeSha256(data []byte) []byte { return hash.Sum(nil) } -func makeSha256Reader(reader io.ReadSeeker) []byte { +func makeSha256Reader(reader io.ReadSeeker) (hashBytes []byte, err error) { hash := sha256.New() - start, _ := reader.Seek(0, sdkio.SeekCurrent) - defer reader.Seek(start, sdkio.SeekStart) + start, err := reader.Seek(0, sdkio.SeekCurrent) + if err != nil { + return nil, err + } + defer func() { + // ensure error is return if unable to seek back to start of payload. + _, err = reader.Seek(start, sdkio.SeekStart) + }() // Use CopyN to avoid allocating the 32KB buffer in io.Copy for bodies // smaller than 32KB. Fall back to io.Copy if we fail to determine the size. @@ -748,7 +758,7 @@ func makeSha256Reader(reader io.ReadSeeker) []byte { io.CopyN(hash, reader, size) } - return hash.Sum(nil) + return hash.Sum(nil), nil } const doubleSpace = " " diff --git a/vendor/github.com/aws/aws-sdk-go/aws/types.go b/vendor/github.com/aws/aws-sdk-go/aws/types.go index 8b6f23425..455091540 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/types.go @@ -7,13 +7,18 @@ import ( "github.com/aws/aws-sdk-go/internal/sdkio" ) -// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Should -// only be used with an io.Reader that is also an io.Seeker. Doing so may -// cause request signature errors, or request body's not sent for GET, HEAD -// and DELETE HTTP methods. +// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Allows the +// SDK to accept an io.Reader that is not also an io.Seeker for unsigned +// streaming payload API operations. // -// Deprecated: Should only be used with io.ReadSeeker. If using for -// S3 PutObject to stream content use s3manager.Uploader instead. +// A ReadSeekCloser wrapping an nonseekable io.Reader used in an API +// operation's input will prevent that operation being retried in the case of +// network errors, and cause operation requests to fail if the operation +// requires payload signing. +// +// Note: If using With S3 PutObject to stream an object upload The SDK's S3 +// Upload manager (s3manager.Uploader) provides support for streaming with the +// ability to retry network errors. func ReadSeekCloser(r io.Reader) ReaderSeekerCloser { return ReaderSeekerCloser{r} } @@ -43,7 +48,8 @@ func IsReaderSeekable(r io.Reader) bool { // Read reads from the reader up to size of p. The number of bytes read, and // error if it occurred will be returned. // -// If the reader is not an io.Reader zero bytes read, and nil error will be returned. +// If the reader is not an io.Reader zero bytes read, and nil error will be +// returned. // // Performs the same functionality as io.Reader Read func (r ReaderSeekerCloser) Read(p []byte) (int, error) { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index b82d20b7f..d1548ebd8 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.19.39" +const SDKVersion = "1.25.3" diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go index f99703372..e56dcee2f 100644 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go @@ -304,7 +304,9 @@ loop: stmt := newCommentStatement(tok) stack.Push(stmt) default: - return nil, NewParseError(fmt.Sprintf("invalid state with ASTKind %v and TokenType %v", k, tok)) + return nil, NewParseError( + fmt.Sprintf("invalid state with ASTKind %v and TokenType %v", + k, tok.Type())) } if len(tokens) > 0 { @@ -314,7 +316,7 @@ loop: // this occurs when a statement has not been completed if stack.top > 1 { - return nil, NewParseError(fmt.Sprintf("incomplete expression: %v", stack.container)) + return nil, NewParseError(fmt.Sprintf("incomplete ini expression")) } // returns a sublist which excludes the start symbol diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go new file mode 100644 index 000000000..6c443988b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go @@ -0,0 +1,12 @@ +package sdkio + +const ( + // Byte is 8 bits + Byte int64 = 1 + // KibiByte (KiB) is 1024 Bytes + KibiByte = Byte * 1024 + // MebiByte (MiB) is 1024 KiB + MebiByte = KibiByte * 1024 + // GibiByte (GiB) is 1024 MiB + GibiByte = MebiByte * 1024 +) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go new file mode 100644 index 000000000..44898eed0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go @@ -0,0 +1,15 @@ +// +build go1.10 + +package sdkmath + +import "math" + +// Round returns the nearest integer, rounding half away from zero. +// +// Special cases are: +// Round(±0) = ±0 +// Round(±Inf) = ±Inf +// Round(NaN) = NaN +func Round(x float64) float64 { + return math.Round(x) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go new file mode 100644 index 000000000..810ec7f08 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go @@ -0,0 +1,56 @@ +// +build !go1.10 + +package sdkmath + +import "math" + +// Copied from the Go standard library's (Go 1.12) math/floor.go for use in +// Go version prior to Go 1.10. +const ( + uvone = 0x3FF0000000000000 + mask = 0x7FF + shift = 64 - 11 - 1 + bias = 1023 + signMask = 1 << 63 + fracMask = 1<= 0.5 { + // return t + Copysign(1, x) + // } + // return t + // } + bits := math.Float64bits(x) + e := uint(bits>>shift) & mask + if e < bias { + // Round abs(x) < 1 including denormals. + bits &= signMask // +-0 + if e == bias-1 { + bits |= uvone // +-1 + } + } else if e < bias+shift { + // Round any abs(x) >= 1 containing a fractional component [0,1). + // + // Numbers with larger exponents are returned unchanged since they + // must be either an integer, infinity, or NaN. + const half = 1 << (shift - 1) + e -= bias + bits += half >> e + bits &^= fracMask >> e + } + return math.Float64frombits(bits) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go new file mode 100644 index 000000000..f4651da2d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go @@ -0,0 +1,11 @@ +// +build go1.6 + +package sdkrand + +import "math/rand" + +// Read provides the stub for math.Rand.Read method support for go version's +// 1.6 and greater. +func Read(r *rand.Rand, p []byte) (int, error) { + return r.Read(p) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go new file mode 100644 index 000000000..b1d93a33d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go @@ -0,0 +1,24 @@ +// +build !go1.6 + +package sdkrand + +import "math/rand" + +// Read backfills Go 1.6's math.Rand.Reader for Go 1.5 +func Read(r *rand.Rand, p []byte) (n int, err error) { + // Copy of Go standard libraries math package's read function not added to + // standard library until Go 1.6. + var pos int8 + var val int64 + for n = 0; n < len(p); n++ { + if pos == 0 { + val = r.Int63() + pos = 7 + } + p[n] = byte(val) + val >>= 8 + pos-- + } + + return n, err +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go index de021367d..74e361e07 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go @@ -146,6 +146,9 @@ func unmarshalStatusCode(v reflect.Value, statusCode int) { } func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error { + if len(headers) == 0 { + return nil + } switch r.Interface().(type) { case map[string]*string: // we only support string map value types out := map[string]*string{} @@ -155,19 +158,28 @@ func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) err out[k[len(prefix):]] = &v[0] } } - r.Set(reflect.ValueOf(out)) + if len(out) != 0 { + r.Set(reflect.ValueOf(out)) + } + } return nil } func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error { - isJSONValue := tag.Get("type") == "jsonvalue" - if isJSONValue { + switch tag.Get("type") { + case "jsonvalue": if len(header) == 0 { return nil } - } else if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { - return nil + case "blob": + if len(header) == 0 { + return nil + } + default: + if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { + return nil + } } switch v.Interface().(type) { @@ -178,7 +190,7 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro if err != nil { return err } - v.Set(reflect.ValueOf(&b)) + v.Set(reflect.ValueOf(b)) case *bool: b, err := strconv.ParseBool(header) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go index cf569645d..07a6187ea 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go @@ -39,7 +39,7 @@ func Build(r *request.Request) { r.Error = awserr.NewRequestFailure( awserr.New(request.ErrCodeSerialization, "failed to encode rest XML request", err), - r.HTTPResponse.StatusCode, + 0, r.RequestID, ) return diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go index b7ed6c6f8..05d4ff519 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go @@ -1,8 +1,11 @@ package protocol import ( + "math" "strconv" "time" + + "github.com/aws/aws-sdk-go/internal/sdkmath" ) // Names of time formats supported by the SDK @@ -13,12 +16,19 @@ const ( ) // Time formats supported by the SDK +// Output time is intended to not contain decimals const ( // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT" + // This format is used for output time without seconds precision + RFC822OutputTimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" + // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z - ISO8601TimeFormat = "2006-01-02T15:04:05Z" + ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z" + + // This format is used for output time without seconds precision + ISO8601OutputTimeFormat = "2006-01-02T15:04:05Z" ) // IsKnownTimestampFormat returns if the timestamp format name @@ -42,9 +52,9 @@ func FormatTime(name string, t time.Time) string { switch name { case RFC822TimeFormatName: - return t.Format(RFC822TimeFormat) + return t.Format(RFC822OutputTimeFormat) case ISO8601TimeFormatName: - return t.Format(ISO8601TimeFormat) + return t.Format(ISO8601OutputTimeFormat) case UnixTimeFormatName: return strconv.FormatInt(t.Unix(), 10) default: @@ -62,10 +72,12 @@ func ParseTime(formatName, value string) (time.Time, error) { return time.Parse(ISO8601TimeFormat, value) case UnixTimeFormatName: v, err := strconv.ParseFloat(value, 64) + _, dec := math.Modf(v) + dec = sdkmath.Round(dec*1e3) / 1e3 //Rounds 0.1229999 to 0.123 if err != nil { return time.Time{}, err } - return time.Unix(int64(v), 0), nil + return time.Unix(int64(v), int64(dec*(1e9))), nil default: panic("unknown timestamp format name, " + formatName) } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go new file mode 100644 index 000000000..c1a511851 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go @@ -0,0 +1,32 @@ +package xmlutil + +import ( + "encoding/xml" + "strings" +) + +type xmlAttrSlice []xml.Attr + +func (x xmlAttrSlice) Len() int { + return len(x) +} + +func (x xmlAttrSlice) Less(i, j int) bool { + spaceI, spaceJ := x[i].Name.Space, x[j].Name.Space + localI, localJ := x[i].Name.Local, x[j].Name.Local + valueI, valueJ := x[i].Value, x[j].Value + + spaceCmp := strings.Compare(spaceI, spaceJ) + localCmp := strings.Compare(localI, localJ) + valueCmp := strings.Compare(valueI, valueJ) + + if spaceCmp == -1 || (spaceCmp == 0 && (localCmp == -1 || (localCmp == 0 && valueCmp == -1))) { + return true + } + + return false +} + +func (x xmlAttrSlice) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go index 515ce1521..42f71648e 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go @@ -119,7 +119,18 @@ func (n *XMLNode) findElem(name string) (string, bool) { // StructToXML writes an XMLNode to a xml.Encoder as tokens. func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { - e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr}) + // Sort Attributes + attrs := node.Attr + if sorted { + sortedAttrs := make([]xml.Attr, len(attrs)) + for _, k := range node.Attr { + sortedAttrs = append(sortedAttrs, k) + } + sort.Sort(xmlAttrSlice(sortedAttrs)) + attrs = sortedAttrs + } + + e.EncodeToken(xml.StartElement{Name: node.Name, Attr: attrs}) if node.Text != "" { e.EncodeToken(xml.CharData([]byte(node.Text))) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index 06aabf1e6..b4a4e8c4a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -545,6 +545,10 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt // Deletes an analytics configuration for the bucket (specified by the analytics // configuration ID). // +// To use this operation, you must have permissions to perform the s3:PutAnalyticsConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3335,8 +3339,8 @@ func (c *S3) GetObjectLockConfigurationRequest(input *GetObjectLockConfiguration // GetObjectLockConfiguration API operation for Amazon Simple Storage Service. // -// Gets the Object Lock configuration for a bucket. The rule specified in the -// Object Lock configuration will be applied by default to every new object +// Gets the object lock configuration for a bucket. The rule specified in the +// object lock configuration will be applied by default to every new object // placed in the specified bucket. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -5754,8 +5758,7 @@ func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.R // PutBucketPolicy API operation for Amazon Simple Storage Service. // -// Replaces a policy on a bucket. If the bucket already has a policy, the one -// in this request completely replaces it. +// Applies an Amazon S3 bucket policy to an Amazon S3 bucket. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6439,8 +6442,8 @@ func (c *S3) PutObjectLockConfigurationRequest(input *PutObjectLockConfiguration // PutObjectLockConfiguration API operation for Amazon Simple Storage Service. // -// Places an Object Lock configuration on the specified bucket. The rule specified -// in the Object Lock configuration will be applied by default to every new +// Places an object lock configuration on the specified bucket. The rule specified +// in the object lock configuration will be applied by default to every new // object placed in the specified bucket. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -7010,13 +7013,16 @@ func (c *S3) UploadPartCopyWithContext(ctx aws.Context, input *UploadPartCopyInp return out, req.Send() } -// Specifies the days since the initiation of an Incomplete Multipart Upload -// that Lifecycle will wait before permanently removing all parts of the upload. +// Specifies the days since the initiation of an incomplete multipart upload +// that Amazon S3 will wait before permanently removing all parts of the upload. +// For more information, see Aborting Incomplete Multipart Uploads Using a Bucket +// Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) +// in the Amazon Simple Storage Service Developer Guide. type AbortIncompleteMultipartUpload struct { _ struct{} `type:"structure"` - // Indicates the number of days that must pass since initiation for Lifecycle - // to abort an Incomplete Multipart Upload. + // Specifies the number of days after which Amazon S3 aborts an incomplete multipart + // upload. DaysAfterInitiation *int64 `type:"integer"` } @@ -7037,11 +7043,15 @@ func (s *AbortIncompleteMultipartUpload) SetDaysAfterInitiation(v int64) *AbortI } type AbortMultipartUploadInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"AbortMultipartUploadRequest" type:"structure"` + // Name of the bucket to which the multipart upload was initiated. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Key of the object for which the multipart upload was initiated. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -7051,6 +7061,8 @@ type AbortMultipartUploadInput struct { // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + // Upload ID that identifies the multipart upload. + // // UploadId is a required field UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` } @@ -7145,10 +7157,13 @@ func (s *AbortMultipartUploadOutput) SetRequestCharged(v string) *AbortMultipart return s } +// Configures the transfer acceleration state for an Amazon S3 bucket. For more +// information, see Amazon S3 Transfer Acceleration (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) +// in the Amazon Simple Storage Service Developer Guide. type AccelerateConfiguration struct { _ struct{} `type:"structure"` - // The accelerate configuration of the bucket. + // Specifies the transfer acceleration status of the bucket. Status *string `type:"string" enum:"BucketAccelerateStatus"` } @@ -7168,12 +7183,14 @@ func (s *AccelerateConfiguration) SetStatus(v string) *AccelerateConfiguration { return s } +// Contains the elements that set the ACL permissions for an object per grantee. type AccessControlPolicy struct { _ struct{} `type:"structure"` // A list of grants. Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` + // Container for the bucket owner's display name and ID. Owner *Owner `type:"structure"` } @@ -7223,7 +7240,9 @@ func (s *AccessControlPolicy) SetOwner(v *Owner) *AccessControlPolicy { type AccessControlTranslation struct { _ struct{} `type:"structure"` - // The override value for the owner of the replica object. + // Specifies the replica ownership. For default and valid values, see PUT bucket + // replication (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) + // in the Amazon Simple Storage Service API Reference. // // Owner is a required field Owner *string `type:"string" required:"true" enum:"OwnerOverride"` @@ -7258,10 +7277,14 @@ func (s *AccessControlTranslation) SetOwner(v string) *AccessControlTranslation return s } +// A conjunction (logical AND) of predicates, which is used in evaluating a +// metrics filter. The operator must have at least two predicates in any combination, +// and an object must match all of the predicates for the filter to apply. type AnalyticsAndOperator struct { _ struct{} `type:"structure"` - // The prefix to use when evaluating an AND predicate. + // The prefix to use when evaluating an AND predicate: The prefix that an object + // must have to be included in the metrics results. Prefix *string `type:"string"` // The list of tags to use when evaluating an AND predicate. @@ -7310,6 +7333,11 @@ func (s *AnalyticsAndOperator) SetTags(v []*Tag) *AnalyticsAndOperator { return s } +// Specifies the configuration and any analyses for the analytics filter of +// an Amazon S3 bucket. +// +// For more information, see GET Bucket analytics (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETAnalyticsConfig.html) +// in the Amazon Simple Storage Service API Reference. type AnalyticsConfiguration struct { _ struct{} `type:"structure"` @@ -7318,13 +7346,13 @@ type AnalyticsConfiguration struct { // If no filter is provided, all objects will be considered in any analysis. Filter *AnalyticsFilter `type:"structure"` - // The identifier used to represent an analytics configuration. + // The ID that identifies the analytics configuration. // // Id is a required field Id *string `type:"string" required:"true"` - // If present, it indicates that data related to access patterns will be collected - // and made available to analyze the tradeoffs between different storage classes. + // Contains data related to access patterns to be collected and made available + // to analyze the tradeoffs between different storage classes. // // StorageClassAnalysis is a required field StorageClassAnalysis *StorageClassAnalysis `type:"structure" required:"true"` @@ -7384,6 +7412,7 @@ func (s *AnalyticsConfiguration) SetStorageClassAnalysis(v *StorageClassAnalysis return s } +// Where to publish the analytics results. type AnalyticsExportDestination struct { _ struct{} `type:"structure"` @@ -7492,7 +7521,7 @@ func (s *AnalyticsFilter) SetTag(v *Tag) *AnalyticsFilter { type AnalyticsS3BucketDestination struct { _ struct{} `type:"structure"` - // The Amazon resource name (ARN) of the bucket to which data is exported. + // The Amazon Resource Name (ARN) of the bucket to which data is exported. // // Bucket is a required field Bucket *string `type:"string" required:"true"` @@ -7501,13 +7530,12 @@ type AnalyticsS3BucketDestination struct { // the owner will not be validated prior to exporting data. BucketAccountId *string `type:"string"` - // The file format used when exporting data to Amazon S3. + // Specifies the file format used when exporting data to Amazon S3. // // Format is a required field Format *string `type:"string" required:"true" enum:"AnalyticsS3ExportFileFormat"` - // The prefix to use when exporting data. The exported data begins with this - // prefix. + // The prefix to use when exporting data. The prefix is prepended to all results. Prefix *string `type:"string"` } @@ -7600,9 +7628,14 @@ func (s *Bucket) SetName(v string) *Bucket { return s } +// Specifies the lifecycle configuration for objects in an Amazon S3 bucket. +// For more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) +// in the Amazon Simple Storage Service Developer Guide. type BucketLifecycleConfiguration struct { _ struct{} `type:"structure"` + // A lifecycle rule for individual objects in an Amazon S3 bucket. + // // Rules is a required field Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` } @@ -7649,9 +7682,10 @@ func (s *BucketLifecycleConfiguration) SetRules(v []*LifecycleRule) *BucketLifec type BucketLoggingStatus struct { _ struct{} `type:"structure"` - // Container for logging information. Presence of this element indicates that - // logging is enabled. Parameters TargetBucket and TargetPrefix are required - // in this case. + // Describes where logs are stored and the prefix that Amazon S3 assigns to + // all log object keys for a bucket. For more information, see PUT Bucket logging + // (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) + // in the Amazon Simple Storage Service API Reference. LoggingEnabled *LoggingEnabled `type:"structure"` } @@ -7686,9 +7720,15 @@ func (s *BucketLoggingStatus) SetLoggingEnabled(v *LoggingEnabled) *BucketLoggin return s } +// Describes the cross-origin access configuration for objects in an Amazon +// S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon +// Simple Storage Service Developer Guide. type CORSConfiguration struct { _ struct{} `type:"structure"` + // A set of allowed origins and methods. + // // CORSRules is a required field CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true" required:"true"` } @@ -7732,14 +7772,18 @@ func (s *CORSConfiguration) SetCORSRules(v []*CORSRule) *CORSConfiguration { return s } +// Specifies a cross-origin access rule for an Amazon S3 bucket. type CORSRule struct { _ struct{} `type:"structure"` - // Specifies which headers are allowed in a pre-flight OPTIONS request. + // Headers that are specified in the Access-Control-Request-Headers header. + // These headers are allowed in a preflight OPTIONS request. In response to + // any preflight OPTIONS request, Amazon S3 returns any requested headers that + // are allowed. AllowedHeaders []*string `locationName:"AllowedHeader" type:"list" flattened:"true"` - // Identifies HTTP methods that the domain/origin specified in the rule is allowed - // to execute. + // An HTTP method that you allow the origin to execute. Valid values are GET, + // PUT, HEAD, POST, and DELETE. // // AllowedMethods is a required field AllowedMethods []*string `locationName:"AllowedMethod" type:"list" flattened:"true" required:"true"` @@ -8040,7 +8084,7 @@ func (s *CommonPrefix) SetPrefix(v string) *CommonPrefix { } type CompleteMultipartUploadInput struct { - _ struct{} `type:"structure" payload:"MultipartUpload"` + _ struct{} `locationName:"CompleteMultipartUploadRequest" type:"structure" payload:"MultipartUpload"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -8290,6 +8334,7 @@ func (s *CompletedPart) SetPartNumber(v int64) *CompletedPart { return s } +// Specifies a condition that must be met for a redirect to apply. type Condition struct { _ struct{} `type:"structure"` @@ -8359,7 +8404,7 @@ func (s *ContinuationEvent) UnmarshalEvent( } type CopyObjectInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"CopyObjectRequest" type:"structure"` // The canned ACL to apply to the object. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` @@ -8444,10 +8489,10 @@ type CopyObjectInput struct { // Specifies whether you want to apply a Legal Hold to the copied object. ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // The Object Lock mode that you want to apply to the copied object. + // The object lock mode that you want to apply to the copied object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // The date and time when you want the copied object's Object Lock to expire. + // The date and time when you want the copied object's object lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` // Confirms that the requester knows that she or he will be charged for the @@ -8471,6 +8516,11 @@ type CopyObjectInput struct { // key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + // Specifies the AWS KMS Encryption Context to use for object encryption. The + // value of this header is a base64-encoded UTF-8 string holding JSON with the + // encryption context key-value pairs. + SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` + // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT // requests for an object protected by AWS KMS will fail if not made via SSL // or using SigV4. Documentation on configuring any of the officially supported @@ -8735,6 +8785,12 @@ func (s *CopyObjectInput) SetSSECustomerKeyMD5(v string) *CopyObjectInput { return s } +// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. +func (s *CopyObjectInput) SetSSEKMSEncryptionContext(v string) *CopyObjectInput { + s.SSEKMSEncryptionContext = &v + return s +} + // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. func (s *CopyObjectInput) SetSSEKMSKeyId(v string) *CopyObjectInput { s.SSEKMSKeyId = &v @@ -8795,6 +8851,11 @@ type CopyObjectOutput struct { // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + // If present, specifies the AWS KMS Encryption Context to use for object encryption. + // The value of this header is a base64-encoded UTF-8 string holding JSON with + // the encryption context key-value pairs. + SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` + // If present, specifies the ID of the AWS Key Management Service (KMS) master // encryption key that was used for the object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` @@ -8853,6 +8914,12 @@ func (s *CopyObjectOutput) SetSSECustomerKeyMD5(v string) *CopyObjectOutput { return s } +// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. +func (s *CopyObjectOutput) SetSSEKMSEncryptionContext(v string) *CopyObjectOutput { + s.SSEKMSEncryptionContext = &v + return s +} + // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. func (s *CopyObjectOutput) SetSSEKMSKeyId(v string) *CopyObjectOutput { s.SSEKMSKeyId = &v @@ -8958,7 +9025,7 @@ func (s *CreateBucketConfiguration) SetLocationConstraint(v string) *CreateBucke } type CreateBucketInput struct { - _ struct{} `type:"structure" payload:"CreateBucketConfiguration"` + _ struct{} `locationName:"CreateBucketRequest" type:"structure" payload:"CreateBucketConfiguration"` // The canned ACL to apply to the bucket. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` @@ -8984,7 +9051,8 @@ type CreateBucketInput struct { // Allows grantee to write the ACL for the applicable bucket. GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - // Specifies whether you want S3 Object Lock to be enabled for the new bucket. + // Specifies whether you want Amazon S3 object lock to be enabled for the new + // bucket. ObjectLockEnabledForBucket *bool `location:"header" locationName:"x-amz-bucket-object-lock-enabled" type:"boolean"` } @@ -9098,7 +9166,7 @@ func (s *CreateBucketOutput) SetLocation(v string) *CreateBucketOutput { } type CreateMultipartUploadInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"CreateMultipartUploadRequest" type:"structure"` // The canned ACL to apply to the object. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` @@ -9147,10 +9215,10 @@ type CreateMultipartUploadInput struct { // Specifies whether you want to apply a Legal Hold to the uploaded object. ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // Specifies the Object Lock mode that you want to apply to the uploaded object. + // Specifies the object lock mode that you want to apply to the uploaded object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // Specifies the date and time when you want the Object Lock to expire. + // Specifies the date and time when you want the object lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` // Confirms that the requester knows that she or he will be charged for the @@ -9174,6 +9242,11 @@ type CreateMultipartUploadInput struct { // key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + // Specifies the AWS KMS Encryption Context to use for object encryption. The + // value of this header is a base64-encoded UTF-8 string holding JSON with the + // encryption context key-value pairs. + SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` + // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT // requests for an object protected by AWS KMS will fail if not made via SSL // or using SigV4. Documentation on configuring any of the officially supported @@ -9368,6 +9441,12 @@ func (s *CreateMultipartUploadInput) SetSSECustomerKeyMD5(v string) *CreateMulti return s } +// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. +func (s *CreateMultipartUploadInput) SetSSEKMSEncryptionContext(v string) *CreateMultipartUploadInput { + s.SSEKMSEncryptionContext = &v + return s +} + // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. func (s *CreateMultipartUploadInput) SetSSEKMSKeyId(v string) *CreateMultipartUploadInput { s.SSEKMSKeyId = &v @@ -9428,6 +9507,11 @@ type CreateMultipartUploadOutput struct { // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + // If present, specifies the AWS KMS Encryption Context to use for object encryption. + // The value of this header is a base64-encoded UTF-8 string holding JSON with + // the encryption context key-value pairs. + SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` + // If present, specifies the ID of the AWS Key Management Service (KMS) master // encryption key that was used for the object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` @@ -9499,6 +9583,12 @@ func (s *CreateMultipartUploadOutput) SetSSECustomerKeyMD5(v string) *CreateMult return s } +// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. +func (s *CreateMultipartUploadOutput) SetSSEKMSEncryptionContext(v string) *CreateMultipartUploadOutput { + s.SSEKMSEncryptionContext = &v + return s +} + // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. func (s *CreateMultipartUploadOutput) SetSSEKMSKeyId(v string) *CreateMultipartUploadOutput { s.SSEKMSKeyId = &v @@ -9517,7 +9607,7 @@ func (s *CreateMultipartUploadOutput) SetUploadId(v string) *CreateMultipartUplo return s } -// The container element for specifying the default Object Lock retention settings +// The container element for specifying the default object lock retention settings // for new objects placed in the specified bucket. type DefaultRetention struct { _ struct{} `type:"structure"` @@ -9525,7 +9615,7 @@ type DefaultRetention struct { // The number of days that you want to specify for the default retention period. Days *int64 `type:"integer"` - // The default Object Lock retention mode you want to apply to new objects placed + // The default object lock retention mode you want to apply to new objects placed // in the specified bucket. Mode *string `type:"string" enum:"ObjectLockRetentionMode"` @@ -9618,14 +9708,14 @@ func (s *Delete) SetQuiet(v bool) *Delete { } type DeleteBucketAnalyticsConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketAnalyticsConfigurationRequest" type:"structure"` // The name of the bucket from which an analytics configuration is deleted. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The identifier used to represent an analytics configuration. + // The ID that identifies the analytics configuration. // // Id is a required field Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` @@ -9694,7 +9784,7 @@ func (s DeleteBucketAnalyticsConfigurationOutput) GoString() string { } type DeleteBucketCorsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketCorsRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -9754,7 +9844,7 @@ func (s DeleteBucketCorsOutput) GoString() string { } type DeleteBucketEncryptionInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketEncryptionRequest" type:"structure"` // The name of the bucket containing the server-side encryption configuration // to delete. @@ -9817,7 +9907,7 @@ func (s DeleteBucketEncryptionOutput) GoString() string { } type DeleteBucketInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -9863,7 +9953,7 @@ func (s *DeleteBucketInput) getBucket() (v string) { } type DeleteBucketInventoryConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketInventoryConfigurationRequest" type:"structure"` // The name of the bucket containing the inventory configuration to delete. // @@ -9939,7 +10029,7 @@ func (s DeleteBucketInventoryConfigurationOutput) GoString() string { } type DeleteBucketLifecycleInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketLifecycleRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -9999,7 +10089,7 @@ func (s DeleteBucketLifecycleOutput) GoString() string { } type DeleteBucketMetricsConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketMetricsConfigurationRequest" type:"structure"` // The name of the bucket containing the metrics configuration to delete. // @@ -10089,7 +10179,7 @@ func (s DeleteBucketOutput) GoString() string { } type DeleteBucketPolicyInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketPolicyRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -10149,7 +10239,7 @@ func (s DeleteBucketPolicyOutput) GoString() string { } type DeleteBucketReplicationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketReplicationRequest" type:"structure"` // The bucket name. // @@ -10214,7 +10304,7 @@ func (s DeleteBucketReplicationOutput) GoString() string { } type DeleteBucketTaggingInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketTaggingRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -10274,7 +10364,7 @@ func (s DeleteBucketTaggingOutput) GoString() string { } type DeleteBucketWebsiteInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteBucketWebsiteRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -10420,12 +10510,12 @@ func (s *DeleteMarkerReplication) SetStatus(v string) *DeleteMarkerReplication { } type DeleteObjectInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteObjectRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Indicates whether S3 Object Lock should bypass Governance-mode restrictions + // Indicates whether Amazon S3 object lock should bypass governance-mode restrictions // to process this operation. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` @@ -10566,7 +10656,7 @@ func (s *DeleteObjectOutput) SetVersionId(v string) *DeleteObjectOutput { } type DeleteObjectTaggingInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeleteObjectTaggingRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -10659,13 +10749,13 @@ func (s *DeleteObjectTaggingOutput) SetVersionId(v string) *DeleteObjectTaggingO } type DeleteObjectsInput struct { - _ struct{} `type:"structure" payload:"Delete"` + _ struct{} `locationName:"DeleteObjectsRequest" type:"structure" payload:"Delete"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // Specifies whether you want to delete this object even if it has a Governance-type - // Object Lock in place. You must have sufficient permissions to perform this + // object lock in place. You must have sufficient permissions to perform this // operation. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` @@ -10795,7 +10885,7 @@ func (s *DeleteObjectsOutput) SetRequestCharged(v string) *DeleteObjectsOutput { } type DeletePublicAccessBlockInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"DeletePublicAccessBlockRequest" type:"structure"` // The Amazon S3 bucket whose PublicAccessBlock configuration you want to delete. // @@ -10902,33 +10992,33 @@ func (s *DeletedObject) SetVersionId(v string) *DeletedObject { return s } -// A container for information about the replication destination. +// Specifies information about where to publish analysis or configuration results +// for an Amazon S3 bucket. type Destination struct { _ struct{} `type:"structure"` - // A container for information about access control for replicas. - // - // Use this element only in a cross-account scenario where source and destination - // bucket owners are not the same to change replica ownership to the AWS account - // that owns the destination bucket. If you don't add this element to the replication - // configuration, the replicas are owned by same AWS account that owns the source - // object. + // Specify this only in a cross-account scenario (where source and destination + // bucket owners are not the same), and you want to change replica ownership + // to the AWS account that owns the destination bucket. If this is not specified + // in the replication configuration, the replicas are owned by same AWS account + // that owns the source object. AccessControlTranslation *AccessControlTranslation `type:"structure"` - // The account ID of the destination bucket. Currently, Amazon S3 verifies this - // value only if Access Control Translation is enabled. - // - // In a cross-account scenario, if you change replica ownership to the AWS account - // that owns the destination bucket by adding the AccessControlTranslation element, - // this is the account ID of the owner of the destination bucket. + // Destination bucket owner account ID. In a cross-account scenario, if you + // direct Amazon S3 to change replica ownership to the AWS account that owns + // the destination bucket by specifying the AccessControlTranslation property, + // this is the account ID of the destination bucket owner. For more information, + // see Cross-Region Replication Additional Configuration: Change Replica Owner + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-change-owner.html) in + // the Amazon Simple Storage Service Developer Guide. Account *string `type:"string"` // The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to // store replicas of the object identified by the rule. // - // If there are multiple rules in your replication configuration, all rules - // must specify the same bucket as the destination. A replication configuration - // can replicate objects to only one destination bucket. + // A replication configuration can replicate objects to only one destination + // bucket. If there are multiple rules in your replication configuration, all + // rules must specify the same destination bucket. // // Bucket is a required field Bucket *string `type:"string" required:"true"` @@ -10937,8 +11027,13 @@ type Destination struct { // is specified, you must specify this element. EncryptionConfiguration *EncryptionConfiguration `type:"structure"` - // The class of storage used to store the object. By default Amazon S3 uses - // storage class of the source object when creating a replica. + // The storage class to use when replicating objects, such as standard or reduced + // redundancy. By default, Amazon S3 uses the storage class of the source object + // to create the object replica. + // + // For valid values, see the StorageClass element of the PUT Bucket replication + // (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) + // action in the Amazon Simple Storage Service API Reference. StorageClass *string `type:"string" enum:"StorageClass"` } @@ -11068,13 +11163,13 @@ func (s *Encryption) SetKMSKeyId(v string) *Encryption { return s } -// A container for information about the encryption-based configuration for -// replicas. +// Specifies encryption-related information for an Amazon S3 bucket that is +// a destination for replicated objects. type EncryptionConfiguration struct { _ struct{} `type:"structure"` - // The ID of the AWS KMS key for the AWS Region where the destination bucket - // resides. Amazon S3 uses this key to encrypt the replica object. + // Specifies the AWS KMS Key ID (Key ARN or Alias ARN) for the destination bucket. + // Amazon S3 uses this key to encrypt replica objects. ReplicaKmsKeyID *string `type:"string"` } @@ -11207,18 +11302,19 @@ func (s *ErrorDocument) SetKey(v string) *ErrorDocument { return s } -// A container for a key value pair that defines the criteria for the filter -// rule. +// Specifies the Amazon S3 object key name to filter on and whether to filter +// on the suffix or prefix of the key name. type FilterRule struct { _ struct{} `type:"structure"` // The object key name prefix or suffix identifying one or more objects to which - // the filtering rule applies. The maximum prefix length is 1,024 characters. - // Overlapping prefixes and suffixes are not supported. For more information, - // see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // the filtering rule applies. The maximum length is 1,024 characters. Overlapping + // prefixes and suffixes are not supported. For more information, see Configuring + // Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) // in the Amazon Simple Storage Service Developer Guide. Name *string `type:"string" enum:"FilterRuleName"` + // The value that the filter searches for in object key names. Value *string `type:"string"` } @@ -11245,7 +11341,7 @@ func (s *FilterRule) SetValue(v string) *FilterRule { } type GetBucketAccelerateConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketAccelerateConfigurationRequest" type:"structure"` // Name of the bucket for which the accelerate configuration is retrieved. // @@ -11316,7 +11412,7 @@ func (s *GetBucketAccelerateConfigurationOutput) SetStatus(v string) *GetBucketA } type GetBucketAclInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketAclRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -11393,14 +11489,14 @@ func (s *GetBucketAclOutput) SetOwner(v *Owner) *GetBucketAclOutput { } type GetBucketAnalyticsConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketAnalyticsConfigurationRequest" type:"structure"` // The name of the bucket from which an analytics configuration is retrieved. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The identifier used to represent an analytics configuration. + // The ID that identifies the analytics configuration. // // Id is a required field Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` @@ -11478,7 +11574,7 @@ func (s *GetBucketAnalyticsConfigurationOutput) SetAnalyticsConfiguration(v *Ana } type GetBucketCorsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketCorsRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -11546,7 +11642,7 @@ func (s *GetBucketCorsOutput) SetCORSRules(v []*CORSRule) *GetBucketCorsOutput { } type GetBucketEncryptionInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketEncryptionRequest" type:"structure"` // The name of the bucket from which the server-side encryption configuration // is retrieved. @@ -11597,8 +11693,7 @@ func (s *GetBucketEncryptionInput) getBucket() (v string) { type GetBucketEncryptionOutput struct { _ struct{} `type:"structure" payload:"ServerSideEncryptionConfiguration"` - // Container for server-side encryption configuration rules. Currently S3 supports - // one rule only. + // Specifies the default server-side-encryption configuration. ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `type:"structure"` } @@ -11619,7 +11714,7 @@ func (s *GetBucketEncryptionOutput) SetServerSideEncryptionConfiguration(v *Serv } type GetBucketInventoryConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketInventoryConfigurationRequest" type:"structure"` // The name of the bucket containing the inventory configuration to retrieve. // @@ -11704,7 +11799,7 @@ func (s *GetBucketInventoryConfigurationOutput) SetInventoryConfiguration(v *Inv } type GetBucketLifecycleConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketLifecycleConfigurationRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -11772,7 +11867,7 @@ func (s *GetBucketLifecycleConfigurationOutput) SetRules(v []*LifecycleRule) *Ge } type GetBucketLifecycleInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketLifecycleRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -11840,7 +11935,7 @@ func (s *GetBucketLifecycleOutput) SetRules(v []*Rule) *GetBucketLifecycleOutput } type GetBucketLocationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketLocationRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -11908,7 +12003,7 @@ func (s *GetBucketLocationOutput) SetLocationConstraint(v string) *GetBucketLoca } type GetBucketLoggingInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketLoggingRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -11956,9 +12051,10 @@ func (s *GetBucketLoggingInput) getBucket() (v string) { type GetBucketLoggingOutput struct { _ struct{} `type:"structure"` - // Container for logging information. Presence of this element indicates that - // logging is enabled. Parameters TargetBucket and TargetPrefix are required - // in this case. + // Describes where logs are stored and the prefix that Amazon S3 assigns to + // all log object keys for a bucket. For more information, see PUT Bucket logging + // (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) + // in the Amazon Simple Storage Service API Reference. LoggingEnabled *LoggingEnabled `type:"structure"` } @@ -11979,7 +12075,7 @@ func (s *GetBucketLoggingOutput) SetLoggingEnabled(v *LoggingEnabled) *GetBucket } type GetBucketMetricsConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketMetricsConfigurationRequest" type:"structure"` // The name of the bucket containing the metrics configuration to retrieve. // @@ -12064,7 +12160,7 @@ func (s *GetBucketMetricsConfigurationOutput) SetMetricsConfiguration(v *Metrics } type GetBucketNotificationConfigurationRequest struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketNotificationConfigurationRequest" type:"structure"` // Name of the bucket to get the notification configuration for. // @@ -12112,7 +12208,7 @@ func (s *GetBucketNotificationConfigurationRequest) getBucket() (v string) { } type GetBucketPolicyInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketPolicyRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12181,7 +12277,7 @@ func (s *GetBucketPolicyOutput) SetPolicy(v string) *GetBucketPolicyOutput { } type GetBucketPolicyStatusInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketPolicyStatusRequest" type:"structure"` // The name of the Amazon S3 bucket whose policy status you want to retrieve. // @@ -12252,7 +12348,7 @@ func (s *GetBucketPolicyStatusOutput) SetPolicyStatus(v *PolicyStatus) *GetBucke } type GetBucketReplicationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketReplicationRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12322,7 +12418,7 @@ func (s *GetBucketReplicationOutput) SetReplicationConfiguration(v *ReplicationC } type GetBucketRequestPaymentInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketRequestPaymentRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12391,7 +12487,7 @@ func (s *GetBucketRequestPaymentOutput) SetPayer(v string) *GetBucketRequestPaym } type GetBucketTaggingInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketTaggingRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12460,7 +12556,7 @@ func (s *GetBucketTaggingOutput) SetTagSet(v []*Tag) *GetBucketTaggingOutput { } type GetBucketVersioningInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketVersioningRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12540,7 +12636,7 @@ func (s *GetBucketVersioningOutput) SetStatus(v string) *GetBucketVersioningOutp } type GetBucketWebsiteInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetBucketWebsiteRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12592,6 +12688,8 @@ type GetBucketWebsiteOutput struct { IndexDocument *IndexDocument `type:"structure"` + // Specifies the redirect behavior of all requests to a website endpoint of + // an Amazon S3 bucket. RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` @@ -12632,7 +12730,7 @@ func (s *GetBucketWebsiteOutput) SetRoutingRules(v []*RoutingRule) *GetBucketWeb } type GetObjectAclInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetObjectAclRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12755,7 +12853,7 @@ func (s *GetObjectAclOutput) SetRequestCharged(v string) *GetObjectAclOutput { } type GetObjectInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetObjectRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12992,7 +13090,7 @@ func (s *GetObjectInput) SetVersionId(v string) *GetObjectInput { } type GetObjectLegalHoldInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetObjectLegalHoldRequest" type:"structure"` // The bucket containing the object whose Legal Hold status you want to retrieve. // @@ -13101,9 +13199,9 @@ func (s *GetObjectLegalHoldOutput) SetLegalHold(v *ObjectLockLegalHold) *GetObje } type GetObjectLockConfigurationInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetObjectLockConfigurationRequest" type:"structure"` - // The bucket whose Object Lock configuration you want to retrieve. + // The bucket whose object lock configuration you want to retrieve. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -13151,7 +13249,7 @@ func (s *GetObjectLockConfigurationInput) getBucket() (v string) { type GetObjectLockConfigurationOutput struct { _ struct{} `type:"structure" payload:"ObjectLockConfiguration"` - // The specified bucket's Object Lock configuration. + // The specified bucket's object lock configuration. ObjectLockConfiguration *ObjectLockConfiguration `type:"structure"` } @@ -13235,10 +13333,10 @@ type GetObjectOutput struct { // returned if you have permission to view an object's legal hold status. ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // The Object Lock mode currently in place for this object. + // The object lock mode currently in place for this object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // The date and time when this object's Object Lock will expire. + // The date and time when this object's object lock will expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` // The count of parts this object has. @@ -13483,7 +13581,7 @@ func (s *GetObjectOutput) SetWebsiteRedirectLocation(v string) *GetObjectOutput } type GetObjectRetentionInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetObjectRetentionRequest" type:"structure"` // The bucket containing the object whose retention settings you want to retrieve. // @@ -13592,7 +13690,7 @@ func (s *GetObjectRetentionOutput) SetRetention(v *ObjectLockRetention) *GetObje } type GetObjectTaggingInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetObjectTaggingRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -13692,7 +13790,7 @@ func (s *GetObjectTaggingOutput) SetVersionId(v string) *GetObjectTaggingOutput } type GetObjectTorrentInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetObjectTorrentRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -13797,7 +13895,7 @@ func (s *GetObjectTorrentOutput) SetRequestCharged(v string) *GetObjectTorrentOu } type GetPublicAccessBlockInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"GetPublicAccessBlockRequest" type:"structure"` // The name of the Amazon S3 bucket whose PublicAccessBlock configuration you // want to retrieve. @@ -14028,7 +14126,7 @@ func (s *Grantee) SetURI(v string) *Grantee { } type HeadBucketInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"HeadBucketRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -14088,7 +14186,7 @@ func (s HeadBucketOutput) GoString() string { } type HeadObjectInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"HeadObjectRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -14328,10 +14426,10 @@ type HeadObjectOutput struct { // The Legal Hold status for the specified object. ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // The Object Lock mode currently in place for this object. + // The object lock mode currently in place for this object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // The date and time when this object's Object Lock will expire. + // The date and time when this object's object lock expires. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` // The count of parts this object has. @@ -14680,6 +14778,9 @@ func (s *InputSerialization) SetParquet(v *ParquetInput) *InputSerialization { return s } +// Specifies the inventory configuration for an Amazon S3 bucket. For more information, +// see GET Bucket inventory (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html) +// in the Amazon Simple Storage Service API Reference. type InventoryConfiguration struct { _ struct{} `type:"structure"` @@ -14697,12 +14798,16 @@ type InventoryConfiguration struct { // Id is a required field Id *string `type:"string" required:"true"` - // Specifies which object version(s) to included in the inventory results. + // Object versions to include in the inventory list. If set to All, the list + // includes all the object versions, which adds the version-related fields VersionId, + // IsLatest, and DeleteMarker to the list. If set to Current, the list does + // not contain these version-related fields. // // IncludedObjectVersions is a required field IncludedObjectVersions *string `type:"string" required:"true" enum:"InventoryIncludedObjectVersions"` - // Specifies whether the inventory is enabled or disabled. + // Specifies whether the inventory is enabled or disabled. If set to True, an + // inventory list is generated. If set to False, no inventory list is generated. // // IsEnabled is a required field IsEnabled *bool `type:"boolean" required:"true"` @@ -15145,11 +15250,15 @@ func (s *KeyFilter) SetFilterRules(v []*FilterRule) *KeyFilter { type LambdaFunctionConfiguration struct { _ struct{} `type:"structure"` + // The Amazon S3 bucket event for which to invoke the AWS Lambda function. For + // more information, see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Events is a required field Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` - // A container for object key name filtering rules. For information about key - // name filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // Specifies object key name filtering rules. For information about key name + // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) // in the Amazon Simple Storage Service Developer Guide. Filter *NotificationConfigurationFilter `type:"structure"` @@ -15157,8 +15266,8 @@ type LambdaFunctionConfiguration struct { // If you don't provide one, Amazon S3 will assign an ID. Id *string `type:"string"` - // The Amazon Resource Name (ARN) of the Lambda cloud function that Amazon S3 - // can invoke when it detects events of the specified type. + // The Amazon Resource Name (ARN) of the AWS Lambda function that Amazon S3 + // invokes when the specified event type occurs. // // LambdaFunctionArn is a required field LambdaFunctionArn *string `locationName:"CloudFunction" type:"string" required:"true"` @@ -15309,8 +15418,11 @@ func (s *LifecycleExpiration) SetExpiredObjectDeleteMarker(v bool) *LifecycleExp type LifecycleRule struct { _ struct{} `type:"structure"` - // Specifies the days since the initiation of an Incomplete Multipart Upload - // that Lifecycle will wait before permanently removing all parts of the upload. + // Specifies the days since the initiation of an incomplete multipart upload + // that Amazon S3 will wait before permanently removing all parts of the upload. + // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket + // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) + // in the Amazon Simple Storage Service Developer Guide. AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` Expiration *LifecycleExpiration `type:"structure"` @@ -15549,7 +15661,7 @@ func (s *LifecycleRuleFilter) SetTag(v *Tag) *LifecycleRuleFilter { } type ListBucketAnalyticsConfigurationsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"ListBucketAnalyticsConfigurationsRequest" type:"structure"` // The name of the bucket from which analytics configurations are retrieved. // @@ -15661,7 +15773,7 @@ func (s *ListBucketAnalyticsConfigurationsOutput) SetNextContinuationToken(v str } type ListBucketInventoryConfigurationsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"ListBucketInventoryConfigurationsRequest" type:"structure"` // The name of the bucket containing the inventory configurations to retrieve. // @@ -15775,7 +15887,7 @@ func (s *ListBucketInventoryConfigurationsOutput) SetNextContinuationToken(v str } type ListBucketMetricsConfigurationsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"ListBucketMetricsConfigurationsRequest" type:"structure"` // The name of the bucket containing the metrics configurations to retrieve. // @@ -15935,7 +16047,7 @@ func (s *ListBucketsOutput) SetOwner(v *Owner) *ListBucketsOutput { } type ListMultipartUploadsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"ListMultipartUploadsRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -16179,7 +16291,7 @@ func (s *ListMultipartUploadsOutput) SetUploads(v []*MultipartUpload) *ListMulti } type ListObjectVersionsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"ListObjectVersionsRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -16412,7 +16524,7 @@ func (s *ListObjectVersionsOutput) SetVersions(v []*ObjectVersion) *ListObjectVe } type ListObjectsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"ListObjectsRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -16624,7 +16736,7 @@ func (s *ListObjectsOutput) SetPrefix(v string) *ListObjectsOutput { } type ListObjectsV2Input struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"ListObjectsV2Request" type:"structure"` // Name of the bucket to list. // @@ -16885,7 +16997,7 @@ func (s *ListObjectsV2Output) SetStartAfter(v string) *ListObjectsV2Output { } type ListPartsInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"ListPartsRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -17267,9 +17379,10 @@ func (s *Location) SetUserMetadata(v []*MetadataEntry) *Location { return s } -// Container for logging information. Presence of this element indicates that -// logging is enabled. Parameters TargetBucket and TargetPrefix are required -// in this case. +// Describes where logs are stored and the prefix that Amazon S3 assigns to +// all log object keys for a bucket. For more information, see PUT Bucket logging +// (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) +// in the Amazon Simple Storage Service API Reference. type LoggingEnabled struct { _ struct{} `type:"structure"` @@ -17285,8 +17398,9 @@ type LoggingEnabled struct { TargetGrants []*TargetGrant `locationNameList:"Grant" type:"list"` - // This element lets you specify a prefix for the keys that the log files will - // be stored under. + // A prefix for all log object keys. If you store log files from multiple Amazon + // S3 buckets in a single bucket, you can use a prefix to distinguish which + // log files came from which bucket. // // TargetPrefix is a required field TargetPrefix *string `type:"string" required:"true"` @@ -17429,6 +17543,13 @@ func (s *MetricsAndOperator) SetTags(v []*Tag) *MetricsAndOperator { return s } +// Specifies a metrics configuration for the CloudWatch request metrics (specified +// by the metrics configuration ID) from an Amazon S3 bucket. If you're updating +// an existing metrics configuration, note that this is a full replacement of +// the existing metrics configuration. If you don't include the elements you +// want to keep, they are erased. For more information, see PUT Bucket metrics +// (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html) +// in the Amazon Simple Storage Service API Reference. type MetricsConfiguration struct { _ struct{} `type:"structure"` @@ -17646,11 +17767,11 @@ func (s *NoncurrentVersionExpiration) SetNoncurrentDays(v int64) *NoncurrentVers } // Container for the transition rule that describes when noncurrent objects -// transition to the STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER or -// DEEP_ARCHIVE storage class. If your bucket is versioning-enabled (or versioning +// transition to the STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, +// or DEEP_ARCHIVE storage class. If your bucket is versioning-enabled (or versioning // is suspended), you can set this action to request that Amazon S3 transition // noncurrent object versions to the STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, -// GLACIER or DEEP_ARCHIVE storage class at a specific period in the object's +// GLACIER, or DEEP_ARCHIVE storage class at a specific period in the object's // lifetime. type NoncurrentVersionTransition struct { _ struct{} `type:"structure"` @@ -17693,10 +17814,16 @@ func (s *NoncurrentVersionTransition) SetStorageClass(v string) *NoncurrentVersi type NotificationConfiguration struct { _ struct{} `type:"structure"` + // Describes the AWS Lambda functions to invoke and the events for which to + // invoke them. LambdaFunctionConfigurations []*LambdaFunctionConfiguration `locationName:"CloudFunctionConfiguration" type:"list" flattened:"true"` + // The Amazon Simple Queue Service queues to publish messages to and the events + // for which to publish messages. QueueConfigurations []*QueueConfiguration `locationName:"QueueConfiguration" type:"list" flattened:"true"` + // The topic to which notifications are sent and the events for which notifications + // are generated. TopicConfigurations []*TopicConfiguration `locationName:"TopicConfiguration" type:"list" flattened:"true"` } @@ -17806,8 +17933,8 @@ func (s *NotificationConfigurationDeprecated) SetTopicConfiguration(v *TopicConf return s } -// A container for object key name filtering rules. For information about key -// name filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) +// Specifies object key name filtering rules. For information about key name +// filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) // in the Amazon Simple Storage Service Developer Guide. type NotificationConfigurationFilter struct { _ struct{} `type:"structure"` @@ -17945,14 +18072,14 @@ func (s *ObjectIdentifier) SetVersionId(v string) *ObjectIdentifier { return s } -// The container element for Object Lock configuration parameters. +// The container element for object lock configuration parameters. type ObjectLockConfiguration struct { _ struct{} `type:"structure"` - // Indicates whether this bucket has an Object Lock configuration enabled. + // Indicates whether this bucket has an object lock configuration enabled. ObjectLockEnabled *string `type:"string" enum:"ObjectLockEnabled"` - // The Object Lock rule in place for the specified object. + // The object lock rule in place for the specified object. Rule *ObjectLockRule `type:"structure"` } @@ -18009,7 +18136,7 @@ type ObjectLockRetention struct { // Indicates the Retention mode for the specified object. Mode *string `type:"string" enum:"ObjectLockRetentionMode"` - // The date on which this Object Lock Retention will expire. + // The date on which this object lock retention expires. RetainUntilDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` } @@ -18035,7 +18162,7 @@ func (s *ObjectLockRetention) SetRetainUntilDate(v time.Time) *ObjectLockRetenti return s } -// The container element for an Object Lock rule. +// The container element for an object lock rule. type ObjectLockRule struct { _ struct{} `type:"structure"` @@ -18418,6 +18545,7 @@ func (s *ProgressEvent) UnmarshalEvent( return nil } +// Specifies the Block Public Access configuration for an Amazon S3 bucket. type PublicAccessBlockConfiguration struct { _ struct{} `type:"structure"` @@ -18494,7 +18622,7 @@ func (s *PublicAccessBlockConfiguration) SetRestrictPublicBuckets(v bool) *Publi } type PutBucketAccelerateConfigurationInput struct { - _ struct{} `type:"structure" payload:"AccelerateConfiguration"` + _ struct{} `locationName:"PutBucketAccelerateConfigurationRequest" type:"structure" payload:"AccelerateConfiguration"` // Specifies the Accelerate Configuration you want to set for the bucket. // @@ -18570,11 +18698,12 @@ func (s PutBucketAccelerateConfigurationOutput) GoString() string { } type PutBucketAclInput struct { - _ struct{} `type:"structure" payload:"AccessControlPolicy"` + _ struct{} `locationName:"PutBucketAclRequest" type:"structure" payload:"AccessControlPolicy"` // The canned ACL to apply to the bucket. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` + // Contains the elements that set the ACL permissions for an object per grantee. AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // Bucket is a required field @@ -18698,7 +18827,7 @@ func (s PutBucketAclOutput) GoString() string { } type PutBucketAnalyticsConfigurationInput struct { - _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` + _ struct{} `locationName:"PutBucketAnalyticsConfigurationRequest" type:"structure" payload:"AnalyticsConfiguration"` // The configuration and any analyses for the analytics filter. // @@ -18710,7 +18839,7 @@ type PutBucketAnalyticsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The identifier used to represent an analytics configuration. + // The ID that identifies the analytics configuration. // // Id is a required field Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` @@ -18793,11 +18922,16 @@ func (s PutBucketAnalyticsConfigurationOutput) GoString() string { } type PutBucketCorsInput struct { - _ struct{} `type:"structure" payload:"CORSConfiguration"` + _ struct{} `locationName:"PutBucketCorsRequest" type:"structure" payload:"CORSConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Describes the cross-origin access configuration for objects in an Amazon + // S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon + // Simple Storage Service Developer Guide. + // // CORSConfiguration is a required field CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -18870,16 +19004,18 @@ func (s PutBucketCorsOutput) GoString() string { } type PutBucketEncryptionInput struct { - _ struct{} `type:"structure" payload:"ServerSideEncryptionConfiguration"` + _ struct{} `locationName:"PutBucketEncryptionRequest" type:"structure" payload:"ServerSideEncryptionConfiguration"` - // The name of the bucket for which the server-side encryption configuration - // is set. + // Specifies default encryption for a bucket using server-side encryption with + // Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS). For information + // about the Amazon S3 default encryption feature, see Amazon S3 Default Bucket + // Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) + // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Container for server-side encryption configuration rules. Currently S3 supports - // one rule only. + // Specifies the default server-side-encryption configuration. // // ServerSideEncryptionConfiguration is a required field ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"ServerSideEncryptionConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` @@ -18953,7 +19089,7 @@ func (s PutBucketEncryptionOutput) GoString() string { } type PutBucketInventoryConfigurationInput struct { - _ struct{} `type:"structure" payload:"InventoryConfiguration"` + _ struct{} `locationName:"PutBucketInventoryConfigurationRequest" type:"structure" payload:"InventoryConfiguration"` // The name of the bucket where the inventory configuration will be stored. // @@ -19048,11 +19184,14 @@ func (s PutBucketInventoryConfigurationOutput) GoString() string { } type PutBucketLifecycleConfigurationInput struct { - _ struct{} `type:"structure" payload:"LifecycleConfiguration"` + _ struct{} `locationName:"PutBucketLifecycleConfigurationRequest" type:"structure" payload:"LifecycleConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Specifies the lifecycle configuration for objects in an Amazon S3 bucket. + // For more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) + // in the Amazon Simple Storage Service Developer Guide. LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -19121,7 +19260,7 @@ func (s PutBucketLifecycleConfigurationOutput) GoString() string { } type PutBucketLifecycleInput struct { - _ struct{} `type:"structure" payload:"LifecycleConfiguration"` + _ struct{} `locationName:"PutBucketLifecycleRequest" type:"structure" payload:"LifecycleConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19194,7 +19333,7 @@ func (s PutBucketLifecycleOutput) GoString() string { } type PutBucketLoggingInput struct { - _ struct{} `type:"structure" payload:"BucketLoggingStatus"` + _ struct{} `locationName:"PutBucketLoggingRequest" type:"structure" payload:"BucketLoggingStatus"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19271,7 +19410,7 @@ func (s PutBucketLoggingOutput) GoString() string { } type PutBucketMetricsConfigurationInput struct { - _ struct{} `type:"structure" payload:"MetricsConfiguration"` + _ struct{} `locationName:"PutBucketMetricsConfigurationRequest" type:"structure" payload:"MetricsConfiguration"` // The name of the bucket for which the metrics configuration is set. // @@ -19366,7 +19505,7 @@ func (s PutBucketMetricsConfigurationOutput) GoString() string { } type PutBucketNotificationConfigurationInput struct { - _ struct{} `type:"structure" payload:"NotificationConfiguration"` + _ struct{} `locationName:"PutBucketNotificationConfigurationRequest" type:"structure" payload:"NotificationConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19446,7 +19585,7 @@ func (s PutBucketNotificationConfigurationOutput) GoString() string { } type PutBucketNotificationInput struct { - _ struct{} `type:"structure" payload:"NotificationConfiguration"` + _ struct{} `locationName:"PutBucketNotificationRequest" type:"structure" payload:"NotificationConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19518,7 +19657,7 @@ func (s PutBucketNotificationOutput) GoString() string { } type PutBucketPolicyInput struct { - _ struct{} `type:"structure" payload:"Policy"` + _ struct{} `locationName:"PutBucketPolicyRequest" type:"structure" payload:"Policy"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19602,7 +19741,7 @@ func (s PutBucketPolicyOutput) GoString() string { } type PutBucketReplicationInput struct { - _ struct{} `type:"structure" payload:"ReplicationConfiguration"` + _ struct{} `locationName:"PutBucketReplicationRequest" type:"structure" payload:"ReplicationConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19613,6 +19752,7 @@ type PutBucketReplicationInput struct { // ReplicationConfiguration is a required field ReplicationConfiguration *ReplicationConfiguration `locationName:"ReplicationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + // A token that allows Amazon S3 object lock to be enabled for an existing bucket. Token *string `location:"header" locationName:"x-amz-bucket-object-lock-token" type:"string"` } @@ -19690,7 +19830,7 @@ func (s PutBucketReplicationOutput) GoString() string { } type PutBucketRequestPaymentInput struct { - _ struct{} `type:"structure" payload:"RequestPaymentConfiguration"` + _ struct{} `locationName:"PutBucketRequestPaymentRequest" type:"structure" payload:"RequestPaymentConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19767,7 +19907,7 @@ func (s PutBucketRequestPaymentOutput) GoString() string { } type PutBucketTaggingInput struct { - _ struct{} `type:"structure" payload:"Tagging"` + _ struct{} `locationName:"PutBucketTaggingRequest" type:"structure" payload:"Tagging"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19844,7 +19984,7 @@ func (s PutBucketTaggingOutput) GoString() string { } type PutBucketVersioningInput struct { - _ struct{} `type:"structure" payload:"VersioningConfiguration"` + _ struct{} `locationName:"PutBucketVersioningRequest" type:"structure" payload:"VersioningConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19853,6 +19993,10 @@ type PutBucketVersioningInput struct { // and the value that is displayed on your authentication device. MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` + // Describes the versioning state of an Amazon S3 bucket. For more information, + // see PUT Bucket versioning (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) + // in the Amazon Simple Storage Service API Reference. + // // VersioningConfiguration is a required field VersioningConfiguration *VersioningConfiguration `locationName:"VersioningConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -19926,11 +20070,13 @@ func (s PutBucketVersioningOutput) GoString() string { } type PutBucketWebsiteInput struct { - _ struct{} `type:"structure" payload:"WebsiteConfiguration"` + _ struct{} `locationName:"PutBucketWebsiteRequest" type:"structure" payload:"WebsiteConfiguration"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Specifies website configuration parameters for an Amazon S3 bucket. + // // WebsiteConfiguration is a required field WebsiteConfiguration *WebsiteConfiguration `locationName:"WebsiteConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -20003,11 +20149,12 @@ func (s PutBucketWebsiteOutput) GoString() string { } type PutObjectAclInput struct { - _ struct{} `type:"structure" payload:"AccessControlPolicy"` + _ struct{} `locationName:"PutObjectAclRequest" type:"structure" payload:"AccessControlPolicy"` // The canned ACL to apply to the object. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` + // Contains the elements that set the ACL permissions for an object per grantee. AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // Bucket is a required field @@ -20177,7 +20324,7 @@ func (s *PutObjectAclOutput) SetRequestCharged(v string) *PutObjectAclOutput { } type PutObjectInput struct { - _ struct{} `type:"structure" payload:"Body"` + _ struct{} `locationName:"PutObjectRequest" type:"structure" payload:"Body"` // The canned ACL to apply to the object. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` @@ -20209,7 +20356,8 @@ type PutObjectInput struct { ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` // The base64-encoded 128-bit MD5 digest of the part data. This parameter is - // auto-populated when using the command from the CLI + // auto-populated when using the command from the CLI. This parameted is required + // if object lock parameters are specified. ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` // A standard MIME type describing the format of the object data. @@ -20241,10 +20389,10 @@ type PutObjectInput struct { // The Legal Hold status that you want to apply to the specified object. ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // The Object Lock mode that you want to apply to this object. + // The object lock mode that you want to apply to this object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // The date and time when you want this object's Object Lock to expire. + // The date and time when you want this object's object lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` // Confirms that the requester knows that she or he will be charged for the @@ -20268,6 +20416,11 @@ type PutObjectInput struct { // key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + // Specifies the AWS KMS Encryption Context to use for object encryption. The + // value of this header is a base64-encoded UTF-8 string holding JSON with the + // encryption context key-value pairs. + SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` + // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT // requests for an object protected by AWS KMS will fail if not made via SSL // or using SigV4. Documentation on configuring any of the officially supported @@ -20481,6 +20634,12 @@ func (s *PutObjectInput) SetSSECustomerKeyMD5(v string) *PutObjectInput { return s } +// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. +func (s *PutObjectInput) SetSSEKMSEncryptionContext(v string) *PutObjectInput { + s.SSEKMSEncryptionContext = &v + return s +} + // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. func (s *PutObjectInput) SetSSEKMSKeyId(v string) *PutObjectInput { s.SSEKMSKeyId = &v @@ -20512,7 +20671,7 @@ func (s *PutObjectInput) SetWebsiteRedirectLocation(v string) *PutObjectInput { } type PutObjectLegalHoldInput struct { - _ struct{} `type:"structure" payload:"LegalHold"` + _ struct{} `locationName:"PutObjectLegalHoldRequest" type:"structure" payload:"LegalHold"` // The bucket containing the object that you want to place a Legal Hold on. // @@ -20632,14 +20791,14 @@ func (s *PutObjectLegalHoldOutput) SetRequestCharged(v string) *PutObjectLegalHo } type PutObjectLockConfigurationInput struct { - _ struct{} `type:"structure" payload:"ObjectLockConfiguration"` + _ struct{} `locationName:"PutObjectLockConfigurationRequest" type:"structure" payload:"ObjectLockConfiguration"` - // The bucket whose Object Lock configuration you want to create or replace. + // The bucket whose object lock configuration you want to create or replace. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The Object Lock configuration that you want to apply to the specified bucket. + // The object lock configuration that you want to apply to the specified bucket. ObjectLockConfiguration *ObjectLockConfiguration `locationName:"ObjectLockConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` // Confirms that the requester knows that she or he will be charged for the @@ -20648,7 +20807,7 @@ type PutObjectLockConfigurationInput struct { // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - // A token to allow Object Lock to be enabled for an existing bucket. + // A token to allow Amazon S3 object lock to be enabled for an existing bucket. Token *string `location:"header" locationName:"x-amz-bucket-object-lock-token" type:"string"` } @@ -20757,6 +20916,11 @@ type PutObjectOutput struct { // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + // If present, specifies the AWS KMS Encryption Context to use for object encryption. + // The value of this header is a base64-encoded UTF-8 string holding JSON with + // the encryption context key-value pairs. + SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` + // If present, specifies the ID of the AWS Key Management Service (KMS) master // encryption key that was used for the object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` @@ -20809,6 +20973,12 @@ func (s *PutObjectOutput) SetSSECustomerKeyMD5(v string) *PutObjectOutput { return s } +// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. +func (s *PutObjectOutput) SetSSEKMSEncryptionContext(v string) *PutObjectOutput { + s.SSEKMSEncryptionContext = &v + return s +} + // SetSSEKMSKeyId sets the SSEKMSKeyId field's value. func (s *PutObjectOutput) SetSSEKMSKeyId(v string) *PutObjectOutput { s.SSEKMSKeyId = &v @@ -20828,7 +20998,7 @@ func (s *PutObjectOutput) SetVersionId(v string) *PutObjectOutput { } type PutObjectRetentionInput struct { - _ struct{} `type:"structure" payload:"Retention"` + _ struct{} `locationName:"PutObjectRetentionRequest" type:"structure" payload:"Retention"` // The bucket that contains the object you want to apply this Object Retention // configuration to. @@ -20959,7 +21129,7 @@ func (s *PutObjectRetentionOutput) SetRequestCharged(v string) *PutObjectRetenti } type PutObjectTaggingInput struct { - _ struct{} `type:"structure" payload:"Tagging"` + _ struct{} `locationName:"PutObjectTaggingRequest" type:"structure" payload:"Tagging"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -21067,7 +21237,7 @@ func (s *PutObjectTaggingOutput) SetVersionId(v string) *PutObjectTaggingOutput } type PutPublicAccessBlockInput struct { - _ struct{} `type:"structure" payload:"PublicAccessBlockConfiguration"` + _ struct{} `locationName:"PutPublicAccessBlockRequest" type:"structure" payload:"PublicAccessBlockConfiguration"` // The name of the Amazon S3 bucket whose PublicAccessBlock configuration you // want to set. @@ -21147,17 +21317,16 @@ func (s PutPublicAccessBlockOutput) GoString() string { return s.String() } -// A container for specifying the configuration for publication of messages -// to an Amazon Simple Queue Service (Amazon SQS) queue.when Amazon S3 detects -// specified events. +// Specifies the configuration for publishing messages to an Amazon Simple Queue +// Service (Amazon SQS) queue when Amazon S3 detects specified events. type QueueConfiguration struct { _ struct{} `type:"structure"` // Events is a required field Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` - // A container for object key name filtering rules. For information about key - // name filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // Specifies object key name filtering rules. For information about key name + // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) // in the Amazon Simple Storage Service Developer Guide. Filter *NotificationConfigurationFilter `type:"structure"` @@ -21166,7 +21335,7 @@ type QueueConfiguration struct { Id *string `type:"string"` // The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 - // will publish a message when it detects events of the specified type. + // publishes a message when it detects events of the specified type. // // QueueArn is a required field QueueArn *string `locationName:"Queue" type:"string" required:"true"` @@ -21312,6 +21481,8 @@ func (s *RecordsEvent) UnmarshalEvent( return nil } +// Specifies how requests are redirected. In the event of an error, you can +// specify a different error code to return. type Redirect struct { _ struct{} `type:"structure"` @@ -21322,8 +21493,8 @@ type Redirect struct { // siblings is present. HttpRedirectCode *string `type:"string"` - // Protocol to use (http, https) when redirecting requests. The default is the - // protocol that is used in the original request. + // Protocol to use when redirecting requests. The default is the protocol that + // is used in the original request. Protocol *string `type:"string" enum:"Protocol"` // The object key prefix to use in the redirect request. For example, to redirect @@ -21335,7 +21506,7 @@ type Redirect struct { ReplaceKeyPrefixWith *string `type:"string"` // The specific object key to use in the redirect request. For example, redirect - // request to error.html. Not required if one of the sibling is present. Can + // request to error.html. Not required if one of the siblings is present. Can // be present only if ReplaceKeyPrefixWith is not provided. ReplaceKeyWith *string `type:"string"` } @@ -21380,16 +21551,18 @@ func (s *Redirect) SetReplaceKeyWith(v string) *Redirect { return s } +// Specifies the redirect behavior of all requests to a website endpoint of +// an Amazon S3 bucket. type RedirectAllRequestsTo struct { _ struct{} `type:"structure"` - // Name of the host where requests will be redirected. + // Name of the host where requests are redirected. // // HostName is a required field HostName *string `type:"string" required:"true"` - // Protocol to use (http, https) when redirecting requests. The default is the - // protocol that is used in the original request. + // Protocol to use when redirecting requests. The default is the protocol that + // is used in the original request. Protocol *string `type:"string" enum:"Protocol"` } @@ -21434,7 +21607,9 @@ type ReplicationConfiguration struct { _ struct{} `type:"structure"` // The Amazon Resource Name (ARN) of the AWS Identity and Access Management - // (IAM) role that Amazon S3 can assume when replicating the objects. + // (IAM) role that Amazon S3 assumes when replicating objects. For more information, + // see How to Set Up Cross-Region Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-how-setup.html) + // in the Amazon Simple Storage Service Developer Guide. // // Role is a required field Role *string `type:"string" required:"true"` @@ -21494,7 +21669,7 @@ func (s *ReplicationConfiguration) SetRules(v []*ReplicationRule) *ReplicationCo return s } -// A container for information about a specific replication rule. +// Specifies which Amazon S3 objects to replicate and where to store the replicas. type ReplicationRule struct { _ struct{} `type:"structure"` @@ -21514,7 +21689,8 @@ type ReplicationRule struct { ID *string `type:"string"` // An object keyname prefix that identifies the object or objects to which the - // rule applies. The maximum prefix length is 1,024 characters. + // rule applies. The maximum prefix length is 1,024 characters. To include all + // objects in a bucket, specify an empty string. // // Deprecated: Prefix has been deprecated Prefix *string `deprecated:"true" type:"string"` @@ -21539,12 +21715,9 @@ type ReplicationRule struct { // replication of these objects. Currently, Amazon S3 supports only the filter // that you can specify for objects created with server-side encryption using // an AWS KMS-Managed Key (SSE-KMS). - // - // If you want Amazon S3 to replicate objects created with server-side encryption - // using AWS KMS-Managed Keys. SourceSelectionCriteria *SourceSelectionCriteria `type:"structure"` - // If status isn't enabled, the rule is ignored. + // Specifies whether the rule is enabled. // // Status is a required field Status *string `type:"string" required:"true" enum:"ReplicationRuleStatus"` @@ -21826,7 +21999,7 @@ func (s *RequestProgress) SetEnabled(v bool) *RequestProgress { } type RestoreObjectInput struct { - _ struct{} `type:"structure" payload:"RestoreRequest"` + _ struct{} `locationName:"RestoreObjectRequest" type:"structure" payload:"RestoreRequest"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -22059,6 +22232,7 @@ func (s *RestoreRequest) SetType(v string) *RestoreRequest { return s } +// Specifies the redirect behavior and when a redirect is applied. type RoutingRule struct { _ struct{} `type:"structure"` @@ -22111,16 +22285,22 @@ func (s *RoutingRule) SetRedirect(v *Redirect) *RoutingRule { return s } +// Specifies lifecycle rules for an Amazon S3 bucket. For more information, +// see PUT Bucket lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html) +// in the Amazon Simple Storage Service API Reference. type Rule struct { _ struct{} `type:"structure"` - // Specifies the days since the initiation of an Incomplete Multipart Upload - // that Lifecycle will wait before permanently removing all parts of the upload. + // Specifies the days since the initiation of an incomplete multipart upload + // that Amazon S3 will wait before permanently removing all parts of the upload. + // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket + // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) + // in the Amazon Simple Storage Service Developer Guide. AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` Expiration *LifecycleExpiration `type:"structure"` - // Unique identifier for the rule. The value cannot be longer than 255 characters. + // Unique identifier for the rule. The value can't be longer than 255 characters. ID *string `type:"string"` // Specifies when noncurrent object versions expire. Upon expiration, Amazon @@ -22131,25 +22311,27 @@ type Rule struct { NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` // Container for the transition rule that describes when noncurrent objects - // transition to the STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER or - // DEEP_ARCHIVE storage class. If your bucket is versioning-enabled (or versioning + // transition to the STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, + // or DEEP_ARCHIVE storage class. If your bucket is versioning-enabled (or versioning // is suspended), you can set this action to request that Amazon S3 transition // noncurrent object versions to the STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, - // GLACIER or DEEP_ARCHIVE storage class at a specific period in the object's + // GLACIER, or DEEP_ARCHIVE storage class at a specific period in the object's // lifetime. NoncurrentVersionTransition *NoncurrentVersionTransition `type:"structure"` - // Prefix identifying one or more objects to which the rule applies. + // Object key prefix that identifies one or more objects to which this rule + // applies. // // Prefix is a required field Prefix *string `type:"string" required:"true"` - // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule - // is not currently being applied. + // If Enabled, the rule is currently being applied. If Disabled, the rule is + // not currently being applied. // // Status is a required field Status *string `type:"string" required:"true" enum:"ExpirationStatus"` + // Specifies when an object transitions to a specified storage class. Transition *Transition `type:"structure"` } @@ -22800,13 +22982,15 @@ func (s *SelectParameters) SetOutputSerialization(v *OutputSerialization) *Selec } // Describes the default server-side encryption to apply to new objects in the -// bucket. If Put Object request does not specify any server-side encryption, -// this default encryption will be applied. +// bucket. If a PUT Object request doesn't specify any server-side encryption, +// this default encryption will be applied. For more information, see PUT Bucket +// encryption (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html) +// in the Amazon Simple Storage Service API Reference. type ServerSideEncryptionByDefault struct { _ struct{} `type:"structure"` // KMS master key ID to use for the default encryption. This parameter is allowed - // if SSEAlgorithm is aws:kms. + // if and only if SSEAlgorithm is set to aws:kms. KMSMasterKeyID *string `type:"string" sensitive:"true"` // Server-side encryption algorithm to use for the default encryption. @@ -22850,8 +23034,7 @@ func (s *ServerSideEncryptionByDefault) SetSSEAlgorithm(v string) *ServerSideEnc return s } -// Container for server-side encryption configuration rules. Currently S3 supports -// one rule only. +// Specifies the default server-side-encryption configuration. type ServerSideEncryptionConfiguration struct { _ struct{} `type:"structure"` @@ -22901,13 +23084,12 @@ func (s *ServerSideEncryptionConfiguration) SetRules(v []*ServerSideEncryptionRu return s } -// Container for information about a particular server-side encryption configuration -// rule. +// Specifies the default server-side encryption configuration. type ServerSideEncryptionRule struct { _ struct{} `type:"structure"` - // Describes the default server-side encryption to apply to new objects in the - // bucket. If Put Object request does not specify any server-side encryption, + // Specifies the default server-side encryption to apply to new objects in the + // bucket. If a PUT Object request doesn't specify any server-side encryption, // this default encryption will be applied. ApplyServerSideEncryptionByDefault *ServerSideEncryptionByDefault `type:"structure"` } @@ -22943,13 +23125,17 @@ func (s *ServerSideEncryptionRule) SetApplyServerSideEncryptionByDefault(v *Serv return s } -// A container for filters that define which source objects should be replicated. +// A container that describes additional filters for identifying the source +// objects that you want to replicate. You can choose to enable or disable the +// replication of these objects. Currently, Amazon S3 supports only the filter +// that you can specify for objects created with server-side encryption using +// an AWS KMS-Managed Key (SSE-KMS). type SourceSelectionCriteria struct { _ struct{} `type:"structure"` - // A container for filter information for the selection of S3 objects encrypted - // with AWS KMS. If you include SourceSelectionCriteria in the replication configuration, - // this element is required. + // A container for filter information for the selection of Amazon S3 objects + // encrypted with AWS KMS. If you include SourceSelectionCriteria in the replication + // configuration, this element is required. SseKmsEncryptedObjects *SseKmsEncryptedObjects `type:"structure"` } @@ -22989,8 +23175,8 @@ func (s *SourceSelectionCriteria) SetSseKmsEncryptedObjects(v *SseKmsEncryptedOb type SseKmsEncryptedObjects struct { _ struct{} `type:"structure"` - // If the status is not Enabled, replication for S3 objects encrypted with AWS - // KMS is disabled. + // Specifies whether Amazon S3 replicates objects created with server-side encryption + // using an AWS KMS-managed key. // // Status is a required field Status *string `type:"string" required:"true" enum:"SseKmsEncryptedObjectsStatus"` @@ -23106,11 +23292,14 @@ func (s *StatsEvent) UnmarshalEvent( return nil } +// Specifies data related to access patterns to be collected and made available +// to analyze the tradeoffs between different storage classes for an Amazon +// S3 bucket. type StorageClassAnalysis struct { _ struct{} `type:"structure"` - // A container used to describe how data related to the storage class analysis - // should be exported. + // Specifies how data related to the storage class analysis for an Amazon S3 + // bucket should be exported. DataExport *StorageClassAnalysisDataExport `type:"structure"` } @@ -23350,16 +23539,20 @@ func (s *TargetGrant) SetPermission(v string) *TargetGrant { } // A container for specifying the configuration for publication of messages -// to an Amazon Simple Notification Service (Amazon SNS) topic.when Amazon S3 +// to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 // detects specified events. type TopicConfiguration struct { _ struct{} `type:"structure"` + // The Amazon S3 bucket event about which to send notifications. For more information, + // see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Events is a required field Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` - // A container for object key name filtering rules. For information about key - // name filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + // Specifies object key name filtering rules. For information about key name + // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) // in the Amazon Simple Storage Service Developer Guide. Filter *NotificationConfigurationFilter `type:"structure"` @@ -23368,7 +23561,7 @@ type TopicConfiguration struct { Id *string `type:"string"` // The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 - // will publish a message when it detects events of the specified type. + // publishes a message when it detects events of the specified type. // // TopicArn is a required field TopicArn *string `locationName:"Topic" type:"string" required:"true"` @@ -23477,18 +23670,19 @@ func (s *TopicConfigurationDeprecated) SetTopic(v string) *TopicConfigurationDep return s } +// Specifies when an object transitions to a specified storage class. type Transition struct { _ struct{} `type:"structure"` - // Indicates at what date the object is to be moved or deleted. Should be in - // GMT ISO 8601 Format. + // Indicates when objects are transitioned to the specified storage class. The + // date value must be in ISO 8601 format. The time is always midnight UTC. Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` - // Indicates the lifetime, in days, of the objects that are subject to the rule. - // The value must be a non-zero positive integer. + // Indicates the number of days after creation when objects are transitioned + // to the specified storage class. The value must be a positive integer. Days *int64 `type:"integer"` - // The class of storage used to store the object. + // The storage class to which you want the object to transition. StorageClass *string `type:"string" enum:"TransitionStorageClass"` } @@ -23521,7 +23715,7 @@ func (s *Transition) SetStorageClass(v string) *Transition { } type UploadPartCopyInput struct { - _ struct{} `type:"structure"` + _ struct{} `locationName:"UploadPartCopyRequest" type:"structure"` // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -23851,7 +24045,7 @@ func (s *UploadPartCopyOutput) SetServerSideEncryption(v string) *UploadPartCopy } type UploadPartInput struct { - _ struct{} `type:"structure" payload:"Body"` + _ struct{} `locationName:"UploadPartRequest" type:"structure" payload:"Body"` // Object data. Body io.ReadSeeker `type:"blob"` @@ -23865,7 +24059,9 @@ type UploadPartInput struct { // body cannot be determined automatically. ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - // The base64-encoded 128-bit MD5 digest of the part data. + // The base64-encoded 128-bit MD5 digest of the part data. This parameter is + // auto-populated when using the command from the CLI. This parameted is required + // if object lock parameters are specified. ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` // Object key for which the multipart upload was initiated. @@ -24100,6 +24296,9 @@ func (s *UploadPartOutput) SetServerSideEncryption(v string) *UploadPartOutput { return s } +// Describes the versioning state of an Amazon S3 bucket. For more information, +// see PUT Bucket versioning (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) +// in the Amazon Simple Storage Service API Reference. type VersioningConfiguration struct { _ struct{} `type:"structure"` @@ -24134,15 +24333,22 @@ func (s *VersioningConfiguration) SetStatus(v string) *VersioningConfiguration { return s } +// Specifies website configuration parameters for an Amazon S3 bucket. type WebsiteConfiguration struct { _ struct{} `type:"structure"` + // The name of the error document for the website. ErrorDocument *ErrorDocument `type:"structure"` + // The name of the index document for the website. IndexDocument *IndexDocument `type:"structure"` + // The redirect behavior for every request to this bucket's website endpoint. + // + // If you specify this property, you can't specify any other property. RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` + // Rules that define when a redirect is applied and the redirect behavior. RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` } diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go index 39b912c26..4b65f7153 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go @@ -63,6 +63,20 @@ // See the s3manager package's Downloader type documentation for more information. // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Downloader // +// Automatic URI cleaning +// +// Interacting with objects whose keys contain adjacent slashes (e.g. bucketname/foo//bar/objectname) +// requires setting DisableRestProtocolURICleaning to true in the aws.Config struct +// used by the service client. +// +// svc := s3.New(sess, &aws.Config{ +// DisableRestProtocolURICleaning: aws.Bool(true), +// }) +// out, err := svc.GetObject(&s3.GetObjectInput { +// Bucket: aws.String("bucketname"), +// Key: aws.String("//foo//bar//moo"), +// }) +// // Get Bucket Region // // GetBucketRegion will attempt to get the region for a bucket using a region diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go index 9e610591a..eb0a6a417 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go @@ -702,6 +702,102 @@ func (c *STS) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *Deco return out, req.Send() } +const opGetAccessKeyInfo = "GetAccessKeyInfo" + +// GetAccessKeyInfoRequest generates a "aws/request.Request" representing the +// client's request for the GetAccessKeyInfo operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAccessKeyInfo for more information on using the GetAccessKeyInfo +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAccessKeyInfoRequest method. +// req, resp := client.GetAccessKeyInfoRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo +func (c *STS) GetAccessKeyInfoRequest(input *GetAccessKeyInfoInput) (req *request.Request, output *GetAccessKeyInfoOutput) { + op := &request.Operation{ + Name: opGetAccessKeyInfo, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetAccessKeyInfoInput{} + } + + output = &GetAccessKeyInfoOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccessKeyInfo API operation for AWS Security Token Service. +// +// Returns the account identifier for the specified access key ID. +// +// Access keys consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) +// and a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). +// For more information about access keys, see Managing Access Keys for IAM +// Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) +// in the IAM User Guide. +// +// When you pass an access key ID to this operation, it returns the ID of the +// AWS account to which the keys belong. Access key IDs beginning with AKIA +// are long-term credentials for an IAM user or the AWS account root user. Access +// key IDs beginning with ASIA are temporary credentials that are created using +// STS operations. If the account in the response belongs to you, you can sign +// in as the root user and review your root user access keys. Then, you can +// pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) +// to learn which IAM user owns the keys. To learn who requested the temporary +// credentials for an ASIA access key, view the STS events in your CloudTrail +// logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html). +// +// This operation does not indicate the state of the access key. The key might +// be active, inactive, or deleted. Active keys might not have permissions to +// perform an operation. Providing a deleted access key might return an error +// that the key doesn't exist. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Security Token Service's +// API operation GetAccessKeyInfo for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo +func (c *STS) GetAccessKeyInfo(input *GetAccessKeyInfoInput) (*GetAccessKeyInfoOutput, error) { + req, out := c.GetAccessKeyInfoRequest(input) + return out, req.Send() +} + +// GetAccessKeyInfoWithContext is the same as GetAccessKeyInfo with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccessKeyInfo for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *STS) GetAccessKeyInfoWithContext(ctx aws.Context, input *GetAccessKeyInfoInput, opts ...request.Option) (*GetAccessKeyInfoOutput, error) { + req, out := c.GetAccessKeyInfoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetCallerIdentity = "GetCallerIdentity" // GetCallerIdentityRequest generates a "aws/request.Request" representing the @@ -746,8 +842,15 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ // GetCallerIdentity API operation for AWS Security Token Service. // -// Returns details about the IAM identity whose credentials are used to call -// the API. +// Returns details about the IAM user or role whose credentials are used to +// call the operation. +// +// No permissions are required to perform this operation. If an administrator +// adds a policy to your IAM user or role that explicitly denies access to the +// sts:GetCallerIdentity action, you can still perform this operation. Permissions +// are not required because the same information is returned when an IAM user +// or role is denied access. To view an example response, see I Am Not Authorized +// to Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1129,7 +1232,7 @@ type AssumeRoleInput struct { // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session // policies shouldn't exceed 2048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // The characters in this parameter count towards the 2048 character session @@ -1407,7 +1510,7 @@ type AssumeRoleWithSAMLInput struct { // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session // policies shouldn't exceed 2048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // The characters in this parameter count towards the 2048 character session @@ -1702,7 +1805,7 @@ type AssumeRoleWithWebIdentityInput struct { // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session // policies shouldn't exceed 2048 characters. For more information about ARNs, - // see Amazon Resource Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // The characters in this parameter count towards the 2048 character session @@ -2156,6 +2259,73 @@ func (s *FederatedUser) SetFederatedUserId(v string) *FederatedUser { return s } +type GetAccessKeyInfoInput struct { + _ struct{} `type:"structure"` + + // The identifier of an access key. + // + // This parameter allows (through its regex pattern) a string of characters + // that can consist of any upper- or lowercased letter or digit. + // + // AccessKeyId is a required field + AccessKeyId *string `min:"16" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAccessKeyInfoInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessKeyInfoInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAccessKeyInfoInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccessKeyInfoInput"} + if s.AccessKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) + } + if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { + invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *GetAccessKeyInfoInput) SetAccessKeyId(v string) *GetAccessKeyInfoInput { + s.AccessKeyId = &v + return s +} + +type GetAccessKeyInfoOutput struct { + _ struct{} `type:"structure"` + + // The number used to identify the AWS account. + Account *string `type:"string"` +} + +// String returns the string representation +func (s GetAccessKeyInfoOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessKeyInfoOutput) GoString() string { + return s.String() +} + +// SetAccount sets the Account field's value. +func (s *GetAccessKeyInfoOutput) SetAccount(v string) *GetAccessKeyInfoOutput { + s.Account = &v + return s +} + type GetCallerIdentityInput struct { _ struct{} `type:"structure"` } @@ -2284,7 +2454,7 @@ type GetFederationTokenInput struct { // use as managed session policies. The plain text that you use for both inline // and managed session policies shouldn't exceed 2048 characters. You can provide // up to 10 managed policy ARNs. For more information about ARNs, see Amazon - // Resource Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // This parameter is optional. However, if you do not pass any session policies, @@ -2545,7 +2715,7 @@ type PolicyDescriptorType struct { // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session // policy for the role. For more information about ARNs, see Amazon Resource - // Names (ARNs) and AWS Service Namespaces (general/latest/gr/aws-arns-and-namespaces.html) + // Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. Arn *string `locationName:"arn" min:"20" type:"string"` } diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go new file mode 100644 index 000000000..d5307fcaa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go @@ -0,0 +1,11 @@ +package sts + +import "github.com/aws/aws-sdk-go/aws/request" + +func init() { + initRequest = customizeRequest +} + +func customizeRequest(r *request.Request) { + r.RetryErrorCodes = append(r.RetryErrorCodes, ErrCodeIDPCommunicationErrorException) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go new file mode 100644 index 000000000..e2e1d6efe --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go @@ -0,0 +1,96 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package stsiface provides an interface to enable mocking the AWS Security Token Service service client +// for testing your code. +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. +package stsiface + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/sts" +) + +// STSAPI provides an interface to enable mocking the +// sts.STS service client's API operation, +// paginators, and waiters. This make unit testing your code that calls out +// to the SDK's service client's calls easier. +// +// The best way to use this interface is so the SDK's service client's calls +// can be stubbed out for unit testing your code with the SDK without needing +// to inject custom request handlers into the SDK's request pipeline. +// +// // myFunc uses an SDK service client to make a request to +// // AWS Security Token Service. +// func myFunc(svc stsiface.STSAPI) bool { +// // Make svc.AssumeRole request +// } +// +// func main() { +// sess := session.New() +// svc := sts.New(sess) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockSTSClient struct { +// stsiface.STSAPI +// } +// func (m *mockSTSClient) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockSTSClient{} +// +// myfunc(mockSvc) +// +// // Verify myFunc's functionality +// } +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. Its suggested to use the pattern above for testing, or using +// tooling to generate mocks to satisfy the interfaces. +type STSAPI interface { + AssumeRole(*sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) + AssumeRoleWithContext(aws.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error) + AssumeRoleRequest(*sts.AssumeRoleInput) (*request.Request, *sts.AssumeRoleOutput) + + AssumeRoleWithSAML(*sts.AssumeRoleWithSAMLInput) (*sts.AssumeRoleWithSAMLOutput, error) + AssumeRoleWithSAMLWithContext(aws.Context, *sts.AssumeRoleWithSAMLInput, ...request.Option) (*sts.AssumeRoleWithSAMLOutput, error) + AssumeRoleWithSAMLRequest(*sts.AssumeRoleWithSAMLInput) (*request.Request, *sts.AssumeRoleWithSAMLOutput) + + AssumeRoleWithWebIdentity(*sts.AssumeRoleWithWebIdentityInput) (*sts.AssumeRoleWithWebIdentityOutput, error) + AssumeRoleWithWebIdentityWithContext(aws.Context, *sts.AssumeRoleWithWebIdentityInput, ...request.Option) (*sts.AssumeRoleWithWebIdentityOutput, error) + AssumeRoleWithWebIdentityRequest(*sts.AssumeRoleWithWebIdentityInput) (*request.Request, *sts.AssumeRoleWithWebIdentityOutput) + + DecodeAuthorizationMessage(*sts.DecodeAuthorizationMessageInput) (*sts.DecodeAuthorizationMessageOutput, error) + DecodeAuthorizationMessageWithContext(aws.Context, *sts.DecodeAuthorizationMessageInput, ...request.Option) (*sts.DecodeAuthorizationMessageOutput, error) + DecodeAuthorizationMessageRequest(*sts.DecodeAuthorizationMessageInput) (*request.Request, *sts.DecodeAuthorizationMessageOutput) + + GetAccessKeyInfo(*sts.GetAccessKeyInfoInput) (*sts.GetAccessKeyInfoOutput, error) + GetAccessKeyInfoWithContext(aws.Context, *sts.GetAccessKeyInfoInput, ...request.Option) (*sts.GetAccessKeyInfoOutput, error) + GetAccessKeyInfoRequest(*sts.GetAccessKeyInfoInput) (*request.Request, *sts.GetAccessKeyInfoOutput) + + GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error) + GetCallerIdentityWithContext(aws.Context, *sts.GetCallerIdentityInput, ...request.Option) (*sts.GetCallerIdentityOutput, error) + GetCallerIdentityRequest(*sts.GetCallerIdentityInput) (*request.Request, *sts.GetCallerIdentityOutput) + + GetFederationToken(*sts.GetFederationTokenInput) (*sts.GetFederationTokenOutput, error) + GetFederationTokenWithContext(aws.Context, *sts.GetFederationTokenInput, ...request.Option) (*sts.GetFederationTokenOutput, error) + GetFederationTokenRequest(*sts.GetFederationTokenInput) (*request.Request, *sts.GetFederationTokenOutput) + + GetSessionToken(*sts.GetSessionTokenInput) (*sts.GetSessionTokenOutput, error) + GetSessionTokenWithContext(aws.Context, *sts.GetSessionTokenInput, ...request.Option) (*sts.GetSessionTokenOutput, error) + GetSessionTokenRequest(*sts.GetSessionTokenInput) (*request.Request, *sts.GetSessionTokenOutput) +} + +var _ STSAPI = (*sts.STS)(nil) diff --git a/vendor/github.com/golang/protobuf/proto/lib.go b/vendor/github.com/golang/protobuf/proto/lib.go index fdd328bb7..70fbda532 100644 --- a/vendor/github.com/golang/protobuf/proto/lib.go +++ b/vendor/github.com/golang/protobuf/proto/lib.go @@ -393,7 +393,7 @@ func (p *Buffer) Bytes() []byte { return p.buf } // than relying on this API. // // If deterministic serialization is requested, map entries will be sorted -// by keys in lexographical order. This is an implementation detail and +// by keys in lexicographical order. This is an implementation detail and // subject to change. func (p *Buffer) SetDeterministic(deterministic bool) { p.deterministic = deterministic diff --git a/vendor/github.com/golang/protobuf/proto/text.go b/vendor/github.com/golang/protobuf/proto/text.go index 1aaee725b..d97f9b356 100644 --- a/vendor/github.com/golang/protobuf/proto/text.go +++ b/vendor/github.com/golang/protobuf/proto/text.go @@ -456,6 +456,8 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error { return nil } +var textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() + // writeAny writes an arbitrary field. func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error { v = reflect.Indirect(v) @@ -519,8 +521,8 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert // mutating this value. v = v.Addr() } - if etm, ok := v.Interface().(encoding.TextMarshaler); ok { - text, err := etm.MarshalText() + if v.Type().Implements(textMarshalerType) { + text, err := v.Interface().(encoding.TextMarshaler).MarshalText() if err != nil { return err } diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go index 1ded05bbe..d371d5697 100644 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go +++ b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go @@ -1376,8 +1376,8 @@ type FileOptions struct { // determining the namespace. PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"` // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be used - // for determining the namespace. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"` // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for @@ -1627,7 +1627,7 @@ type MessageOptions struct { // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementions still need to work as + // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax @@ -2377,7 +2377,7 @@ type SourceCodeInfo struct { // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines + // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to @@ -2718,7 +2718,9 @@ func init() { proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation") } -func init() { proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_e5baabe45344a177) } +func init() { + proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_e5baabe45344a177) +} var fileDescriptor_e5baabe45344a177 = []byte{ // 2589 bytes of a gzipped FileDescriptorProto diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto index ed08fcbc5..a2102d7aa 100644 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto +++ b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto @@ -40,6 +40,7 @@ syntax = "proto2"; package google.protobuf; + option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; @@ -59,8 +60,8 @@ message FileDescriptorSet { // Describes a complete .proto file. message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; @@ -100,8 +101,8 @@ message DescriptorProto { repeated EnumDescriptorProto enum_type = 4; message ExtensionRange { - optional int32 start = 1; - optional int32 end = 2; + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. optional ExtensionRangeOptions options = 3; } @@ -115,8 +116,8 @@ message DescriptorProto { // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. @@ -137,42 +138,42 @@ message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; + TYPE_INT64 = 3; + TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - }; + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } enum Label { // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - }; + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } optional string name = 1; optional int32 number = 3; @@ -234,8 +235,8 @@ message EnumDescriptorProto { // is inclusive such that it can appropriately represent the entire int32 // domain. message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. } // Range of reserved numeric values. Reserved numeric values may not be used @@ -276,9 +277,9 @@ message MethodDescriptorProto { optional MethodOptions options = 4; // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default=false]; + optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default=false]; + optional bool server_streaming = 6 [default = false]; } @@ -314,7 +315,6 @@ message MethodDescriptorProto { // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. - message FileOptions { // Sets the Java package where classes generated from this .proto will be @@ -337,7 +337,7 @@ message FileOptions { // named by java_outer_classname. However, the outer class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default=false]; + optional bool java_multiple_files = 10 [default = false]; // This option does nothing. optional bool java_generate_equals_and_hash = 20 [deprecated=true]; @@ -348,17 +348,17 @@ message FileOptions { // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default=false]; + optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } - optional OptimizeMode optimize_for = 9 [default=SPEED]; + optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: @@ -369,6 +369,7 @@ message FileOptions { + // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). @@ -379,20 +380,20 @@ message FileOptions { // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. - optional bool cc_generic_services = 16 [default=false]; - optional bool java_generic_services = 17 [default=false]; - optional bool py_generic_services = 18 [default=false]; - optional bool php_generic_services = 42 [default=false]; + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default=false]; + optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default=false]; + optional bool cc_enable_arenas = 31 [default = false]; // Sets the objective c class prefix which is prepended to all objective c @@ -417,10 +418,9 @@ message FileOptions { // determining the namespace. optional string php_namespace = 41; - // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be used - // for determining the namespace. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. optional string php_metadata_namespace = 44; // Use this option to change the package of ruby generated classes. Default @@ -428,6 +428,7 @@ message FileOptions { // determining the ruby package. optional string ruby_package = 45; + // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; @@ -458,18 +459,18 @@ message MessageOptions { // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. - optional bool message_set_wire_format = 1 [default=false]; + optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default=false]; + optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; // Whether the message is an automatically generated map entry type for the // maps field. @@ -486,7 +487,7 @@ message MessageOptions { // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementions still need to work as + // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax @@ -497,6 +498,7 @@ message MessageOptions { reserved 8; // javalite_serializable reserved 9; // javanano_as_lite + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -576,16 +578,16 @@ message FieldOptions { // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. - optional bool lazy = 5 [default=false]; + optional bool lazy = 5 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. - optional bool weak = 10 [default=false]; + optional bool weak = 10 [default = false]; // The parser stores options it doesn't recognize here. See above. @@ -615,7 +617,7 @@ message EnumOptions { // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; reserved 5; // javanano_as_lite @@ -631,7 +633,7 @@ message EnumValueOptions { // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default=false]; + optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -651,7 +653,7 @@ message ServiceOptions { // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. - optional bool deprecated = 33 [default=false]; + optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -671,18 +673,18 @@ message MethodOptions { // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default=false]; + optional bool deprecated = 33 [default = false]; // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects } - optional IdempotencyLevel idempotency_level = - 34 [default=IDEMPOTENCY_UNKNOWN]; + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -763,7 +765,7 @@ message SourceCodeInfo { // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines + // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to @@ -794,14 +796,14 @@ message SourceCodeInfo { // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). - repeated int32 path = 1 [packed=true]; + repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. - repeated int32 span = 2 [packed=true]; + repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be @@ -866,7 +868,7 @@ message GeneratedCodeInfo { message Annotation { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed=true]; + repeated int32 path = 1 [packed = true]; // Identifies the filesystem path to the original source .proto. optional string source_file = 2; diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go index 78ee52334..7b0ad1ad8 100644 --- a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go +++ b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go @@ -102,7 +102,8 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // type Any struct { // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. The last segment of the URL's path must represent + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). @@ -181,7 +182,9 @@ func init() { proto.RegisterType((*Any)(nil), "google.protobuf.Any") } -func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) } +func init() { + proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) +} var fileDescriptor_b53526c13ae22eb4 = []byte{ // 185 bytes of a gzipped FileDescriptorProto diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.proto b/vendor/github.com/golang/protobuf/ptypes/any/any.proto index 493294255..c9be85416 100644 --- a/vendor/github.com/golang/protobuf/ptypes/any/any.proto +++ b/vendor/github.com/golang/protobuf/ptypes/any/any.proto @@ -121,7 +121,8 @@ option objc_class_prefix = "GPB"; // message Any { // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. The last segment of the URL's path must represent + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go index 0d681ee21..58b078699 100644 --- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go +++ b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go @@ -41,7 +41,7 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; -// } else if (durations.seconds > 0 && duration.nanos < 0) { +// } else if (duration.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } @@ -142,7 +142,9 @@ func init() { proto.RegisterType((*Duration)(nil), "google.protobuf.Duration") } -func init() { proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_23597b2ebd7ac6c5) } +func init() { + proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_23597b2ebd7ac6c5) +} var fileDescriptor_23597b2ebd7ac6c5 = []byte{ // 190 bytes of a gzipped FileDescriptorProto diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto b/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto index 975fce41a..99cb102c3 100644 --- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto +++ b/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto @@ -61,7 +61,7 @@ option objc_class_prefix = "GPB"; // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; -// } else if (durations.seconds > 0 && duration.nanos < 0) { +// } else if (duration.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } @@ -101,7 +101,6 @@ option objc_class_prefix = "GPB"; // // message Duration { - // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go index 31cd846de..7a3b1e40e 100644 --- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go +++ b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go @@ -20,17 +20,19 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package -// A Timestamp represents a point in time independent of any time zone -// or calendar, represented as seconds and fractions of seconds at -// nanosecond resolution in UTC Epoch time. It is encoded using the -// Proleptic Gregorian Calendar which extends the Gregorian calendar -// backwards to year one. It is encoded assuming all minutes are 60 -// seconds long, i.e. leap seconds are "smeared" so that no leap second -// table is needed for interpretation. Range is from -// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. -// By restricting to that range, we ensure that we can convert to -// and from RFC 3339 date strings. -// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. // // # Examples // @@ -91,12 +93,14 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the -// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) // method. In Python, a standard `datetime.datetime` object can be converted -// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) -// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one -// can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( -// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D // ) to obtain a formatter capable of generating timestamps in this format. // // @@ -160,7 +164,9 @@ func init() { proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp") } -func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_292007bbfe81227e) } +func init() { + proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_292007bbfe81227e) +} var fileDescriptor_292007bbfe81227e = []byte{ // 191 bytes of a gzipped FileDescriptorProto diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto index eafb3fa03..cd357864a 100644 --- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto +++ b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto @@ -40,17 +40,19 @@ option java_outer_classname = "TimestampProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; -// A Timestamp represents a point in time independent of any time zone -// or calendar, represented as seconds and fractions of seconds at -// nanosecond resolution in UTC Epoch time. It is encoded using the -// Proleptic Gregorian Calendar which extends the Gregorian calendar -// backwards to year one. It is encoded assuming all minutes are 60 -// seconds long, i.e. leap seconds are "smeared" so that no leap second -// table is needed for interpretation. Range is from -// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. -// By restricting to that range, we ensure that we can convert to -// and from RFC 3339 date strings. -// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. // // # Examples // @@ -111,17 +113,18 @@ option objc_class_prefix = "GPB"; // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the -// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) // method. In Python, a standard `datetime.datetime` object can be converted -// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) -// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one -// can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( -// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D // ) to obtain a formatter capable of generating timestamps in this format. // // message Timestamp { - // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go b/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go index 938f646f0..24fbae6e3 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go @@ -19,7 +19,7 @@ func SortKeys(vs []reflect.Value) []reflect.Value { } // Sort the map keys. - sort.Slice(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) + sort.SliceStable(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) // Deduplicate keys (fails for NaNs). vs2 := vs[:1] @@ -42,6 +42,8 @@ func isLess(x, y reflect.Value) bool { case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return x.Uint() < y.Uint() case reflect.Float32, reflect.Float64: + // NOTE: This does not sort -0 as less than +0 + // since Go maps treat -0 and +0 as equal keys. fx, fy := x.Float(), y.Float() return fx < fy || math.IsNaN(fx) && !math.IsNaN(fy) case reflect.Complex64, reflect.Complex128: diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go b/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go index d13a12ccf..06a8ffd03 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go @@ -4,7 +4,10 @@ package value -import "reflect" +import ( + "math" + "reflect" +) // IsZero reports whether v is the zero value. // This does not rely on Interface and so can be used on unexported fields. @@ -17,9 +20,9 @@ func IsZero(v reflect.Value) bool { case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return v.Uint() == 0 case reflect.Float32, reflect.Float64: - return v.Float() == 0 + return math.Float64bits(v.Float()) == 0 case reflect.Complex64, reflect.Complex128: - return v.Complex() == 0 + return math.Float64bits(real(v.Complex())) == 0 && math.Float64bits(imag(v.Complex())) == 0 case reflect.String: return v.String() == "" case reflect.UnsafePointer: diff --git a/vendor/github.com/google/go-cmp/cmp/report_compare.go b/vendor/github.com/google/go-cmp/cmp/report_compare.go index 05efb992c..17a05eede 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_compare.go +++ b/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -168,7 +168,7 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te var isZero bool switch opts.DiffMode { case diffIdentical: - isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueX) + isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueY) case diffRemoved: isZero = value.IsZero(r.Value.ValueX) case diffInserted: diff --git a/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 5521c604c..2761b6289 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -208,7 +208,6 @@ func (opts formatOptions) FormatValue(v reflect.Value, m visitedPointers) (out t func formatMapKey(v reflect.Value) string { var opts formatOptions opts.TypeMode = elideType - opts.AvoidStringer = true opts.ShallowPointers = true s := opts.FormatValue(v, visitedPointers{}).String() return strings.TrimSpace(s) diff --git a/vendor/github.com/google/go-cmp/cmp/report_slices.go b/vendor/github.com/google/go-cmp/cmp/report_slices.go index 8cb3265e7..eafcf2e4c 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_slices.go +++ b/vendor/github.com/google/go-cmp/cmp/report_slices.go @@ -90,7 +90,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { } if r == '\n' { if maxLineLen < i-lastLineIdx { - lastLineIdx = i - lastLineIdx + maxLineLen = i - lastLineIdx } lastLineIdx = i + 1 numLines++ @@ -322,7 +322,7 @@ func coalesceInterveningIdentical(groups []diffStats, windowSize int) []diffStat hadX, hadY := prev.NumRemoved > 0, prev.NumInserted > 0 hasX, hasY := next.NumRemoved > 0, next.NumInserted > 0 if ((hadX || hasX) && (hadY || hasY)) && curr.NumIdentical <= windowSize { - *prev = (*prev).Append(*curr).Append(*next) + *prev = prev.Append(*curr).Append(*next) groups = groups[:len(groups)-1] // Truncate off equal group continue } diff --git a/vendor/github.com/google/go-cmp/cmp/report_text.go b/vendor/github.com/google/go-cmp/cmp/report_text.go index 80605d0e4..8b8fcab7b 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_text.go +++ b/vendor/github.com/google/go-cmp/cmp/report_text.go @@ -19,6 +19,11 @@ var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 type indentMode int func (n indentMode) appendIndent(b []byte, d diffMode) []byte { + // The output of Diff is documented as being unstable to provide future + // flexibility in changing the output for more humanly readable reports. + // This logic intentionally introduces instability to the exact output + // so that users can detect accidental reliance on stability early on, + // rather than much later when an actual change to the format occurs. if flags.Deterministic || randBool { // Use regular spaces (U+0020). switch d { @@ -360,7 +365,7 @@ func (s diffStats) String() string { // Pluralize the name (adjusting for some obscure English grammar rules). name := s.Name if sum > 1 { - name = name + "s" + name += "s" if strings.HasSuffix(name, "ys") { name = name[:len(name)-2] + "ies" // e.g., "entrys" => "entries" } diff --git a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md new file mode 100644 index 000000000..ccb46bbd8 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md @@ -0,0 +1,23 @@ +# HCL Changelog + +## v2.0.0 (Oct 2, 2019) + +Initial release of HCL 2, which is a new implementating combining the HCL 1 +language with the HIL expression language to produce a single language +supporting both nested configuration structures and arbitrary expressions. + +HCL 2 has an entirely new Go library API and so is _not_ a drop-in upgrade +relative to HCL 1. It's possible to import both versions of HCL into a single +program using Go's _semantic import versioning_ mechanism: + +``` +import ( + hcl1 "github.com/hashicorp/hcl" + hcl2 "github.com/hashicorp/hcl/v2" +) +``` + +--- + +Prior to v2.0.0 there was not a curated changelog. Consult the git history +from the latest v1.x.x tag for information on the changes to HCL 1. diff --git a/vendor/github.com/hashicorp/hcl2/LICENSE b/vendor/github.com/hashicorp/hcl/v2/LICENSE similarity index 100% rename from vendor/github.com/hashicorp/hcl2/LICENSE rename to vendor/github.com/hashicorp/hcl/v2/LICENSE diff --git a/vendor/github.com/hashicorp/hcl/v2/README.md b/vendor/github.com/hashicorp/hcl/v2/README.md new file mode 100644 index 000000000..d807a4245 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/README.md @@ -0,0 +1,204 @@ +# HCL + +HCL is a toolkit for creating structured configuration languages that are +both human- and machine-friendly, for use with command-line tools. +Although intended to be generally useful, it is primarily targeted +towards devops tools, servers, etc. + +> **NOTE:** This is major version 2 of HCL, whose Go API is incompatible with +> major version 1. Both versions are available for selection in Go Modules +> projects. HCL 2 _cannot_ be imported from Go projects that are not using Go Modules. For more information, see +> [our version selection guide](https://github.com/golang/go/wiki/Version-Selection). + +HCL has both a _native syntax_, intended to be pleasant to read and write for +humans, and a JSON-based variant that is easier for machines to generate +and parse. + +The HCL native syntax is inspired by [libucl](https://github.com/vstakhov/libucl), +[nginx configuration](http://nginx.org/en/docs/beginners_guide.html#conf_structure), +and others. + +It includes an expression syntax that allows basic inline computation and, +with support from the calling application, use of variables and functions +for more dynamic configuration languages. + +HCL provides a set of constructs that can be used by a calling application to +construct a configuration language. The application defines which attribute +names and nested block types are expected, and HCL parses the configuration +file, verifies that it conforms to the expected structure, and returns +high-level objects that the application can use for further processing. + +```go +package main + +import ( + "log" + "github.com/hashicorp/hcl/v2/hclsimple" +) + +type Config struct { + LogLevel string `hcl:"log_level"` +} + +func main() { + var config Config + err := hclsimple.DecodeFile("config.hcl", nil, &config) + if err != nil { + log.Fatalf("Failed to load configuration: %s", err) + } + log.Printf("Configuration is %#v", config) +} +``` + +A lower-level API is available for applications that need more control over +the parsing, decoding, and evaluation of configuration. + +## Why? + +Newcomers to HCL often ask: why not JSON, YAML, etc? + +Whereas JSON and YAML are formats for serializing data structures, HCL is +a syntax and API specifically designed for building structured configuration +formats. + +HCL attempts to strike a compromise between generic serialization formats +such as JSON and configuration formats built around full programming languages +such as Ruby. HCL syntax is designed to be easily read and written by humans, +and allows _declarative_ logic to permit its use in more complex applications. + +HCL is intended as a base syntax for configuration formats built +around key-value pairs and hierarchical blocks whose structure is well-defined +by the calling application, and this definition of the configuration structure +allows for better error messages and more convenient definition within the +calling application. + +It can't be denied that JSON is very convenient as a _lingua franca_ +for interoperability between different pieces of software. Because of this, +HCL defines a common configuration model that can be parsed from either its +native syntax or from a well-defined equivalent JSON structure. This allows +configuration to be provided as a mixture of human-authored configuration +files in the native syntax and machine-generated files in JSON. + +## Information Model and Syntax + +HCL is built around two primary concepts: _attributes_ and _blocks_. In +native syntax, a configuration file for a hypothetical application might look +something like this: + +```hcl +io_mode = "async" + +service "http" "web_proxy" { + listen_addr = "127.0.0.1:8080" + + process "main" { + command = ["/usr/local/bin/awesome-app", "server"] + } + + process "mgmt" { + command = ["/usr/local/bin/awesome-app", "mgmt"] + } +} +``` + +The JSON equivalent of this configuration is the following: + +```json +{ + "io_mode": "async", + "service": { + "http": { + "web_proxy": { + "listen_addr": "127.0.0.1:8080", + "process": { + "main": { + "command": ["/usr/local/bin/awesome-app", "server"] + }, + "mgmt": { + "command": ["/usr/local/bin/awesome-app", "mgmt"] + }, + } + } + } + } +} +``` + +Regardless of which syntax is used, the API within the calling application +is the same. It can either work directly with the low-level attributes and +blocks, for more advanced use-cases, or it can use one of the _decoder_ +packages to declaratively extract into either Go structs or dynamic value +structures. + +Attribute values can be expressions as well as just literal values: + +```hcl +# Arithmetic with literals and application-provided variables +sum = 1 + addend + +# String interpolation and templates +message = "Hello, ${name}!" + +# Application-provided functions +shouty_message = upper(message) +``` + +Although JSON syntax doesn't permit direct use of expressions, the interpolation +syntax allows use of arbitrary expressions within JSON strings: + +```json +{ + "sum": "${1 + addend}", + "message": "Hello, ${name}!", + "shouty_message": "${upper(message)}" +} +``` + +For more information, see the detailed specifications: + +* [Syntax-agnostic Information Model](hcl/spec.md) +* [HCL Native Syntax](hcl/hclsyntax/spec.md) +* [JSON Representation](hcl/json/spec.md) + +## Changes in 2.0 + +Version 2.0 of HCL combines the features of HCL 1.0 with those of the +interpolation language HIL to produce a single configuration language that +supports arbitrary expressions. + +This new version has a completely new parser and Go API, with no direct +migration path. Although the syntax is similar, the implementation takes some +very different approaches to improve on some "rough edges" that existed with +the original implementation and to allow for more robust error handling. + +It's possible to import both HCL 1 and HCL 2 into the same program using Go's +_semantic import versioning_ mechanism: + +```go +import ( + hcl1 "github.com/hashicorp/hcl" + hcl2 "github.com/hashicorp/hcl/v2" +) +``` + +## Acknowledgements + +HCL was heavily inspired by [libucl](https://github.com/vstakhov/libucl), +by [Vsevolod Stakhov](https://github.com/vstakhov). + +HCL and HIL originate in [HashiCorp Terraform](https://terraform.io/), +with the original parsers for each written by +[Mitchell Hashimoto](https://github.com/mitchellh). + +The original HCL parser was ported to pure Go (from yacc) by +[Fatih Arslan](https://github.com/fatih). The structure-related portions of +the new native syntax parser build on that work. + +The original HIL parser was ported to pure Go (from yacc) by +[Martin Atkins](https://github.com/apparentlymart). The expression-related +portions of the new native syntax parser build on that work. + +HCL 2, which merged the original HCL and HIL languages into this single new +language, builds on design and prototyping work by +[Martin Atkins](https://github.com/apparentlymart) in +[zcl](https://github.com/zclconf/go-zcl). diff --git a/vendor/github.com/hashicorp/hcl2/hcl/diagnostic.go b/vendor/github.com/hashicorp/hcl/v2/diagnostic.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/diagnostic.go rename to vendor/github.com/hashicorp/hcl/v2/diagnostic.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/diagnostic_text.go b/vendor/github.com/hashicorp/hcl/v2/diagnostic_text.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/diagnostic_text.go rename to vendor/github.com/hashicorp/hcl/v2/diagnostic_text.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/didyoumean.go b/vendor/github.com/hashicorp/hcl/v2/didyoumean.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/didyoumean.go rename to vendor/github.com/hashicorp/hcl/v2/didyoumean.go diff --git a/vendor/github.com/hashicorp/hcl/v2/doc.go b/vendor/github.com/hashicorp/hcl/v2/doc.go new file mode 100644 index 000000000..0d43fb2c7 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/doc.go @@ -0,0 +1,34 @@ +// Package hcl contains the main modelling types and general utility functions +// for HCL. +// +// For a simple entry point into HCL, see the package in the subdirectory +// "hclsimple", which has an opinionated function Decode that can decode HCL +// configurations in either native HCL syntax or JSON syntax into a Go struct +// type: +// +// package main +// +// import ( +// "log" +// "github.com/hashicorp/hcl/v2/hclsimple" +// ) +// +// type Config struct { +// LogLevel string `hcl:"log_level"` +// } +// +// func main() { +// var config Config +// err := hclsimple.DecodeFile("config.hcl", nil, &config) +// if err != nil { +// log.Fatalf("Failed to load configuration: %s", err) +// } +// log.Printf("Configuration is %#v", config) +// } +// +// If your application needs more control over the evaluation of the +// configuration, you can use the functions in the subdirectories hclparse, +// gohcl, hcldec, etc. Splitting the handling of configuration into multiple +// phases allows for advanced patterns such as allowing expressions in one +// part of the configuration to refer to data defined in another part. +package hcl diff --git a/vendor/github.com/hashicorp/hcl2/hcl/eval_context.go b/vendor/github.com/hashicorp/hcl/v2/eval_context.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/eval_context.go rename to vendor/github.com/hashicorp/hcl/v2/eval_context.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/expr_call.go b/vendor/github.com/hashicorp/hcl/v2/expr_call.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/expr_call.go rename to vendor/github.com/hashicorp/hcl/v2/expr_call.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/expr_list.go b/vendor/github.com/hashicorp/hcl/v2/expr_list.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/expr_list.go rename to vendor/github.com/hashicorp/hcl/v2/expr_list.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/expr_map.go b/vendor/github.com/hashicorp/hcl/v2/expr_map.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/expr_map.go rename to vendor/github.com/hashicorp/hcl/v2/expr_map.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/expr_unwrap.go b/vendor/github.com/hashicorp/hcl/v2/expr_unwrap.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/expr_unwrap.go rename to vendor/github.com/hashicorp/hcl/v2/expr_unwrap.go diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/README.md b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/README.md similarity index 100% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/README.md rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/README.md diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_body.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_body.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_body.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_body.go index dd3082239..65a9eab2d 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_body.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_body.go @@ -3,7 +3,7 @@ package dynblock import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_spec.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_spec.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_spec.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_spec.go index 41c0be267..98a51eadd 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_spec.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_spec.go @@ -3,7 +3,7 @@ package dynblock import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expr_wrap.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expr_wrap.go similarity index 96% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/expr_wrap.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expr_wrap.go index 6916fc158..460a1d2a3 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expr_wrap.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expr_wrap.go @@ -1,7 +1,7 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/iteration.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/iteration.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/iteration.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/iteration.go index 7056d3360..c56638868 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/iteration.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/iteration.go @@ -1,7 +1,7 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/public.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/public.go similarity index 87% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/public.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/public.go index b7e8ca951..a5bfd94ec 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/public.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/public.go @@ -1,7 +1,10 @@ +// Package dynblock provides an extension to HCL that allows dynamic +// declaration of nested blocks in certain contexts via a special block type +// named "dynamic". package dynblock import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Expand "dynamic" blocks in the given body, returning a new body that diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/schema.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/schema.go similarity index 95% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/schema.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/schema.go index dc8ed5a2f..b3907d6ea 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/schema.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/schema.go @@ -1,6 +1,6 @@ package dynblock -import "github.com/hashicorp/hcl2/hcl" +import "github.com/hashicorp/hcl/v2" var dynamicBlockHeaderSchema = hcl.BlockHeaderSchema{ Type: "dynamic", diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/unknown_body.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/unknown_body.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/unknown_body.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/unknown_body.go index 932f6a32b..ce98259a5 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/unknown_body.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/unknown_body.go @@ -1,7 +1,7 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/variables.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables.go index ad838f3e8..192339295 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables.go @@ -1,7 +1,7 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables_hcldec.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables_hcldec.go similarity index 95% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/variables_hcldec.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables_hcldec.go index a078d915c..907ef3eba 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables_hcldec.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables_hcldec.go @@ -1,8 +1,8 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hcldec" ) // VariablesHCLDec is a wrapper around WalkVariables that uses the given hcldec diff --git a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/README.md b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/README.md similarity index 98% rename from vendor/github.com/hashicorp/hcl2/ext/typeexpr/README.md rename to vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/README.md index ff2b3f229..ec7094702 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/README.md +++ b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/README.md @@ -35,7 +35,7 @@ to allow only calls and keywords the JSON syntax is able to parse the given string directly as an expression, rather than as a template as would be the case for normal expression evaluation. -For more information, see [the godoc reference](http://godoc.org/github.com/hashicorp/hcl2/ext/typeexpr). +For more information, see [the godoc reference](http://godoc.org/github.com/hashicorp/hcl/v2/ext/typeexpr). ## Type Expression Syntax diff --git a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/doc.go b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/ext/typeexpr/doc.go rename to vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/get_type.go b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/get_type.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/ext/typeexpr/get_type.go rename to vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/get_type.go index a84338a85..11b068979 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/get_type.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/get_type.go @@ -3,7 +3,7 @@ package typeexpr import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/public.go b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/public.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/ext/typeexpr/public.go rename to vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/public.go index e3f5eef59..3b8f618fb 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/public.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/public.go @@ -5,9 +5,9 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl/v2/go.mod b/vendor/github.com/hashicorp/hcl/v2/go.mod new file mode 100644 index 000000000..c152e6016 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/go.mod @@ -0,0 +1,21 @@ +module github.com/hashicorp/hcl/v2 + +require ( + github.com/agext/levenshtein v1.2.1 + github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 + github.com/apparentlymart/go-textseg v1.0.0 + github.com/davecgh/go-spew v1.1.1 + github.com/go-test/deep v1.0.3 + github.com/google/go-cmp v0.2.0 + github.com/kr/pretty v0.1.0 + github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 + github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/sergi/go-diff v1.0.0 + github.com/spf13/pflag v1.0.2 + github.com/stretchr/testify v1.2.2 // indirect + github.com/zclconf/go-cty v1.1.0 + golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 + golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect + golang.org/x/text v0.3.2 // indirect +) diff --git a/vendor/github.com/hashicorp/hcl/v2/go.sum b/vendor/github.com/hashicorp/hcl/v2/go.sum new file mode 100644 index 000000000..b3b95415f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/go.sum @@ -0,0 +1,51 @@ +github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= +github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +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/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +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 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +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/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 h1:p/H982KKEjUnLJkM3tt/LemDnOc1GiZL5FCVlORJ5zo= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dzugGxJ/SQHoNufZJq1w= +golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/decode.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/decode.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/gohcl/decode.go rename to vendor/github.com/hashicorp/hcl/v2/gohcl/decode.go index 3a149a8c2..7ba08eee0 100644 --- a/vendor/github.com/hashicorp/hcl2/gohcl/decode.go +++ b/vendor/github.com/hashicorp/hcl/v2/gohcl/decode.go @@ -6,7 +6,7 @@ import ( "github.com/zclconf/go-cty/cty" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/gocty" ) diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/doc.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/gohcl/doc.go rename to vendor/github.com/hashicorp/hcl/v2/gohcl/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/encode.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/encode.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/gohcl/encode.go rename to vendor/github.com/hashicorp/hcl/v2/gohcl/encode.go index 3cbf7e48a..d612e09c9 100644 --- a/vendor/github.com/hashicorp/hcl2/gohcl/encode.go +++ b/vendor/github.com/hashicorp/hcl/v2/gohcl/encode.go @@ -5,7 +5,7 @@ import ( "reflect" "sort" - "github.com/hashicorp/hcl2/hclwrite" + "github.com/hashicorp/hcl/v2/hclwrite" "github.com/zclconf/go-cty/cty/gocty" ) diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/schema.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/schema.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/gohcl/schema.go rename to vendor/github.com/hashicorp/hcl/v2/gohcl/schema.go index 88164cb05..ecf6ddbac 100644 --- a/vendor/github.com/hashicorp/hcl2/gohcl/schema.go +++ b/vendor/github.com/hashicorp/hcl/v2/gohcl/schema.go @@ -6,7 +6,7 @@ import ( "sort" "strings" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // ImpliedBodySchema produces a hcl.BodySchema derived from the type of the diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/types.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/types.go similarity index 91% rename from vendor/github.com/hashicorp/hcl2/gohcl/types.go rename to vendor/github.com/hashicorp/hcl/v2/gohcl/types.go index a94f275ad..a8d00f8ff 100644 --- a/vendor/github.com/hashicorp/hcl2/gohcl/types.go +++ b/vendor/github.com/hashicorp/hcl/v2/gohcl/types.go @@ -3,7 +3,7 @@ package gohcl import ( "reflect" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) var victimExpr hcl.Expression diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/block_labels.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/block_labels.go similarity index 90% rename from vendor/github.com/hashicorp/hcl2/hcldec/block_labels.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/block_labels.go index 7e652e9bc..71de45193 100644 --- a/vendor/github.com/hashicorp/hcl2/hcldec/block_labels.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/block_labels.go @@ -1,7 +1,7 @@ package hcldec import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) type blockLabel struct { diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/decode.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/decode.go similarity index 96% rename from vendor/github.com/hashicorp/hcl2/hcldec/decode.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/decode.go index 6cf93fedd..c6e42236d 100644 --- a/vendor/github.com/hashicorp/hcl2/hcldec/decode.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/decode.go @@ -1,7 +1,7 @@ package hcldec import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/doc.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcldec/doc.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/gob.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/gob.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcldec/gob.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/gob.go diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/public.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/public.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hcldec/public.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/public.go index 3c803632d..1fa548d0c 100644 --- a/vendor/github.com/hashicorp/hcl2/hcldec/public.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/public.go @@ -1,7 +1,7 @@ package hcldec import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/schema.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/schema.go similarity index 96% rename from vendor/github.com/hashicorp/hcl2/hcldec/schema.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/schema.go index b57bd9692..ddbe7fa4a 100644 --- a/vendor/github.com/hashicorp/hcl2/hcldec/schema.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/schema.go @@ -1,7 +1,7 @@ package hcldec import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // ImpliedSchema returns the *hcl.BodySchema implied by the given specification. diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/spec.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/spec.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcldec/spec.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/spec.go index f9da7f65b..6f2d9732c 100644 --- a/vendor/github.com/hashicorp/hcl2/hcldec/spec.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/spec.go @@ -5,7 +5,7 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/variables.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/variables.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hcldec/variables.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/variables.go index 7662516ca..f8440eb60 100644 --- a/vendor/github.com/hashicorp/hcl2/hcldec/variables.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/variables.go @@ -1,7 +1,7 @@ package hcldec import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Variables processes the given body with the given spec and returns a diff --git a/vendor/github.com/hashicorp/hcl2/hcled/doc.go b/vendor/github.com/hashicorp/hcl/v2/hcled/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcled/doc.go rename to vendor/github.com/hashicorp/hcl/v2/hcled/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/hcled/navigation.go b/vendor/github.com/hashicorp/hcl/v2/hcled/navigation.go similarity index 96% rename from vendor/github.com/hashicorp/hcl2/hcled/navigation.go rename to vendor/github.com/hashicorp/hcl/v2/hcled/navigation.go index 5d10cd86c..050ad758f 100644 --- a/vendor/github.com/hashicorp/hcl2/hcled/navigation.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcled/navigation.go @@ -1,7 +1,7 @@ package hcled import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) type contextStringer interface { diff --git a/vendor/github.com/hashicorp/hcl2/hclparse/parser.go b/vendor/github.com/hashicorp/hcl/v2/hclparse/parser.go similarity index 84% rename from vendor/github.com/hashicorp/hcl2/hclparse/parser.go rename to vendor/github.com/hashicorp/hcl/v2/hclparse/parser.go index 6d47f1268..1dc2eccd8 100644 --- a/vendor/github.com/hashicorp/hcl2/hclparse/parser.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclparse/parser.go @@ -1,12 +1,24 @@ +// Package hclparse has the main API entry point for parsing both HCL native +// syntax and HCL JSON. +// +// The main HCL package also includes SimpleParse and SimpleParseFile which +// can be a simpler interface for the common case where an application just +// needs to parse a single file. The gohcl package simplifies that further +// in its SimpleDecode function, which combines hcl.SimpleParse with decoding +// into Go struct values +// +// Package hclparse, then, is useful for applications that require more fine +// control over parsing or which need to load many separate files and keep +// track of them for possible error reporting or other analysis. package hclparse import ( "fmt" "io/ioutil" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" - "github.com/hashicorp/hcl2/hcl/json" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/hashicorp/hcl/v2/json" ) // NOTE: This is the public interface for parsing. The actual parsers are diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/diagnostics.go similarity index 95% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/diagnostics.go index 94eaf5892..8c20286b2 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/diagnostics.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // setDiagEvalContext is an internal helper that will impose a particular diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/didyoumean.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/didyoumean.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/didyoumean.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/didyoumean.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/doc.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/doc.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go index d3f7a74d3..963ed7752 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" @@ -804,7 +804,8 @@ func (e *ObjectConsExpr) ExprMap() []hcl.KeyValuePair { // which deals with the special case that a naked identifier in that position // must be interpreted as a literal string rather than evaluated directly. type ObjectConsKeyExpr struct { - Wrapped Expression + Wrapped Expression + ForceNonLiteral bool } func (e *ObjectConsKeyExpr) literalName() string { @@ -834,19 +835,21 @@ func (e *ObjectConsKeyExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnost // (This is handled at evaluation time rather than parse time because // an application using static analysis _can_ accept a naked multi-step // traversal here, if desired.) - if travExpr, isTraversal := e.Wrapped.(*ScopeTraversalExpr); isTraversal && len(travExpr.Traversal) > 1 { - var diags hcl.Diagnostics - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Ambiguous attribute key", - Detail: "If this expression is intended to be a reference, wrap it in parentheses. If it's instead intended as a literal name containing periods, wrap it in quotes to create a string literal.", - Subject: e.Range().Ptr(), - }) - return cty.DynamicVal, diags - } + if !e.ForceNonLiteral { + if travExpr, isTraversal := e.Wrapped.(*ScopeTraversalExpr); isTraversal && len(travExpr.Traversal) > 1 { + var diags hcl.Diagnostics + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Ambiguous attribute key", + Detail: "If this expression is intended to be a reference, wrap it in parentheses. If it's instead intended as a literal name containing periods, wrap it in quotes to create a string literal.", + Subject: e.Range().Ptr(), + }) + return cty.DynamicVal, diags + } - if ln := e.literalName(); ln != "" { - return cty.StringVal(ln), nil + if ln := e.literalName(); ln != "" { + return cty.StringVal(ln), nil + } } return e.Wrapped.Value(ctx) } @@ -861,6 +864,12 @@ func (e *ObjectConsKeyExpr) StartRange() hcl.Range { // Implementation for hcl.AbsTraversalForExpr. func (e *ObjectConsKeyExpr) AsTraversal() hcl.Traversal { + // If we're forcing a non-literal then we can never be interpreted + // as a traversal. + if e.ForceNonLiteral { + return nil + } + // We can produce a traversal only if our wrappee can. st, diags := hcl.AbsTraversalForExpr(e.Wrapped) if diags.HasErrors() { diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_ops.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_ops.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_ops.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_ops.go index 7f59f1a27..c1db0cecc 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_ops.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_ops.go @@ -3,7 +3,7 @@ package hclsyntax import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go index ca3dae189..9d425115f 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars.go index 9177092ce..a82bf790e 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars.go @@ -4,7 +4,7 @@ package hclsyntax // Run 'go generate' on this package to update the set of functions here. import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) func (e *AnonSymbolExpr) Variables() []hcl.Traversal { diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars_gen.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars_gen.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars_gen.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars_gen.go index 88f198009..6793771d4 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars_gen.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars_gen.go @@ -89,7 +89,7 @@ const outputPreamble = `package hclsyntax // Run 'go generate' on this package to update the set of functions here. import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" )` const outputMethodFmt = ` diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/file.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/file.go similarity index 90% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/file.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/file.go index 490c02556..f55e9ce2c 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/file.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/file.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // File is the top-level object resulting from parsing a configuration file. diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/generate.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/generate.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/keywords.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/keywords.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/navigation.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/navigation.go similarity index 96% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/navigation.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/navigation.go index c8c97f37c..af98ef045 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/navigation.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/navigation.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) type navigation struct { diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/node.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/node.go similarity index 94% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/node.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/node.go index 75812e63d..41b35e53f 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/node.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/node.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Node is the abstract type that every AST node implements. diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go index 772ebae2b..6fb284a8f 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go @@ -7,7 +7,7 @@ import ( "unicode/utf8" "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) @@ -1291,6 +1291,13 @@ func (p *parser) parseObjectCons() (Expression, hcl.Diagnostics) { break } + // Wrapping parens are not explicitly represented in the AST, but + // we want to use them here to disambiguate intepreting a mapping + // key as a full expression rather than just a name, and so + // we'll remember this was present and use it to force the + // behavior of our final ObjectConsKeyExpr. + forceNonLiteral := (p.Peek().Type == TokenOParen) + var key Expression var keyDiags hcl.Diagnostics key, keyDiags = p.ParseExpression() @@ -1307,7 +1314,10 @@ func (p *parser) parseObjectCons() (Expression, hcl.Diagnostics) { // We wrap up the key expression in a special wrapper that deals // with our special case that naked identifiers as object keys // are interpreted as literal strings. - key = &ObjectConsKeyExpr{Wrapped: key} + key = &ObjectConsKeyExpr{ + Wrapped: key, + ForceNonLiteral: forceNonLiteral, + } next = p.Peek() if next.Type != TokenEqual && next.Type != TokenColon { @@ -1651,7 +1661,7 @@ Token: break Token case TokenQuotedLit: - s, sDiags := p.decodeStringLit(tok) + s, sDiags := ParseStringLiteralToken(tok) diags = append(diags, sDiags...) ret.WriteString(s) @@ -1711,13 +1721,13 @@ Token: return ret.String(), hcl.RangeBetween(oQuote.Range, cQuote.Range), diags } -// decodeStringLit processes the given token, which must be either a +// ParseStringLiteralToken processes the given token, which must be either a // TokenQuotedLit or a TokenStringLit, returning the string resulting from // resolving any escape sequences. // // If any error diagnostics are returned, the returned string may be incomplete // or otherwise invalid. -func (p *parser) decodeStringLit(tok Token) (string, hcl.Diagnostics) { +func ParseStringLiteralToken(tok Token) (string, hcl.Diagnostics) { var quoted bool switch tok.Type { case TokenQuotedLit: @@ -1725,7 +1735,7 @@ func (p *parser) decodeStringLit(tok Token) (string, hcl.Diagnostics) { case TokenStringLit: quoted = false default: - panic("decodeQuotedLit can only be used with TokenStringLit and TokenQuotedLit tokens") + panic("ParseStringLiteralToken can only be used with TokenStringLit and TokenQuotedLit tokens") } var diags hcl.Diagnostics diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_template.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_template.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go index a141626fe..eb8f7ea38 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_template.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go @@ -6,7 +6,7 @@ import ( "unicode" "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) @@ -383,7 +383,7 @@ Token: switch next.Type { case TokenStringLit, TokenQuotedLit: - str, strDiags := p.decodeStringLit(next) + str, strDiags := ParseStringLiteralToken(next) diags = append(diags, strDiags...) if ltrim { diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_traversal.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_traversal.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_traversal.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_traversal.go index 2ff3ed6c1..7dcb0fd34 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_traversal.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_traversal.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/peeker.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/peeker.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/peeker.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/peeker.go index 5a4b50e2f..f056f906e 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/peeker.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/peeker.go @@ -7,7 +7,7 @@ import ( "runtime" "strings" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // This is set to true at init() time in tests, to enable more useful output diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/public.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/public.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/public.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/public.go index cf0ee2976..0b68efd60 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/public.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/public.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // ParseConfig parses the given buffer as a whole HCL config file, returning diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_string_lit.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_string_lit.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_string_lit.rl b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_string_lit.rl rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go index 581e35e00..794123a85 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go @@ -5,7 +5,7 @@ package hclsyntax import ( "bytes" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // This file is generated from scan_tokens.rl. DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.rl b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.rl rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl index 4443dc480..942ad92ba 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.rl +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl @@ -4,7 +4,7 @@ package hclsyntax import ( "bytes" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // This file is generated from scan_tokens.rl. DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/spec.md b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/spec.md rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md index d7faeedce..3fc5f5f1b 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/spec.md +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md @@ -71,14 +71,13 @@ except as described below. Whitespace is defined as a sequence of zero or more space characters (U+0020). Newline sequences (either U+000A or U+000D followed by U+000A) are _not_ considered whitespace but are ignored as such in certain contexts. - -Horizontal tab characters (U+0009) are not considered to be whitespace and -are not valid within HCL native syntax. +Horizontal tab characters (U+0009) are also treated as whitespace, but are +counted only as one "column" for the purpose of reporting source positions. Comments serve as program documentation and come in two forms: - _Line comments_ start with either the `//` or `#` sequences and end with - the next newline sequence. A line comments is considered equivalent to a + the next newline sequence. A line comment is considered equivalent to a newline sequence. - _Inline comments_ start with the `/*` sequence and end with the `*/` @@ -543,6 +542,22 @@ return type. Within the brackets that delimit the index key, newline sequences are ignored as whitespace. +The HCL native syntax also includes a _legacy_ index operator that exists +only for compatibility with the precursor language HIL: + +```ebnf +LegacyIndex = '.' digit+ +``` + +This legacy index operator must be supported by parser for compatibility but +should not be used in new configurations. This allows an attribute-access-like +syntax for indexing, must still be interpreted as an index operation rather +than attribute access. + +The legacy syntax does not support chaining of index operations, like +`foo.0.0.bar`, because the interpretation of `0.0` as a number literal token +takes priority and thus renders the resulting sequence invalid. + ### Attribute Access Operator The _attribute access_ operator returns the value of a single attribute in diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure.go index 476025d1b..2f7470c77 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // AsHCLBlock returns the block data expressed as a *hcl.Block. diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure_at_pos.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure_at_pos.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure_at_pos.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure_at_pos.go index d8f023ba0..587844ac2 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure_at_pos.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure_at_pos.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // ----------------------------------------------------------------------------- diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/token.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/token.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go index 3d898fd73..c7ffe2073 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/token.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Token represents a sequence of bytes from some HCL code that has been diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/token_type_string.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token_type_string.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/token_type_string.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/token_type_string.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/unicode2ragel.rb b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/unicode2ragel.rb similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/unicode2ragel.rb rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/unicode2ragel.rb diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/unicode_derived.rl b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/unicode_derived.rl similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/unicode_derived.rl rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/unicode_derived.rl diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/variables.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/variables.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/variables.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/variables.go index 91f417f87..3d68c4139 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/variables.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/variables.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Variables returns all of the variables referenced within a given experssion. diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/walk.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/walk.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/walk.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/walk.go index 90f81c9c1..89bfe676e 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/walk.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/walk.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // VisitFunc is the callback signature for VisitAll. diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/ast.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hclwrite/ast.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/ast.go diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/ast_attribute.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_attribute.go similarity index 95% rename from vendor/github.com/hashicorp/hcl2/hclwrite/ast_attribute.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_attribute.go index 975fa7428..609419fff 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/ast_attribute.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_attribute.go @@ -1,7 +1,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" ) type Attribute struct { diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/ast_block.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_block.go similarity index 55% rename from vendor/github.com/hashicorp/hcl2/hclwrite/ast_block.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_block.go index d5fd32bd5..f7d3921b4 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/ast_block.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_block.go @@ -1,7 +1,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) @@ -72,3 +72,47 @@ func (b *Block) init(typeName string, labels []string) { func (b *Block) Body() *Body { return b.body.content.(*Body) } + +// Type returns the type name of the block. +func (b *Block) Type() string { + typeNameObj := b.typeName.content.(*identifier) + return string(typeNameObj.token.Bytes) +} + +// Labels returns the labels of the block. +func (b *Block) Labels() []string { + labelNames := make([]string, 0, len(b.labels)) + list := b.labels.List() + + for _, label := range list { + switch labelObj := label.content.(type) { + case *identifier: + if labelObj.token.Type == hclsyntax.TokenIdent { + labelString := string(labelObj.token.Bytes) + labelNames = append(labelNames, labelString) + } + + case *quoted: + tokens := labelObj.tokens + if len(tokens) == 3 && + tokens[0].Type == hclsyntax.TokenOQuote && + tokens[1].Type == hclsyntax.TokenQuotedLit && + tokens[2].Type == hclsyntax.TokenCQuote { + // Note that TokenQuotedLit may contain escape sequences. + labelString, diags := hclsyntax.ParseStringLiteralToken(tokens[1].asHCLSyntax()) + + // If parsing the string literal returns error diagnostics + // then we can just assume the label doesn't match, because it's invalid in some way. + if !diags.HasErrors() { + labelNames = append(labelNames, labelString) + } + } + + default: + // If neither of the previous cases are true (should be impossible) + // then we can just ignore it, because it's invalid too. + } + } + + return labelNames +} diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/ast_body.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_body.go similarity index 68% rename from vendor/github.com/hashicorp/hcl2/hclwrite/ast_body.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_body.go index cf69fee21..c16d13e3a 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/ast_body.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_body.go @@ -1,8 +1,10 @@ package hclwrite import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "reflect" + + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) @@ -82,6 +84,56 @@ func (b *Body) GetAttribute(name string) *Attribute { return nil } +// getAttributeNode is like GetAttribute but it returns the node containing +// the selected attribute (if one is found) rather than the attribute itself. +func (b *Body) getAttributeNode(name string) *node { + for n := range b.items { + if attr, isAttr := n.content.(*Attribute); isAttr { + nameObj := attr.name.content.(*identifier) + if nameObj.hasName(name) { + // We've found it! + return n + } + } + } + + return nil +} + +// FirstMatchingBlock returns a first matching block from the body that has the +// given name and labels or returns nil if there is currently no matching +// block. +func (b *Body) FirstMatchingBlock(typeName string, labels []string) *Block { + for _, block := range b.Blocks() { + if typeName == block.Type() { + labelNames := block.Labels() + if len(labels) == 0 && len(labelNames) == 0 { + return block + } + if reflect.DeepEqual(labels, labelNames) { + return block + } + } + } + + return nil +} + +// RemoveBlock removes the given block from the body, if it's in that body. +// If it isn't present, this is a no-op. +// +// Returns true if it removed something, or false otherwise. +func (b *Body) RemoveBlock(block *Block) bool { + for n := range b.items { + if n.content == block { + n.Detach() + b.items.Remove(n) + return true + } + } + return false +} + // SetAttributeValue either replaces the expression of an existing attribute // of the given name or adds a new attribute definition to the end of the block. // @@ -124,6 +176,20 @@ func (b *Body) SetAttributeTraversal(name string, traversal hcl.Traversal) *Attr return attr } +// RemoveAttribute removes the attribute with the given name from the body. +// +// The return value is the attribute that was removed, or nil if there was +// no such attribute (in which case the call was a no-op). +func (b *Body) RemoveAttribute(name string) *Attribute { + node := b.getAttributeNode(name) + if node == nil { + return nil + } + node.Detach() + b.items.Remove(node) + return node.content.(*Attribute) +} + // AppendBlock appends an existing block (which must not be already attached // to a body) to the end of the receiving body. func (b *Body) AppendBlock(block *Block) *Block { diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/ast_expression.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_expression.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hclwrite/ast_expression.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_expression.go index 62d89fbef..854e71690 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/ast_expression.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_expression.go @@ -3,8 +3,8 @@ package hclwrite import ( "fmt" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/doc.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hclwrite/doc.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/format.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/format.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hclwrite/format.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/format.go index 7111ebde2..b94bee38d 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/format.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/format.go @@ -1,7 +1,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" ) var inKeyword = hclsyntax.Keyword([]byte{'i', 'n'}) diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/generate.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hclwrite/generate.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go index d249cfdf9..289a30d68 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/generate.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go @@ -5,8 +5,8 @@ import ( "unicode" "unicode/utf8" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/native_node_sorter.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/native_node_sorter.go similarity index 90% rename from vendor/github.com/hashicorp/hcl2/hclwrite/native_node_sorter.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/native_node_sorter.go index a13c0ec41..cedf68627 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/native_node_sorter.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/native_node_sorter.go @@ -1,7 +1,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" ) type nativeNodeSorter struct { diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/node.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/node.go similarity index 88% rename from vendor/github.com/hashicorp/hcl2/hclwrite/node.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/node.go index 71fd00faf..45669f7f9 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/node.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/node.go @@ -140,6 +140,18 @@ func (ns *nodes) AppendUnstructuredTokens(tokens Tokens) *node { return n } +// FindNodeWithContent searches the nodes for a node whose content equals +// the given content. If it finds one then it returns it. Otherwise it returns +// nil. +func (ns *nodes) FindNodeWithContent(content nodeContent) *node { + for n := ns.first; n != nil; n = n.after { + if n.content == content { + return n + } + } + return nil +} + // nodeSet is an unordered set of nodes. It is used to describe a set of nodes // that all belong to the same list that have some role or characteristic // in common. @@ -192,6 +204,18 @@ func (ns nodeSet) List() []*node { return ret } +// FindNodeWithContent searches the nodes for a node whose content equals +// the given content. If it finds one then it returns it. Otherwise it returns +// nil. +func (ns nodeSet) FindNodeWithContent(content nodeContent) *node { + for n := range ns { + if n.content == content { + return n + } + } + return nil +} + type internalWalkFunc func(*node) // inTree can be embedded into a content struct that has child nodes to get diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/parser.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/parser.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hclwrite/parser.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/parser.go index 1876818fd..d6cf532ea 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/parser.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/parser.go @@ -4,8 +4,8 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) @@ -307,7 +307,12 @@ func parseBlock(nativeBlock *hclsyntax.Block, from, leadComments, lineComments, before, labelTokens, from = from.Partition(rng) children.AppendUnstructuredTokens(before.Tokens()) tokens := labelTokens.Tokens() - ln := newNode(newQuoted(tokens)) + var ln *node + if len(tokens) == 1 && tokens[0].Type == hclsyntax.TokenIdent { + ln = newNode(newIdentifier(tokens[0])) + } else { + ln = newNode(newQuoted(tokens)) + } block.labels.Add(ln) children.AppendNode(ln) } diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/public.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/public.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hclwrite/public.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/public.go index 4d5ce2a6e..678a3aa45 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/public.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/public.go @@ -3,7 +3,7 @@ package hclwrite import ( "bytes" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // NewFile creates a new file object that is empty and ready to have constructs diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/tokens.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/tokens.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hclwrite/tokens.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/tokens.go index d87f81853..3bd3e5f48 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/tokens.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/tokens.go @@ -5,8 +5,8 @@ import ( "io" "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" ) // Token is a single sequence of bytes annotated with a type. It is similar diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/ast.go b/vendor/github.com/hashicorp/hcl/v2/json/ast.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hcl/json/ast.go rename to vendor/github.com/hashicorp/hcl/v2/json/ast.go index 753bfa0a7..9c580ca34 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/json/ast.go +++ b/vendor/github.com/hashicorp/hcl/v2/json/ast.go @@ -3,7 +3,7 @@ package json import ( "math/big" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) type node interface { diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/didyoumean.go b/vendor/github.com/hashicorp/hcl/v2/json/didyoumean.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/didyoumean.go rename to vendor/github.com/hashicorp/hcl/v2/json/didyoumean.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/doc.go b/vendor/github.com/hashicorp/hcl/v2/json/doc.go similarity index 64% rename from vendor/github.com/hashicorp/hcl2/hcl/json/doc.go rename to vendor/github.com/hashicorp/hcl/v2/json/doc.go index 4943f9bef..84d731939 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/json/doc.go +++ b/vendor/github.com/hashicorp/hcl/v2/json/doc.go @@ -5,4 +5,8 @@ // This is not a generic JSON parser. Instead, it deals with the mapping from // the JSON information model to the HCL information model, using a number // of hard-coded structural conventions. +// +// In most cases applications will not import this package directly, but will +// instead access its functionality indirectly through functions in the main +// "hcl" package and in the "hclparse" package. package json diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/navigation.go b/vendor/github.com/hashicorp/hcl/v2/json/navigation.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/navigation.go rename to vendor/github.com/hashicorp/hcl/v2/json/navigation.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/parser.go b/vendor/github.com/hashicorp/hcl/v2/json/parser.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/json/parser.go rename to vendor/github.com/hashicorp/hcl/v2/json/parser.go index d368ea8fc..7a54c51b6 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/json/parser.go +++ b/vendor/github.com/hashicorp/hcl/v2/json/parser.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/peeker.go b/vendor/github.com/hashicorp/hcl/v2/json/peeker.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/peeker.go rename to vendor/github.com/hashicorp/hcl/v2/json/peeker.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/public.go b/vendor/github.com/hashicorp/hcl/v2/json/public.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hcl/json/public.go rename to vendor/github.com/hashicorp/hcl/v2/json/public.go index 2728aa130..8dc4a36af 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/json/public.go +++ b/vendor/github.com/hashicorp/hcl/v2/json/public.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "os" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Parse attempts to parse the given buffer as JSON and, if successful, returns diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/scanner.go b/vendor/github.com/hashicorp/hcl/v2/json/scanner.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/json/scanner.go rename to vendor/github.com/hashicorp/hcl/v2/json/scanner.go index da7288423..912eabce2 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/json/scanner.go +++ b/vendor/github.com/hashicorp/hcl/v2/json/scanner.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) //go:generate stringer -type tokenType scanner.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/spec.md b/vendor/github.com/hashicorp/hcl/v2/json/spec.md similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/spec.md rename to vendor/github.com/hashicorp/hcl/v2/json/spec.md diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/structure.go b/vendor/github.com/hashicorp/hcl/v2/json/structure.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/json/structure.go rename to vendor/github.com/hashicorp/hcl/v2/json/structure.go index 74847c79a..76c9d7399 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/json/structure.go +++ b/vendor/github.com/hashicorp/hcl/v2/json/structure.go @@ -3,8 +3,8 @@ package json import ( "fmt" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/tokentype_string.go b/vendor/github.com/hashicorp/hcl/v2/json/tokentype_string.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/tokentype_string.go rename to vendor/github.com/hashicorp/hcl/v2/json/tokentype_string.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/merged.go b/vendor/github.com/hashicorp/hcl/v2/merged.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/merged.go rename to vendor/github.com/hashicorp/hcl/v2/merged.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/ops.go b/vendor/github.com/hashicorp/hcl/v2/ops.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/ops.go rename to vendor/github.com/hashicorp/hcl/v2/ops.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/pos.go b/vendor/github.com/hashicorp/hcl/v2/pos.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/pos.go rename to vendor/github.com/hashicorp/hcl/v2/pos.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/pos_scanner.go b/vendor/github.com/hashicorp/hcl/v2/pos_scanner.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/pos_scanner.go rename to vendor/github.com/hashicorp/hcl/v2/pos_scanner.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/schema.go b/vendor/github.com/hashicorp/hcl/v2/schema.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/schema.go rename to vendor/github.com/hashicorp/hcl/v2/schema.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/spec.md b/vendor/github.com/hashicorp/hcl/v2/spec.md similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/spec.md rename to vendor/github.com/hashicorp/hcl/v2/spec.md diff --git a/vendor/github.com/hashicorp/hcl2/hcl/static_expr.go b/vendor/github.com/hashicorp/hcl/v2/static_expr.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/static_expr.go rename to vendor/github.com/hashicorp/hcl/v2/static_expr.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/structure.go b/vendor/github.com/hashicorp/hcl/v2/structure.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/structure.go rename to vendor/github.com/hashicorp/hcl/v2/structure.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/structure_at_pos.go b/vendor/github.com/hashicorp/hcl/v2/structure_at_pos.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/structure_at_pos.go rename to vendor/github.com/hashicorp/hcl/v2/structure_at_pos.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/traversal.go b/vendor/github.com/hashicorp/hcl/v2/traversal.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/traversal.go rename to vendor/github.com/hashicorp/hcl/v2/traversal.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/traversal_for_expr.go b/vendor/github.com/hashicorp/hcl/v2/traversal_for_expr.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/traversal_for_expr.go rename to vendor/github.com/hashicorp/hcl/v2/traversal_for_expr.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/doc.go b/vendor/github.com/hashicorp/hcl2/hcl/doc.go deleted file mode 100644 index 01318c96f..000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/doc.go +++ /dev/null @@ -1 +0,0 @@ -package hcl diff --git a/vendor/github.com/hashicorp/hil/ast/arithmetic.go b/vendor/github.com/hashicorp/hil/ast/arithmetic.go deleted file mode 100644 index 94dc24f89..000000000 --- a/vendor/github.com/hashicorp/hil/ast/arithmetic.go +++ /dev/null @@ -1,43 +0,0 @@ -package ast - -import ( - "bytes" - "fmt" -) - -// Arithmetic represents a node where the result is arithmetic of -// two or more operands in the order given. -type Arithmetic struct { - Op ArithmeticOp - Exprs []Node - Posx Pos -} - -func (n *Arithmetic) Accept(v Visitor) Node { - for i, expr := range n.Exprs { - n.Exprs[i] = expr.Accept(v) - } - - return v(n) -} - -func (n *Arithmetic) Pos() Pos { - return n.Posx -} - -func (n *Arithmetic) GoString() string { - return fmt.Sprintf("*%#v", *n) -} - -func (n *Arithmetic) String() string { - var b bytes.Buffer - for _, expr := range n.Exprs { - b.WriteString(fmt.Sprintf("%s", expr)) - } - - return b.String() -} - -func (n *Arithmetic) Type(Scope) (Type, error) { - return TypeInt, nil -} diff --git a/vendor/github.com/hashicorp/hil/ast/arithmetic_op.go b/vendor/github.com/hashicorp/hil/ast/arithmetic_op.go deleted file mode 100644 index 18880c604..000000000 --- a/vendor/github.com/hashicorp/hil/ast/arithmetic_op.go +++ /dev/null @@ -1,24 +0,0 @@ -package ast - -// ArithmeticOp is the operation to use for the math. -type ArithmeticOp int - -const ( - ArithmeticOpInvalid ArithmeticOp = 0 - - ArithmeticOpAdd ArithmeticOp = iota - ArithmeticOpSub - ArithmeticOpMul - ArithmeticOpDiv - ArithmeticOpMod - - ArithmeticOpLogicalAnd - ArithmeticOpLogicalOr - - ArithmeticOpEqual - ArithmeticOpNotEqual - ArithmeticOpLessThan - ArithmeticOpLessThanOrEqual - ArithmeticOpGreaterThan - ArithmeticOpGreaterThanOrEqual -) diff --git a/vendor/github.com/hashicorp/hil/ast/ast.go b/vendor/github.com/hashicorp/hil/ast/ast.go deleted file mode 100644 index c6350f8bb..000000000 --- a/vendor/github.com/hashicorp/hil/ast/ast.go +++ /dev/null @@ -1,99 +0,0 @@ -package ast - -import ( - "fmt" -) - -// Node is the interface that all AST nodes must implement. -type Node interface { - // Accept is called to dispatch to the visitors. It must return the - // resulting Node (which might be different in an AST transform). - Accept(Visitor) Node - - // Pos returns the position of this node in some source. - Pos() Pos - - // Type returns the type of this node for the given context. - Type(Scope) (Type, error) -} - -// Pos is the starting position of an AST node -type Pos struct { - Column, Line int // Column/Line number, starting at 1 - Filename string // Optional source filename, if known -} - -func (p Pos) String() string { - if p.Filename == "" { - return fmt.Sprintf("%d:%d", p.Line, p.Column) - } else { - return fmt.Sprintf("%s:%d:%d", p.Filename, p.Line, p.Column) - } -} - -// InitPos is an initiaial position value. This should be used as -// the starting position (presets the column and line to 1). -var InitPos = Pos{Column: 1, Line: 1} - -// Visitors are just implementations of this function. -// -// The function must return the Node to replace this node with. "nil" is -// _not_ a valid return value. If there is no replacement, the original node -// should be returned. We build this replacement directly into the visitor -// pattern since AST transformations are a common and useful tool and -// building it into the AST itself makes it required for future Node -// implementations and very easy to do. -// -// Note that this isn't a true implementation of the visitor pattern, which -// generally requires proper type dispatch on the function. However, -// implementing this basic visitor pattern style is still very useful even -// if you have to type switch. -type Visitor func(Node) Node - -//go:generate stringer -type=Type - -// Type is the type of any value. -type Type uint32 - -const ( - TypeInvalid Type = 0 - TypeAny Type = 1 << iota - TypeBool - TypeString - TypeInt - TypeFloat - TypeList - TypeMap - - // This is a special type used by Terraform to mark "unknown" values. - // It is impossible for this type to be introduced into your HIL programs - // unless you explicitly set a variable to this value. In that case, - // any operation including the variable will return "TypeUnknown" as the - // type. - TypeUnknown -) - -func (t Type) Printable() string { - switch t { - case TypeInvalid: - return "invalid type" - case TypeAny: - return "any type" - case TypeBool: - return "type bool" - case TypeString: - return "type string" - case TypeInt: - return "type int" - case TypeFloat: - return "type float" - case TypeList: - return "type list" - case TypeMap: - return "type map" - case TypeUnknown: - return "type unknown" - default: - return "unknown type" - } -} diff --git a/vendor/github.com/hashicorp/hil/ast/call.go b/vendor/github.com/hashicorp/hil/ast/call.go deleted file mode 100644 index 055701102..000000000 --- a/vendor/github.com/hashicorp/hil/ast/call.go +++ /dev/null @@ -1,47 +0,0 @@ -package ast - -import ( - "fmt" - "strings" -) - -// Call represents a function call. -type Call struct { - Func string - Args []Node - Posx Pos -} - -func (n *Call) Accept(v Visitor) Node { - for i, a := range n.Args { - n.Args[i] = a.Accept(v) - } - - return v(n) -} - -func (n *Call) Pos() Pos { - return n.Posx -} - -func (n *Call) String() string { - args := make([]string, len(n.Args)) - for i, arg := range n.Args { - args[i] = fmt.Sprintf("%s", arg) - } - - return fmt.Sprintf("Call(%s, %s)", n.Func, strings.Join(args, ", ")) -} - -func (n *Call) Type(s Scope) (Type, error) { - f, ok := s.LookupFunc(n.Func) - if !ok { - return TypeInvalid, fmt.Errorf("unknown function: %s", n.Func) - } - - return f.ReturnType, nil -} - -func (n *Call) GoString() string { - return fmt.Sprintf("*%#v", *n) -} diff --git a/vendor/github.com/hashicorp/hil/ast/conditional.go b/vendor/github.com/hashicorp/hil/ast/conditional.go deleted file mode 100644 index be48f89d4..000000000 --- a/vendor/github.com/hashicorp/hil/ast/conditional.go +++ /dev/null @@ -1,36 +0,0 @@ -package ast - -import ( - "fmt" -) - -type Conditional struct { - CondExpr Node - TrueExpr Node - FalseExpr Node - Posx Pos -} - -// Accept passes the given visitor to the child nodes in this order: -// CondExpr, TrueExpr, FalseExpr. It then finally passes itself to the visitor. -func (n *Conditional) Accept(v Visitor) Node { - n.CondExpr = n.CondExpr.Accept(v) - n.TrueExpr = n.TrueExpr.Accept(v) - n.FalseExpr = n.FalseExpr.Accept(v) - - return v(n) -} - -func (n *Conditional) Pos() Pos { - return n.Posx -} - -func (n *Conditional) Type(Scope) (Type, error) { - // This is not actually a useful value; the type checker ignores - // this function when analyzing conditionals, just as with Arithmetic. - return TypeInt, nil -} - -func (n *Conditional) GoString() string { - return fmt.Sprintf("*%#v", *n) -} diff --git a/vendor/github.com/hashicorp/hil/ast/index.go b/vendor/github.com/hashicorp/hil/ast/index.go deleted file mode 100644 index 860c25fd2..000000000 --- a/vendor/github.com/hashicorp/hil/ast/index.go +++ /dev/null @@ -1,76 +0,0 @@ -package ast - -import ( - "fmt" - "strings" -) - -// Index represents an indexing operation into another data structure -type Index struct { - Target Node - Key Node - Posx Pos -} - -func (n *Index) Accept(v Visitor) Node { - n.Target = n.Target.Accept(v) - n.Key = n.Key.Accept(v) - return v(n) -} - -func (n *Index) Pos() Pos { - return n.Posx -} - -func (n *Index) String() string { - return fmt.Sprintf("Index(%s, %s)", n.Target, n.Key) -} - -func (n *Index) Type(s Scope) (Type, error) { - variableAccess, ok := n.Target.(*VariableAccess) - if !ok { - return TypeInvalid, fmt.Errorf("target is not a variable") - } - - variable, ok := s.LookupVar(variableAccess.Name) - if !ok { - return TypeInvalid, fmt.Errorf("unknown variable accessed: %s", variableAccess.Name) - } - - switch variable.Type { - case TypeList: - return n.typeList(variable, variableAccess.Name) - case TypeMap: - return n.typeMap(variable, variableAccess.Name) - default: - return TypeInvalid, fmt.Errorf("invalid index operation into non-indexable type: %s", variable.Type) - } -} - -func (n *Index) typeList(variable Variable, variableName string) (Type, error) { - // We assume type checking has already determined that this is a list - list := variable.Value.([]Variable) - - return VariableListElementTypesAreHomogenous(variableName, list) -} - -func (n *Index) typeMap(variable Variable, variableName string) (Type, error) { - // We assume type checking has already determined that this is a map - vmap := variable.Value.(map[string]Variable) - - return VariableMapValueTypesAreHomogenous(variableName, vmap) -} - -func reportTypes(typesFound map[Type]struct{}) string { - stringTypes := make([]string, len(typesFound)) - i := 0 - for k, _ := range typesFound { - stringTypes[0] = k.String() - i++ - } - return strings.Join(stringTypes, ", ") -} - -func (n *Index) GoString() string { - return fmt.Sprintf("*%#v", *n) -} diff --git a/vendor/github.com/hashicorp/hil/ast/literal.go b/vendor/github.com/hashicorp/hil/ast/literal.go deleted file mode 100644 index da6014fee..000000000 --- a/vendor/github.com/hashicorp/hil/ast/literal.go +++ /dev/null @@ -1,88 +0,0 @@ -package ast - -import ( - "fmt" - "reflect" -) - -// LiteralNode represents a single literal value, such as "foo" or -// 42 or 3.14159. Based on the Type, the Value can be safely cast. -type LiteralNode struct { - Value interface{} - Typex Type - Posx Pos -} - -// NewLiteralNode returns a new literal node representing the given -// literal Go value, which must correspond to one of the primitive types -// supported by HIL. Lists and maps cannot currently be constructed via -// this function. -// -// If an inappropriately-typed value is provided, this function will -// return an error. The main intended use of this function is to produce -// "synthetic" literals from constants in code, where the value type is -// well known at compile time. To easily store these in global variables, -// see also MustNewLiteralNode. -func NewLiteralNode(value interface{}, pos Pos) (*LiteralNode, error) { - goType := reflect.TypeOf(value) - var hilType Type - - switch goType.Kind() { - case reflect.Bool: - hilType = TypeBool - case reflect.Int: - hilType = TypeInt - case reflect.Float64: - hilType = TypeFloat - case reflect.String: - hilType = TypeString - default: - return nil, fmt.Errorf("unsupported literal node type: %T", value) - } - - return &LiteralNode{ - Value: value, - Typex: hilType, - Posx: pos, - }, nil -} - -// MustNewLiteralNode wraps NewLiteralNode and panics if an error is -// returned, thus allowing valid literal nodes to be easily assigned to -// global variables. -func MustNewLiteralNode(value interface{}, pos Pos) *LiteralNode { - node, err := NewLiteralNode(value, pos) - if err != nil { - panic(err) - } - return node -} - -func (n *LiteralNode) Accept(v Visitor) Node { - return v(n) -} - -func (n *LiteralNode) Pos() Pos { - return n.Posx -} - -func (n *LiteralNode) GoString() string { - return fmt.Sprintf("*%#v", *n) -} - -func (n *LiteralNode) String() string { - return fmt.Sprintf("Literal(%s, %v)", n.Typex, n.Value) -} - -func (n *LiteralNode) Type(Scope) (Type, error) { - return n.Typex, nil -} - -// IsUnknown returns true either if the node's value is itself unknown -// of if it is a collection containing any unknown elements, deeply. -func (n *LiteralNode) IsUnknown() bool { - return IsUnknown(Variable{ - Type: n.Typex, - Value: n.Value, - }) -} diff --git a/vendor/github.com/hashicorp/hil/ast/output.go b/vendor/github.com/hashicorp/hil/ast/output.go deleted file mode 100644 index 1e27f970b..000000000 --- a/vendor/github.com/hashicorp/hil/ast/output.go +++ /dev/null @@ -1,78 +0,0 @@ -package ast - -import ( - "bytes" - "fmt" -) - -// Output represents the root node of all interpolation evaluations. If the -// output only has one expression which is either a TypeList or TypeMap, the -// Output can be type-asserted to []interface{} or map[string]interface{} -// respectively. Otherwise the Output evaluates as a string, and concatenates -// the evaluation of each expression. -type Output struct { - Exprs []Node - Posx Pos -} - -func (n *Output) Accept(v Visitor) Node { - for i, expr := range n.Exprs { - n.Exprs[i] = expr.Accept(v) - } - - return v(n) -} - -func (n *Output) Pos() Pos { - return n.Posx -} - -func (n *Output) GoString() string { - return fmt.Sprintf("*%#v", *n) -} - -func (n *Output) String() string { - var b bytes.Buffer - for _, expr := range n.Exprs { - b.WriteString(fmt.Sprintf("%s", expr)) - } - - return b.String() -} - -func (n *Output) Type(s Scope) (Type, error) { - // Special case no expressions for backward compatibility - if len(n.Exprs) == 0 { - return TypeString, nil - } - - // Special case a single expression of types list or map - if len(n.Exprs) == 1 { - exprType, err := n.Exprs[0].Type(s) - if err != nil { - return TypeInvalid, err - } - switch exprType { - case TypeList: - return TypeList, nil - case TypeMap: - return TypeMap, nil - } - } - - // Otherwise ensure all our expressions are strings - for index, expr := range n.Exprs { - exprType, err := expr.Type(s) - if err != nil { - return TypeInvalid, err - } - // We only look for things we know we can't coerce with an implicit conversion func - if exprType == TypeList || exprType == TypeMap { - return TypeInvalid, fmt.Errorf( - "multi-expression HIL outputs may only have string inputs: %d is type %s", - index, exprType) - } - } - - return TypeString, nil -} diff --git a/vendor/github.com/hashicorp/hil/ast/scope.go b/vendor/github.com/hashicorp/hil/ast/scope.go deleted file mode 100644 index 7a975d999..000000000 --- a/vendor/github.com/hashicorp/hil/ast/scope.go +++ /dev/null @@ -1,90 +0,0 @@ -package ast - -import ( - "fmt" - "reflect" -) - -// Scope is the interface used to look up variables and functions while -// evaluating. How these functions/variables are defined are up to the caller. -type Scope interface { - LookupFunc(string) (Function, bool) - LookupVar(string) (Variable, bool) -} - -// Variable is a variable value for execution given as input to the engine. -// It records the value of a variables along with their type. -type Variable struct { - Value interface{} - Type Type -} - -// NewVariable creates a new Variable for the given value. This will -// attempt to infer the correct type. If it can't, an error will be returned. -func NewVariable(v interface{}) (result Variable, err error) { - switch v := reflect.ValueOf(v); v.Kind() { - case reflect.String: - result.Type = TypeString - default: - err = fmt.Errorf("Unknown type: %s", v.Kind()) - } - - result.Value = v - return -} - -// String implements Stringer on Variable, displaying the type and value -// of the Variable. -func (v Variable) String() string { - return fmt.Sprintf("{Variable (%s): %+v}", v.Type, v.Value) -} - -// Function defines a function that can be executed by the engine. -// The type checker will validate that the proper types will be called -// to the callback. -type Function struct { - // ArgTypes is the list of types in argument order. These are the - // required arguments. - // - // ReturnType is the type of the returned value. The Callback MUST - // return this type. - ArgTypes []Type - ReturnType Type - - // Variadic, if true, says that this function is variadic, meaning - // it takes a variable number of arguments. In this case, the - // VariadicType must be set. - Variadic bool - VariadicType Type - - // Callback is the function called for a function. The argument - // types are guaranteed to match the spec above by the type checker. - // The length of the args is strictly == len(ArgTypes) unless Varidiac - // is true, in which case its >= len(ArgTypes). - Callback func([]interface{}) (interface{}, error) -} - -// BasicScope is a simple scope that looks up variables and functions -// using a map. -type BasicScope struct { - FuncMap map[string]Function - VarMap map[string]Variable -} - -func (s *BasicScope) LookupFunc(n string) (Function, bool) { - if s == nil { - return Function{}, false - } - - v, ok := s.FuncMap[n] - return v, ok -} - -func (s *BasicScope) LookupVar(n string) (Variable, bool) { - if s == nil { - return Variable{}, false - } - - v, ok := s.VarMap[n] - return v, ok -} diff --git a/vendor/github.com/hashicorp/hil/ast/stack.go b/vendor/github.com/hashicorp/hil/ast/stack.go deleted file mode 100644 index bd2bc1578..000000000 --- a/vendor/github.com/hashicorp/hil/ast/stack.go +++ /dev/null @@ -1,25 +0,0 @@ -package ast - -// Stack is a stack of Node. -type Stack struct { - stack []Node -} - -func (s *Stack) Len() int { - return len(s.stack) -} - -func (s *Stack) Push(n Node) { - s.stack = append(s.stack, n) -} - -func (s *Stack) Pop() Node { - x := s.stack[len(s.stack)-1] - s.stack[len(s.stack)-1] = nil - s.stack = s.stack[:len(s.stack)-1] - return x -} - -func (s *Stack) Reset() { - s.stack = nil -} diff --git a/vendor/github.com/hashicorp/hil/ast/type_string.go b/vendor/github.com/hashicorp/hil/ast/type_string.go deleted file mode 100644 index 1f51a98dd..000000000 --- a/vendor/github.com/hashicorp/hil/ast/type_string.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by "stringer -type=Type"; DO NOT EDIT - -package ast - -import "fmt" - -const ( - _Type_name_0 = "TypeInvalid" - _Type_name_1 = "TypeAny" - _Type_name_2 = "TypeBool" - _Type_name_3 = "TypeString" - _Type_name_4 = "TypeInt" - _Type_name_5 = "TypeFloat" - _Type_name_6 = "TypeList" - _Type_name_7 = "TypeMap" - _Type_name_8 = "TypeUnknown" -) - -var ( - _Type_index_0 = [...]uint8{0, 11} - _Type_index_1 = [...]uint8{0, 7} - _Type_index_2 = [...]uint8{0, 8} - _Type_index_3 = [...]uint8{0, 10} - _Type_index_4 = [...]uint8{0, 7} - _Type_index_5 = [...]uint8{0, 9} - _Type_index_6 = [...]uint8{0, 8} - _Type_index_7 = [...]uint8{0, 7} - _Type_index_8 = [...]uint8{0, 11} -) - -func (i Type) String() string { - switch { - case i == 0: - return _Type_name_0 - case i == 2: - return _Type_name_1 - case i == 4: - return _Type_name_2 - case i == 8: - return _Type_name_3 - case i == 16: - return _Type_name_4 - case i == 32: - return _Type_name_5 - case i == 64: - return _Type_name_6 - case i == 128: - return _Type_name_7 - case i == 256: - return _Type_name_8 - default: - return fmt.Sprintf("Type(%d)", i) - } -} diff --git a/vendor/github.com/hashicorp/hil/ast/unknown.go b/vendor/github.com/hashicorp/hil/ast/unknown.go deleted file mode 100644 index d6ddaecc7..000000000 --- a/vendor/github.com/hashicorp/hil/ast/unknown.go +++ /dev/null @@ -1,30 +0,0 @@ -package ast - -// IsUnknown reports whether a variable is unknown or contains any value -// that is unknown. This will recurse into lists and maps and so on. -func IsUnknown(v Variable) bool { - // If it is unknown itself, return true - if v.Type == TypeUnknown { - return true - } - - // If it is a container type, check the values - switch v.Type { - case TypeList: - for _, el := range v.Value.([]Variable) { - if IsUnknown(el) { - return true - } - } - case TypeMap: - for _, el := range v.Value.(map[string]Variable) { - if IsUnknown(el) { - return true - } - } - default: - } - - // Not a container type or survive the above checks - return false -} diff --git a/vendor/github.com/hashicorp/hil/ast/variable_access.go b/vendor/github.com/hashicorp/hil/ast/variable_access.go deleted file mode 100644 index 4c1362d75..000000000 --- a/vendor/github.com/hashicorp/hil/ast/variable_access.go +++ /dev/null @@ -1,36 +0,0 @@ -package ast - -import ( - "fmt" -) - -// VariableAccess represents a variable access. -type VariableAccess struct { - Name string - Posx Pos -} - -func (n *VariableAccess) Accept(v Visitor) Node { - return v(n) -} - -func (n *VariableAccess) Pos() Pos { - return n.Posx -} - -func (n *VariableAccess) GoString() string { - return fmt.Sprintf("*%#v", *n) -} - -func (n *VariableAccess) String() string { - return fmt.Sprintf("Variable(%s)", n.Name) -} - -func (n *VariableAccess) Type(s Scope) (Type, error) { - v, ok := s.LookupVar(n.Name) - if !ok { - return TypeInvalid, fmt.Errorf("unknown variable: %s", n.Name) - } - - return v.Type, nil -} diff --git a/vendor/github.com/hashicorp/hil/ast/variables_helper.go b/vendor/github.com/hashicorp/hil/ast/variables_helper.go deleted file mode 100644 index 06bd18de2..000000000 --- a/vendor/github.com/hashicorp/hil/ast/variables_helper.go +++ /dev/null @@ -1,63 +0,0 @@ -package ast - -import "fmt" - -func VariableListElementTypesAreHomogenous(variableName string, list []Variable) (Type, error) { - if len(list) == 0 { - return TypeInvalid, fmt.Errorf("list %q does not have any elements so cannot determine type.", variableName) - } - - elemType := TypeUnknown - for _, v := range list { - if v.Type == TypeUnknown { - continue - } - - if elemType == TypeUnknown { - elemType = v.Type - continue - } - - if v.Type != elemType { - return TypeInvalid, fmt.Errorf( - "list %q does not have homogenous types. found %s and then %s", - variableName, - elemType, v.Type, - ) - } - - elemType = v.Type - } - - return elemType, nil -} - -func VariableMapValueTypesAreHomogenous(variableName string, vmap map[string]Variable) (Type, error) { - if len(vmap) == 0 { - return TypeInvalid, fmt.Errorf("map %q does not have any elements so cannot determine type.", variableName) - } - - elemType := TypeUnknown - for _, v := range vmap { - if v.Type == TypeUnknown { - continue - } - - if elemType == TypeUnknown { - elemType = v.Type - continue - } - - if v.Type != elemType { - return TypeInvalid, fmt.Errorf( - "map %q does not have homogenous types. found %s and then %s", - variableName, - elemType, v.Type, - ) - } - - elemType = v.Type - } - - return elemType, nil -} diff --git a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/diagnostic.go b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/diagnostic.go index 8d04ad4de..d9d276258 100644 --- a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/diagnostic.go +++ b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/diagnostic.go @@ -4,7 +4,7 @@ import ( "fmt" legacyhclparser "github.com/hashicorp/hcl/hcl/parser" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Diagnostic describes a problem (error or warning) encountered during diff --git a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/load.go b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/load.go index 2d13fe124..faa93ed6f 100644 --- a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/load.go +++ b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/load.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // LoadModule reads the directory at the given path and attempts to interpret diff --git a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/load_hcl.go b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/load_hcl.go index 72b5d4af9..9cb3aeef1 100644 --- a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/load_hcl.go +++ b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/load_hcl.go @@ -5,11 +5,11 @@ import ( "fmt" "strings" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl2/gohcl" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hclparse" + "github.com/hashicorp/hcl/v2/gohcl" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclparse" ctyjson "github.com/zclconf/go-cty/cty/json" ) diff --git a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go index 3af742ff7..fd6ca9e70 100644 --- a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go +++ b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go @@ -1,7 +1,7 @@ package tfconfig import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) var rootSchema = &hcl.BodySchema{ diff --git a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/source_pos.go b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/source_pos.go index 883914eb7..548c9f9a3 100644 --- a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/source_pos.go +++ b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/source_pos.go @@ -2,7 +2,7 @@ package tfconfig import ( legacyhcltoken "github.com/hashicorp/hcl/hcl/token" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // SourcePos is a pointer to a particular location in a source file. diff --git a/vendor/github.com/hashicorp/terraform-json/.gitignore b/vendor/github.com/hashicorp/terraform-json/.gitignore new file mode 100644 index 000000000..15b499b99 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/.gitignore @@ -0,0 +1,3 @@ +.terraform +plan.tfplan +terraform.tfstate.backup diff --git a/vendor/github.com/hashicorp/terraform-json/LICENSE b/vendor/github.com/hashicorp/terraform-json/LICENSE new file mode 100644 index 000000000..a612ad981 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/vendor/github.com/hashicorp/terraform-json/Makefile b/vendor/github.com/hashicorp/terraform-json/Makefile new file mode 100644 index 000000000..2d3f9a162 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/Makefile @@ -0,0 +1,20 @@ +GOTOOLS = \ + gotest.tools/gotestsum + +test: tools + gotestsum --format=short-verbose $(TEST) $(TESTARGS) + +generate: + cd test-fixtures && make generate + +modules: + go mod download && go mod verify + +test-circle: + mkdir -p test-results/terraform-json + gotestsum --format=short-verbose --junitfile test-results/terraform-json/results.xml + +tools: + go install $(GOTOOLS) + +.PHONY: test generate modules test-circle tools diff --git a/vendor/github.com/hashicorp/terraform-json/README.md b/vendor/github.com/hashicorp/terraform-json/README.md new file mode 100644 index 000000000..78fd3bfae --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/README.md @@ -0,0 +1,33 @@ +# terraform-json + +[![CircleCI](https://circleci.com/gh/hashicorp/terraform-json/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/terraform-json/tree/master) +[![GoDoc](https://godoc.org/github.com/hashicorp/terraform-json?status.svg)](https://godoc.org/github.com/hashicorp/terraform-json) + +This repository houses data types designed to help parse the data produced by +two [Terraform](https://www.terraform.io/) commands: + +* [`terraform show -json`](https://www.terraform.io/docs/commands/show.html#json-output) +* [`terraform providers schema -json`](https://www.terraform.io/docs/commands/providers/schema.html#json) + +While containing mostly data types, there are also a few helpers to assist with +working with the data. + +This repository also serves as de facto documentation for the formats produced +by these commands. For more details, see the +[GoDoc](https://godoc.org/github.com/hashicorp/terraform-json). + +## Why a Separate Repository? + +To reduce dependencies on any of Terraform core's internals, we've made a design +decision to make any helpers or libraries that work with the external JSON data +external and not a part of the Terraform GitHub repository itself. + +While Terraform core will change often and be relatively unstable, this library +will see a smaller amount of change. Most of the major changes have already +happened leading up to 0.12, so you can expect this library to only see minor +incremental changes going forward. + +For this reason, `terraform show -json` and `terraform providers schema -json` +is the recommended format for working with Terraform data externally, and as +such, if you require any help working with the data in these formats, or even a +reference of how the JSON is formatted, use this repository. diff --git a/vendor/github.com/hashicorp/terraform-json/action.go b/vendor/github.com/hashicorp/terraform-json/action.go new file mode 100644 index 000000000..51c4c8369 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/action.go @@ -0,0 +1,104 @@ +package tfjson + +// Action is a valid action type for a resource change. +// +// Note that a singular Action is not telling of a full resource +// change operation. Certain resource actions, such as replacement, +// are a composite of more than one type. See the Actions type and +// its helpers for more information. +type Action string + +const ( + // ActionNoop denotes a no-op operation. + ActionNoop Action = "no-op" + + // ActionCreate denotes a create operation. + ActionCreate Action = "create" + + // ActionRead denotes a read operation. + ActionRead Action = "read" + + // ActionUpdate denotes an update operation. + ActionUpdate Action = "update" + + // ActionDelete denotes a delete operation. + ActionDelete Action = "delete" +) + +// Actions denotes a valid change type. +type Actions []Action + +// NoOp is true if this set of Actions denotes a no-op. +func (a Actions) NoOp() bool { + if len(a) != 1 { + return false + } + + return a[0] == ActionNoop +} + +// Create is true if this set of Actions denotes creation of a new +// resource. +func (a Actions) Create() bool { + if len(a) != 1 { + return false + } + + return a[0] == ActionCreate +} + +// Read is true if this set of Actions denotes a read operation only. +func (a Actions) Read() bool { + if len(a) != 1 { + return false + } + + return a[0] == ActionRead +} + +// Update is true if this set of Actions denotes an update operation. +func (a Actions) Update() bool { + if len(a) != 1 { + return false + } + + return a[0] == ActionUpdate +} + +// Delete is true if this set of Actions denotes resource removal. +func (a Actions) Delete() bool { + if len(a) != 1 { + return false + } + + return a[0] == ActionDelete +} + +// DestroyBeforeCreate is true if this set of Actions denotes a +// destroy-before-create operation. This is the standard resource +// replacement method. +func (a Actions) DestroyBeforeCreate() bool { + if len(a) != 2 { + return false + } + + return a[0] == ActionDelete && a[1] == ActionCreate +} + +// CreateBeforeDestroy is true if this set of Actions denotes a +// create-before-destroy operation, usually the result of replacement +// to a resource that has the create_before_destroy lifecycle option +// set. +func (a Actions) CreateBeforeDestroy() bool { + if len(a) != 2 { + return false + } + + return a[0] == ActionCreate && a[1] == ActionDelete +} + +// Replace is true if this set of Actions denotes a valid replacement +// operation. +func (a Actions) Replace() bool { + return a.DestroyBeforeCreate() || a.CreateBeforeDestroy() +} diff --git a/vendor/github.com/hashicorp/terraform-json/config.go b/vendor/github.com/hashicorp/terraform-json/config.go new file mode 100644 index 000000000..3b8be511e --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/config.go @@ -0,0 +1,184 @@ +package tfjson + +import ( + "encoding/json" + "errors" +) + +// Config represents the complete configuration source. +type Config struct { + // A map of all provider instances across all modules in the + // configuration. + // + // The index for this field is opaque and should not be parsed. Use + // the individual fields in ProviderConfig to discern actual data + // about the provider such as name, alias, or defined module. + ProviderConfigs map[string]*ProviderConfig `json:"provider_config,omitempty"` + + // The root module in the configuration. Any child modules descend + // off of here. + RootModule *ConfigModule `json:"root_module,omitempty"` +} + +// Validate checks to ensure that the config is present. +func (c *Config) Validate() error { + if c == nil { + return errors.New("config is nil") + } + + return nil +} + +func (c *Config) UnmarshalJSON(b []byte) error { + type rawConfig Config + var config rawConfig + + err := json.Unmarshal(b, &config) + if err != nil { + return err + } + + *c = *(*Config)(&config) + + return c.Validate() +} + +// ProviderConfig describes a provider configuration instance. +type ProviderConfig struct { + // The name of the provider, ie: "aws". + Name string `json:"name,omitempty"` + + // The alias of the provider, ie: "us-east-1". + Alias string `json:"alias,omitempty"` + + // The address of the module the provider is declared in. + ModuleAddress string `json:"module_address,omitempty"` + + // Any non-special configuration values in the provider, indexed by + // key. + Expressions map[string]*Expression `json:"expressions,omitempty"` + + // The defined version constraint for this provider. + VersionConstraint string `json:"version_constraint,omitempty"` +} + +// ConfigModule describes a module in Terraform configuration. +type ConfigModule struct { + // The outputs defined in the module. + Outputs map[string]*ConfigOutput `json:"outputs,omitempty"` + + // The resources defined in the module. + Resources []*ConfigResource `json:"resources,omitempty"` + + // Any "module" stanzas within the specific module. + ModuleCalls map[string]*ModuleCall `json:"module_calls,omitempty"` + + // The variables defined in the module. + Variables map[string]*ConfigVariable `json:"variables,omitempty"` +} + +// ConfigOutput defines an output as defined in configuration. +type ConfigOutput struct { + // Indicates whether or not the output was marked as sensitive. + Sensitive bool `json:"sensitive,omitempty"` + + // The defined value of the output. + Expression *Expression `json:"expression,omitempty"` + + // The defined description of this output. + Description string `json:"description,omitempty"` + + // The defined dependencies tied to this output. + DependsOn []string `json:"depends_on,omitempty"` +} + +// ConfigResource is the configuration representation of a resource. +type ConfigResource struct { + // The address of the resource relative to the module that it is + // in. + Address string `json:"address,omitempty"` + + // The resource mode. + Mode ResourceMode `json:"mode,omitempty"` + + // The type of resource, ie: "null_resource" in + // "null_resource.foo". + Type string `json:"type,omitempty"` + + // The name of the resource, ie: "foo" in "null_resource.foo". + Name string `json:"name,omitempty"` + + // An opaque key representing the provider configuration this + // module uses. Note that there are more than one circumstance that + // this key will not match what is found in the ProviderConfigs + // field in the root Config structure, and as such should not be + // relied on for that purpose. + ProviderConfigKey string `json:"provider_config_key,omitempty"` + + // The list of provisioner defined for this configuration. This + // will be nil if no providers are defined. + Provisioners []*ConfigProvisioner `json:"provisioners,omitempty"` + + // Any non-special configuration values in the resource, indexed by + // key. + Expressions map[string]*Expression `json:"expressions,omitempty"` + + // The resource's configuration schema version. With access to the + // specific Terraform provider for this resource, this can be used + // to determine the correct schema for the configuration data + // supplied in Expressions. + SchemaVersion uint64 `json:"schema_version"` + + // The expression data for the "count" value in the resource. + CountExpression *Expression `json:"count_expression,omitempty"` + + // The expression data for the "for_each" value in the resource. + ForEachExpression *Expression `json:"for_each_expression,omitempty"` + + // The contents of the "depends_on" config directive, which + // declares explicit dependencies for this resource. + DependsOn []string `json:"depends_on,omitempty"` +} + +// ConfigVariable defines a variable as defined in configuration. +type ConfigVariable struct { + // The defined default value of the variable. + Default interface{} `json:"default,omitempty"` + + // The defined text description of the variable. + Description string `json:"description,omitempty"` +} + +// ConfigProvisioner describes a provisioner declared in a resource +// configuration. +type ConfigProvisioner struct { + // The type of the provisioner, ie: "local-exec". + Type string `json:"type,omitempty"` + + // Any non-special configuration values in the provisioner, indexed by + // key. + Expressions map[string]*Expression `json:"expressions,omitempty"` +} + +// ModuleCall describes a declared "module" within a configuration. +// It also contains the data for the module itself. +type ModuleCall struct { + // The contents of the "source" field. + Source string `json:"source,omitempty"` + + // Any non-special configuration values in the module, indexed by + // key. + Expressions map[string]*Expression `json:"expressions,omitempty"` + + // The expression data for the "count" value in the module. + CountExpression *Expression `json:"count_expression,omitempty"` + + // The expression data for the "for_each" value in the module. + ForEachExpression *Expression `json:"for_each_expression,omitempty"` + + // The configuration data for the module itself. + Module *ConfigModule `json:"module,omitempty"` + + // The version constraint for modules that come from the registry. + VersionConstraint string `json:"version_constraint,omitempty"` +} diff --git a/vendor/github.com/hashicorp/terraform-json/expression.go b/vendor/github.com/hashicorp/terraform-json/expression.go new file mode 100644 index 000000000..8a39face7 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/expression.go @@ -0,0 +1,127 @@ +package tfjson + +import "encoding/json" + +type unknownConstantValue struct{} + +// UnknownConstantValue is a singleton type that denotes that a +// constant value is explicitly unknown. This is set during an +// unmarshal when references are found in an expression to help more +// explicitly differentiate between an explicit null and unknown +// value. +var UnknownConstantValue = &unknownConstantValue{} + +// Expression describes the format for an individual key in a +// Terraform configuration. +// +// This struct wraps ExpressionData to support custom JSON parsing. +type Expression struct { + *ExpressionData +} + +// ExpressionData describes the format for an individual key in a +// Terraform configuration. +type ExpressionData struct { + // If the *entire* expression is a constant-defined value, this + // will contain the Go representation of the expression's data. + // + // Note that a nil here denotes and explicit null. When a value is + // unknown on part of the value coming from an expression that + // cannot be resolved at parse time, this field will contain + // UnknownConstantValue. + ConstantValue interface{} `json:"constant_value,omitempty"` + + // If any part of the expression contained values that were not + // able to be resolved at parse-time, this will contain a list of + // the referenced identifiers that caused the value to be unknown. + References []string `json:"references,omitempty"` + + // A list of complex objects that were nested in this expression. + // If this value is a nested block in configuration, sometimes + // referred to as a "sub-resource", this field will contain those + // values, and ConstantValue and References will be blank. + NestedBlocks []map[string]*Expression `json:"-"` +} + +// UnmarshalJSON implements json.Unmarshaler for Expression. +func (e *Expression) UnmarshalJSON(b []byte) error { + result := new(ExpressionData) + + // Check to see if this is an array first. If it is, this is more + // than likely a list of nested blocks. + var rawNested []map[string]json.RawMessage + if err := json.Unmarshal(b, &rawNested); err == nil { + result.NestedBlocks, err = unmarshalExpressionBlocks(rawNested) + if err != nil { + return err + } + } else { + // It's a non-nested expression block, parse normally + if err := json.Unmarshal(b, &result); err != nil { + return err + } + + // If References is non-zero, then ConstantValue is unknown. Set + // this explicitly. + if len(result.References) > 0 { + result.ConstantValue = UnknownConstantValue + } + } + + e.ExpressionData = result + return nil +} + +func unmarshalExpressionBlocks(raw []map[string]json.RawMessage) ([]map[string]*Expression, error) { + var result []map[string]*Expression + + for _, rawBlock := range raw { + block := make(map[string]*Expression) + for k, rawExpr := range rawBlock { + var expr *Expression + if err := json.Unmarshal(rawExpr, &expr); err != nil { + return nil, err + } + + block[k] = expr + } + + result = append(result, block) + } + + return result, nil +} + +// MarshalJSON implements json.Marshaler for Expression. +func (e *Expression) MarshalJSON() ([]byte, error) { + switch { + case len(e.ExpressionData.NestedBlocks) > 0: + return marshalExpressionBlocks(e.ExpressionData.NestedBlocks) + + case e.ExpressionData.ConstantValue == UnknownConstantValue: + return json.Marshal(&ExpressionData{ + References: e.ExpressionData.References, + }) + } + + return json.Marshal(e.ExpressionData) +} + +func marshalExpressionBlocks(nested []map[string]*Expression) ([]byte, error) { + var rawNested []map[string]json.RawMessage + for _, block := range nested { + rawBlock := make(map[string]json.RawMessage) + for k, expr := range block { + raw, err := json.Marshal(expr) + if err != nil { + return nil, err + } + + rawBlock[k] = raw + } + + rawNested = append(rawNested, rawBlock) + } + + return json.Marshal(rawNested) +} diff --git a/vendor/github.com/hashicorp/terraform-json/go.mod b/vendor/github.com/hashicorp/terraform-json/go.mod new file mode 100644 index 000000000..0e7ab50f3 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/go.mod @@ -0,0 +1,8 @@ +module github.com/hashicorp/terraform-json + +go 1.13 + +require ( + github.com/davecgh/go-spew v1.1.1 + github.com/zclconf/go-cty v1.2.1 +) diff --git a/vendor/github.com/hashicorp/terraform-json/go.sum b/vendor/github.com/hashicorp/terraform-json/go.sum new file mode 100644 index 000000000..1bb69979c --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/go.sum @@ -0,0 +1,19 @@ +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +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/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +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/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= +github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/hashicorp/terraform-json/plan.go b/vendor/github.com/hashicorp/terraform-json/plan.go new file mode 100644 index 000000000..2a8ebd213 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/plan.go @@ -0,0 +1,159 @@ +package tfjson + +import ( + "encoding/json" + "errors" + "fmt" +) + +// PlanFormatVersion is the version of the JSON plan format that is +// supported by this package. +const PlanFormatVersion = "0.1" + +// ResourceMode is a string representation of the resource type found +// in certain fields in the plan. +type ResourceMode string + +const ( + // DataResourceMode is the resource mode for data sources. + DataResourceMode ResourceMode = "data" + + // ManagedResourceMode is the resource mode for managed resources. + ManagedResourceMode ResourceMode = "managed" +) + +// Plan represents the entire contents of an output Terraform plan. +type Plan struct { + // The version of the plan format. This should always match the + // PlanFormatVersion constant in this package, or else an unmarshal + // will be unstable. + FormatVersion string `json:"format_version,omitempty"` + + // The version of Terraform used to make the plan. + TerraformVersion string `json:"terraform_version,omitempty"` + + // The variables set in the root module when creating the plan. + Variables map[string]*PlanVariable `json:"variables,omitempty"` + + // The common state representation of resources within this plan. + // This is a product of the existing state merged with the diff for + // this plan. + PlannedValues *StateValues `json:"planned_values,omitempty"` + + // The change operations for resources and data sources within this + // plan. + ResourceChanges []*ResourceChange `json:"resource_changes,omitempty"` + + // The change operations for outputs within this plan. + OutputChanges map[string]*Change `json:"output_changes,omitempty"` + + // The Terraform state prior to the plan operation. This is the + // same format as PlannedValues, without the current diff merged. + PriorState *State `json:"prior_state,omitempty"` + + // The Terraform configuration used to make the plan. + Config *Config `json:"configuration,omitempty"` +} + +// Validate checks to ensure that the plan is present, and the +// version matches the version supported by this library. +func (p *Plan) Validate() error { + if p == nil { + return errors.New("plan is nil") + } + + if p.FormatVersion == "" { + return errors.New("unexpected plan input, format version is missing") + } + + if PlanFormatVersion != p.FormatVersion { + return fmt.Errorf("unsupported plan format version: expected %q, got %q", PlanFormatVersion, p.FormatVersion) + } + + return nil +} + +func (p *Plan) UnmarshalJSON(b []byte) error { + type rawPlan Plan + var plan rawPlan + + err := json.Unmarshal(b, &plan) + if err != nil { + return err + } + + *p = *(*Plan)(&plan) + + return p.Validate() +} + +// ResourceChange is a description of an individual change action +// that Terraform plans to use to move from the prior state to a new +// state matching the configuration. +type ResourceChange struct { + // The absolute resource address. + Address string `json:"address,omitempty"` + + // The module portion of the above address. Omitted if the instance + // is in the root module. + ModuleAddress string `json:"module_address,omitempty"` + + // The resource mode. + Mode ResourceMode `json:"mode,omitempty"` + + // The resource type, example: "aws_instance" for aws_instance.foo. + Type string `json:"type,omitempty"` + + // The resource name, example: "foo" for aws_instance.foo. + Name string `json:"name,omitempty"` + + // The instance key for any resources that have been created using + // "count" or "for_each". If neither of these apply the key will be + // empty. + // + // This value can be either an integer (int) or a string. + Index interface{} `json:"index,omitempty"` + + // The name of the provider this resource belongs to. This allows + // the provider to be interpreted unambiguously in the unusual + // situation where a provider offers a resource type whose name + // does not start with its own name, such as the "googlebeta" + // provider offering "google_compute_instance". + ProviderName string `json:"provider_name,omitempty"` + + // An identifier used during replacement operations, and can be + // used to identify the exact resource being replaced in state. + DeposedKey string `json:"deposed,omitempty"` + + // The data describing the change that will be made to this object. + Change *Change `json:"change,omitempty"` +} + +// Change is the representation of a proposed change for an object. +type Change struct { + // The action to be carried out by this change. + Actions Actions `json:"actions,omitempty"` + + // Before and After are representations of the object value both + // before and after the action. For create and delete actions, + // either Before or After is unset (respectively). For no-op + // actions, both values will be identical. After will be incomplete + // if there are values within it that won't be known until after + // apply. + Before interface{} `json:"before,"` + After interface{} `json:"after,omitempty"` + + // A deep object of booleans that denotes any values that are + // unknown in a resource. These values were previously referred to + // as "computed" values. + // + // If the value cannot be found in this map, then its value should + // be available within After, so long as the operation supports it. + AfterUnknown interface{} `json:"after_unknown,omitempty"` +} + +// PlanVariable is a top-level variable in the Terraform plan. +type PlanVariable struct { + // The value for this variable at plan time. + Value interface{} `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/terraform-json/schemas.go b/vendor/github.com/hashicorp/terraform-json/schemas.go new file mode 100644 index 000000000..e025fbe04 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/schemas.go @@ -0,0 +1,168 @@ +package tfjson + +import ( + "encoding/json" + "errors" + "fmt" + + "github.com/zclconf/go-cty/cty" +) + +// ProviderSchemasFormatVersion is the version of the JSON provider +// schema format that is supported by this package. +const ProviderSchemasFormatVersion = "0.1" + +// ProviderSchemas represents the schemas of all providers and +// resources in use by the configuration. +type ProviderSchemas struct { + // The version of the plan format. This should always match the + // ProviderSchemasFormatVersion constant in this package, or else + // an unmarshal will be unstable. + FormatVersion string `json:"format_version,omitempty"` + + // The schemas for the providers in this configuration, indexed by + // provider type. Aliases are not included, and multiple instances + // of a provider in configuration will be represented by a single + // provider here. + Schemas map[string]*ProviderSchema `json:"provider_schemas,omitempty"` +} + +// Validate checks to ensure that ProviderSchemas is present, and the +// version matches the version supported by this library. +func (p *ProviderSchemas) Validate() error { + if p == nil { + return errors.New("provider schema data is nil") + } + + if p.FormatVersion == "" { + return errors.New("unexpected provider schema data, format version is missing") + } + + if ProviderSchemasFormatVersion != p.FormatVersion { + return fmt.Errorf("unsupported provider schema data format version: expected %q, got %q", PlanFormatVersion, p.FormatVersion) + } + + return nil +} + +func (p *ProviderSchemas) UnmarshalJSON(b []byte) error { + type rawSchemas ProviderSchemas + var schemas rawSchemas + + err := json.Unmarshal(b, &schemas) + if err != nil { + return err + } + + *p = *(*ProviderSchemas)(&schemas) + + return p.Validate() +} + +// ProviderSchema is the JSON representation of the schema of an +// entire provider, including the provider configuration and any +// resources and data sources included with the provider. +type ProviderSchema struct { + // The schema for the provider's configuration. + ConfigSchema *Schema `json:"provider,omitempty"` + + // The schemas for any resources in this provider. + ResourceSchemas map[string]*Schema `json:"resource_schemas,omitempty"` + + // The schemas for any data sources in this provider. + DataSourceSchemas map[string]*Schema `json:"data_source_schemas,omitempty"` +} + +// Schema is the JSON representation of a particular schema +// (provider configuration, resources, data sources). +type Schema struct { + // The version of the particular resource schema. + Version uint64 `json:"version"` + + // The root-level block of configuration values. + Block *SchemaBlock `json:"block,omitempty"` +} + +// SchemaBlock represents a nested block within a particular schema. +type SchemaBlock struct { + // The attributes defined at the particular level of this block. + Attributes map[string]*SchemaAttribute `json:"attributes,omitempty"` + + // Any nested blocks within this particular block. + NestedBlocks map[string]*SchemaBlockType `json:"block_types,omitempty"` +} + +// SchemaNestingMode is the nesting mode for a particular nested +// schema block. +type SchemaNestingMode string + +const ( + // SchemaNestingModeSingle denotes single block nesting mode, which + // allows a single block of this specific type only in + // configuration. This is generally the same as list or set types + // with a single-element constraint. + SchemaNestingModeSingle SchemaNestingMode = "single" + + // SchemaNestingModeList denotes list block nesting mode, which + // allows an ordered list of blocks where duplicates are allowed. + SchemaNestingModeList SchemaNestingMode = "list" + + // SchemaNestingModeSet denotes set block nesting mode, which + // allows an unordered list of blocks where duplicates are + // generally not allowed. What is considered a duplicate is up to + // the rules of the set itself, which may or may not cover all + // fields in the block. + SchemaNestingModeSet SchemaNestingMode = "set" + + // SchemaNestingModeMap denotes map block nesting mode. This + // creates a map of all declared blocks of the block type within + // the parent, keying them on the label supplied in the block + // declaration. This allows for blocks to be declared in the same + // style as resources. + SchemaNestingModeMap SchemaNestingMode = "map" +) + +// SchemaBlockType describes a nested block within a schema. +type SchemaBlockType struct { + // The nesting mode for this block. + NestingMode SchemaNestingMode `json:"nesting_mode,omitempty"` + + // The block data for this block type, including attributes and + // subsequent nested blocks. + Block *SchemaBlock `json:"block,omitempty"` + + // The lower limit on items that can be declared of this block + // type. + MinItems uint64 `json:"min_items,omitempty"` + + // The upper limit on items that can be declared of this block + // type. + MaxItems uint64 `json:"max_items,omitempty"` +} + +// SchemaAttribute describes an attribute within a schema block. +type SchemaAttribute struct { + // The attribute type. + AttributeType cty.Type `json:"type,omitempty"` + + // The description field for this attribute. + Description string `json:"description,omitempty"` + + // If true, this attribute is required - it has to be entered in + // configuration. + Required bool `json:"required,omitempty"` + + // If true, this attribute is optional - it does not need to be + // entered in configuration. + Optional bool `json:"optional,omitempty"` + + // If true, this attribute is computed - it can be set by the + // provider. It may also be set by configuration if Optional is + // true. + Computed bool `json:"computed,omitempty"` + + // If true, this attribute is sensitive and will not be displayed + // in logs. Future versions of Terraform may encrypt or otherwise + // treat these values with greater care than non-sensitive fields. + Sensitive bool `json:"sensitive,omitempty"` +} diff --git a/vendor/github.com/hashicorp/terraform-json/state.go b/vendor/github.com/hashicorp/terraform-json/state.go new file mode 100644 index 000000000..a320bc827 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/state.go @@ -0,0 +1,141 @@ +package tfjson + +import ( + "encoding/json" + "errors" + "fmt" +) + +// StateFormatVersion is the version of the JSON state format that is +// supported by this package. +const StateFormatVersion = "0.1" + +// State is the top-level representation of a Terraform state. +type State struct { + // The version of the state format. This should always match the + // StateFormatVersion constant in this package, or else am + // unmarshal will be unstable. + FormatVersion string `json:"format_version,omitempty"` + + // The Terraform version used to make the state. + TerraformVersion string `json:"terraform_version,omitempty"` + + // The values that make up the state. + Values *StateValues `json:"values,omitempty"` +} + +// Validate checks to ensure that the state is present, and the +// version matches the version supported by this library. +func (s *State) Validate() error { + if s == nil { + return errors.New("state is nil") + } + + if s.FormatVersion == "" { + return errors.New("unexpected state input, format version is missing") + } + + if StateFormatVersion != s.FormatVersion { + return fmt.Errorf("unsupported state format version: expected %q, got %q", StateFormatVersion, s.FormatVersion) + } + + return nil +} + +func (s *State) UnmarshalJSON(b []byte) error { + type rawState State + var state rawState + + err := json.Unmarshal(b, &state) + if err != nil { + return err + } + + *s = *(*State)(&state) + + return s.Validate() +} + +// StateValues is the common representation of resolved values for both the +// prior state (which is always complete) and the planned new state. +type StateValues struct { + // The Outputs for this common state representation. + Outputs map[string]*StateOutput `json:"outputs,omitempty"` + + // The root module in this state representation. + RootModule *StateModule `json:"root_module,omitempty"` +} + +// StateModule is the representation of a module in the common state +// representation. This can be the root module or a child module. +type StateModule struct { + // All resources or data sources within this module. + Resources []*StateResource `json:"resources,omitempty"` + + // The absolute module address, omitted for the root module. + Address string `json:"address,omitempty"` + + // Any child modules within this module. + ChildModules []*StateModule `json:"child_modules,omitempty"` +} + +// StateResource is the representation of a resource in the common +// state representation. +type StateResource struct { + // The absolute resource address. + Address string `json:"address,omitempty"` + + // The resource mode. + Mode ResourceMode `json:"mode,omitempty"` + + // The resource type, example: "aws_instance" for aws_instance.foo. + Type string `json:"type,omitempty"` + + // The resource name, example: "foo" for aws_instance.foo. + Name string `json:"name,omitempty"` + + // The instance key for any resources that have been created using + // "count" or "for_each". If neither of these apply the key will be + // empty. + // + // This value can be either an integer (int) or a string. + Index interface{} `json:"index,omitempty"` + + // The name of the provider this resource belongs to. This allows + // the provider to be interpreted unambiguously in the unusual + // situation where a provider offers a resource type whose name + // does not start with its own name, such as the "googlebeta" + // provider offering "google_compute_instance". + ProviderName string `json:"provider_name,omitempty"` + + // The version of the resource type schema the "values" property + // conforms to. + SchemaVersion uint64 `json:"schema_version,"` + + // The JSON representation of the attribute values of the resource, + // whose structure depends on the resource type schema. Any unknown + // values are omitted or set to null, making them indistinguishable + // from absent values. + AttributeValues map[string]interface{} `json:"values,omitempty"` + + // The addresses of the resources that this resource depends on. + DependsOn []string `json:"depends_on,omitempty"` + + // If true, the resource has been marked as tainted and will be + // re-created on the next update. + Tainted bool `json:"tainted,omitempty"` + + // DeposedKey is set if the resource instance has been marked Deposed and + // will be destroyed on the next apply. + DeposedKey string `json:"deposed_key,omitempty"` +} + +// StateOutput represents an output value in a common state +// representation. +type StateOutput struct { + // Whether or not the output was marked as sensitive. + Sensitive bool `json:"sensitive"` + + // The value of the output. + Value interface{} `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/terraform-json/tfjson.go b/vendor/github.com/hashicorp/terraform-json/tfjson.go new file mode 100644 index 000000000..55f9ac444 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/tfjson.go @@ -0,0 +1,9 @@ +// Package tfjson is a de-coupled helper library containing types for +// the plan format output by "terraform show -json" command. This +// command is designed for the export of Terraform plan data in +// a format that can be easily processed by tools unrelated to +// Terraform. +// +// This format is stable and should be used over the binary plan data +// whenever possible. +package tfjson diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/acctest/doc.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/acctest/doc.go new file mode 100644 index 000000000..08bff3c88 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/acctest/doc.go @@ -0,0 +1,31 @@ +// Package acctest provides the ability to opt in to the new binary test driver. The binary +// test driver allows you to run your acceptance tests with a binary of Terraform instead of +// an emulated version packaged inside the SDK. This allows for a number of important +// enhancements, but most notably a more realistic testing experience and matrix testing +// against multiple versions of Terraform CLI. This also allows the SDK to be completely +// separated, at a dependency level, from the Terraform CLI, as long as it is >= 0.12.0 +// +// The new test driver must be enabled by initialising the test helper in your TestMain +// function in all provider packages that run acceptance tests. Most providers have only +// one package. +// +// In v2 of the SDK, the binary test driver will be mandatory. +// +// After importing this package, you can add code similar to the following: +// +// func TestMain(m *testing.M) { +// acctest.UseBinaryDriver("provider_name", Provider) +// resource.TestMain(m) +// } +// +// Where `Provider` is the function that returns the instance of a configured `terraform.ResourceProvider` +// Some providers already have a TestMain defined, usually for the purpose of enabling test +// sweepers. These additional occurrences should be removed. +// +// Initialising the binary test helper using UseBinaryDriver causes all tests to be run using +// the new binary driver. Until SDK v2, the DisableBinaryDriver boolean property can be used +// to use the legacy test driver for an individual TestCase. +// +// It is no longer necessary to import other Terraform providers as Go modules: these +// imports should be removed. +package acctest diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/acctest/helper.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/acctest/helper.go new file mode 100644 index 000000000..050b9741d --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/acctest/helper.go @@ -0,0 +1,26 @@ +package acctest + +import ( + "os" + + "github.com/hashicorp/terraform-plugin-sdk/plugin" + tftest "github.com/hashicorp/terraform-plugin-test" +) + +var TestHelper *tftest.Helper + +func UseBinaryDriver(name string, providerFunc plugin.ProviderFunc) { + sourceDir, err := os.Getwd() + if err != nil { + panic(err) + } + + if tftest.RunningAsPlugin() { + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: providerFunc, + }) + os.Exit(0) + } else { + TestHelper = tftest.AutoInitProviderHelper(name, sourceDir) + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/map.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/map.go index 02a993d69..4befdb353 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/map.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/map.go @@ -124,7 +124,7 @@ func (m *Map) Refresh( // a ResourceProvider. func (m *Map) Resources() []terraform.ResourceType { ks := make([]string, 0, len(m.Mapping)) - for k, _ := range m.Mapping { + for k := range m.Mapping { ks = append(ks, k) } sort.Strings(ks) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/state_shim.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/state_shim.go index 1e3225933..768b48470 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/state_shim.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/state_shim.go @@ -3,15 +3,16 @@ package resource import ( "encoding/json" "fmt" + "strconv" - "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" - "github.com/zclconf/go-cty/cty" - + tfjson "github.com/hashicorp/terraform-json" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim" - "github.com/hashicorp/terraform-plugin-sdk/internal/states" + "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/zclconf/go-cty/cty" ) // shimState takes a new *states.State and reverts it to a legacy state for the provider ACC tests @@ -186,3 +187,279 @@ func shimmedAttributes(instance *states.ResourceInstanceObjectSrc, res *schema.R return instanceState.Attributes, nil } + +type shimmedState struct { + state *terraform.State +} + +func shimStateFromJson(jsonState *tfjson.State) (*terraform.State, error) { + state := terraform.NewState() + state.TFVersion = jsonState.TerraformVersion + + if jsonState.Values == nil { + // the state is empty + return state, nil + } + + for key, output := range jsonState.Values.Outputs { + os, err := shimOutputState(output) + if err != nil { + return nil, err + } + state.RootModule().Outputs[key] = os + } + + ss := &shimmedState{state} + err := ss.shimStateModule(jsonState.Values.RootModule) + if err != nil { + return nil, err + } + + return state, nil +} + +func shimOutputState(so *tfjson.StateOutput) (*terraform.OutputState, error) { + os := &terraform.OutputState{ + Sensitive: so.Sensitive, + } + + switch v := so.Value.(type) { + case string: + os.Type = "string" + os.Value = v + return os, nil + case []interface{}: + os.Type = "list" + if len(v) == 0 { + os.Value = v + return os, nil + } + switch firstElem := v[0].(type) { + case string: + elements := make([]interface{}, len(v)) + for i, el := range v { + elements[i] = el.(string) + } + os.Value = elements + case bool: + elements := make([]interface{}, len(v)) + for i, el := range v { + elements[i] = el.(bool) + } + os.Value = elements + // unmarshalled number from JSON will always be float64 + case float64: + elements := make([]interface{}, len(v)) + for i, el := range v { + elements[i] = el.(float64) + } + os.Value = elements + case []interface{}: + os.Value = v + case map[string]interface{}: + os.Value = v + default: + return nil, fmt.Errorf("unexpected output list element type: %T", firstElem) + } + return os, nil + case map[string]interface{}: + os.Type = "map" + os.Value = v + return os, nil + case bool: + os.Type = "string" + os.Value = strconv.FormatBool(v) + return os, nil + // unmarshalled number from JSON will always be float64 + case float64: + os.Type = "string" + os.Value = strconv.FormatFloat(v, 'f', -1, 64) + return os, nil + } + + return nil, fmt.Errorf("unexpected output type: %T", so.Value) +} + +func (ss *shimmedState) shimStateModule(sm *tfjson.StateModule) error { + var path addrs.ModuleInstance + + if sm.Address == "" { + path = addrs.RootModuleInstance + } else { + var diags tfdiags.Diagnostics + path, diags = addrs.ParseModuleInstanceStr(sm.Address) + if diags.HasErrors() { + return diags.Err() + } + } + + mod := ss.state.AddModule(path) + for _, res := range sm.Resources { + resourceState, err := shimResourceState(res) + if err != nil { + return err + } + + key, err := shimResourceStateKey(res) + if err != nil { + return err + } + + mod.Resources[key] = resourceState + } + + if len(sm.ChildModules) > 0 { + return fmt.Errorf("Modules are not supported. Found %d modules.", + len(sm.ChildModules)) + } + return nil +} + +func shimResourceStateKey(res *tfjson.StateResource) (string, error) { + if res.Index == nil { + return res.Address, nil + } + + var mode terraform.ResourceMode + switch res.Mode { + case tfjson.DataResourceMode: + mode = terraform.DataResourceMode + case tfjson.ManagedResourceMode: + mode = terraform.ManagedResourceMode + default: + return "", fmt.Errorf("unexpected resource mode for %q", res.Address) + } + + var index int + switch idx := res.Index.(type) { + case float64: + index = int(idx) + default: + return "", fmt.Errorf("unexpected index type (%T) for %q, "+ + "for_each is not supported", res.Index, res.Address) + } + + rsk := &terraform.ResourceStateKey{ + Mode: mode, + Type: res.Type, + Name: res.Name, + Index: index, + } + + return rsk.String(), nil +} + +func shimResourceState(res *tfjson.StateResource) (*terraform.ResourceState, error) { + sf := &shimmedFlatmap{} + err := sf.FromMap(res.AttributeValues) + if err != nil { + return nil, err + } + attributes := sf.Flatmap() + + if _, ok := attributes["id"]; !ok { + return nil, fmt.Errorf("no %q found in attributes", "id") + } + + return &terraform.ResourceState{ + Provider: res.ProviderName, + Type: res.Type, + Primary: &terraform.InstanceState{ + ID: attributes["id"], + Attributes: attributes, + Meta: map[string]interface{}{ + "schema_version": int(res.SchemaVersion), + }, + Tainted: res.Tainted, + }, + Dependencies: res.DependsOn, + }, nil +} + +type shimmedFlatmap struct { + m map[string]string +} + +func (sf *shimmedFlatmap) FromMap(attributes map[string]interface{}) error { + if sf.m == nil { + sf.m = make(map[string]string, len(attributes)) + } + + return sf.AddMap("", attributes) +} + +func (sf *shimmedFlatmap) AddMap(prefix string, m map[string]interface{}) error { + for key, value := range m { + k := key + if prefix != "" { + k = fmt.Sprintf("%s.%s", prefix, key) + } + + err := sf.AddEntry(k, value) + if err != nil { + return err + } + } + + mapLength := "%" + if prefix != "" { + mapLength = fmt.Sprintf("%s.%s", prefix, "%") + } + + sf.AddEntry(mapLength, strconv.Itoa(len(m))) + + return nil +} + +func (sf *shimmedFlatmap) AddSlice(name string, elements []interface{}) error { + for i, elem := range elements { + key := fmt.Sprintf("%s.%d", name, i) + err := sf.AddEntry(key, elem) + if err != nil { + return err + } + } + + sliceLength := fmt.Sprintf("%s.#", name) + sf.AddEntry(sliceLength, strconv.Itoa(len(elements))) + + return nil +} + +func (sf *shimmedFlatmap) AddEntry(key string, value interface{}) error { + switch el := value.(type) { + case nil: + // omit the entry + return nil + case bool: + sf.m[key] = strconv.FormatBool(el) + case float64: + sf.m[key] = strconv.FormatFloat(el, 'f', -1, 64) + case string: + sf.m[key] = el + case map[string]interface{}: + err := sf.AddMap(key, el) + if err != nil { + return err + } + case []interface{}: + err := sf.AddSlice(key, el) + if err != nil { + return err + } + default: + // This should never happen unless terraform-json + // changes how attributes (types) are represented. + // + // We handle all types which the JSON unmarshaler + // can possibly produce + // https://golang.org/pkg/encoding/json/#Unmarshal + + return fmt.Errorf("%q: unexpected type (%T)", key, el) + } + return nil +} + +func (sf *shimmedFlatmap) Flatmap() map[string]string { + return sf.m +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing.go index b2a323cec..1f63e615d 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing.go @@ -2,6 +2,7 @@ package resource import ( "bytes" + "errors" "flag" "fmt" "io" @@ -11,6 +12,7 @@ import ( "path/filepath" "reflect" "regexp" + "strconv" "strings" "syscall" "testing" @@ -19,8 +21,7 @@ import ( "github.com/hashicorp/errwrap" "github.com/hashicorp/go-multierror" "github.com/hashicorp/logutils" - "github.com/mitchellh/colorstring" - + "github.com/hashicorp/terraform-plugin-sdk/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/logging" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/command/format" @@ -31,6 +32,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/internal/states" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/mitchellh/colorstring" ) // flagSweep is a flag available when running tests on the command line. It @@ -54,13 +56,10 @@ import ( // destroyed. var flagSweep = flag.String("sweep", "", "List of Regions to run available Sweepers") +var flagSweepAllowFailures = flag.Bool("sweep-allow-failures", false, "Enable to allow Sweeper Tests to continue after failures") var flagSweepRun = flag.String("sweep-run", "", "Comma seperated list of Sweeper Tests to run") var sweeperFuncs map[string]*Sweeper -// map of sweepers that have ran, and the success/fail status based on any error -// raised -var sweeperRunList map[string]bool - // type SweeperFunc is a signature for a function that acts as a sweeper. It // accepts a string for the region that the sweeper is to be ran in. This // function must be able to construct a valid client for that region. @@ -105,26 +104,72 @@ func TestMain(m *testing.M) { // get filtered list of sweepers to run based on sweep-run flag sweepers := filterSweepers(*flagSweepRun, sweeperFuncs) - for _, region := range regions { - region = strings.TrimSpace(region) - // reset sweeperRunList for each region - sweeperRunList = map[string]bool{} - - log.Printf("[DEBUG] Running Sweepers for region (%s):\n", region) - for _, sweeper := range sweepers { - if err := runSweeperWithRegion(region, sweeper); err != nil { - log.Fatalf("[ERR] error running (%s): %s", sweeper.Name, err) + + if _, err := runSweepers(regions, sweepers, *flagSweepAllowFailures); err != nil { + os.Exit(1) + } + } else { + exitCode := m.Run() + + if acctest.TestHelper != nil { + err := acctest.TestHelper.Close() + if err != nil { + log.Printf("Error cleaning up temporary test files: %s", err) + } + } + os.Exit(exitCode) + } +} + +func runSweepers(regions []string, sweepers map[string]*Sweeper, allowFailures bool) (map[string]map[string]error, error) { + var sweeperErrorFound bool + sweeperRunList := make(map[string]map[string]error) + + for _, region := range regions { + region = strings.TrimSpace(region) + + var regionSweeperErrorFound bool + regionSweeperRunList := make(map[string]error) + + log.Printf("[DEBUG] Running Sweepers for region (%s):\n", region) + for _, sweeper := range sweepers { + if err := runSweeperWithRegion(region, sweeper, sweepers, regionSweeperRunList, allowFailures); err != nil { + if allowFailures { + continue } + + sweeperRunList[region] = regionSweeperRunList + return sweeperRunList, fmt.Errorf("sweeper (%s) for region (%s) failed: %s", sweeper.Name, region, err) } + } - log.Printf("Sweeper Tests ran:\n") - for s, _ := range sweeperRunList { - fmt.Printf("\t- %s\n", s) + log.Printf("Sweeper Tests ran successfully:\n") + for sweeper, sweeperErr := range regionSweeperRunList { + if sweeperErr == nil { + fmt.Printf("\t- %s\n", sweeper) + } else { + regionSweeperErrorFound = true } } - } else { - os.Exit(m.Run()) + + if regionSweeperErrorFound { + sweeperErrorFound = true + log.Printf("Sweeper Tests ran unsuccessfully:\n") + for sweeper, sweeperErr := range regionSweeperRunList { + if sweeperErr != nil { + fmt.Printf("\t- %s: %s\n", sweeper, sweeperErr) + } + } + } + + sweeperRunList[region] = regionSweeperRunList } + + if sweeperErrorFound { + return sweeperRunList, errors.New("at least one sweeper failed") + } + + return sweeperRunList, nil } // filterSweepers takes a comma seperated string listing the names of sweepers @@ -139,29 +184,61 @@ func filterSweepers(f string, source map[string]*Sweeper) map[string]*Sweeper { } sweepers := make(map[string]*Sweeper) - for name, sweeper := range source { + for name := range source { for _, s := range filterSlice { if strings.Contains(strings.ToLower(name), s) { - sweepers[name] = sweeper + for foundName, foundSweeper := range filterSweeperWithDependencies(name, source) { + sweepers[foundName] = foundSweeper + } } } } return sweepers } +// filterSweeperWithDependencies recursively returns sweeper and all dependencies. +// Since filterSweepers performs fuzzy matching, this function is used +// to perform exact sweeper and dependency lookup. +func filterSweeperWithDependencies(name string, source map[string]*Sweeper) map[string]*Sweeper { + result := make(map[string]*Sweeper) + + currentSweeper, ok := source[name] + if !ok { + log.Printf("[WARN] Sweeper has dependency (%s), but that sweeper was not found", name) + return result + } + + result[name] = currentSweeper + + for _, dependency := range currentSweeper.Dependencies { + for foundName, foundSweeper := range filterSweeperWithDependencies(dependency, source) { + result[foundName] = foundSweeper + } + } + + return result +} + // runSweeperWithRegion recieves a sweeper and a region, and recursively calls // itself with that region for every dependency found for that sweeper. If there // are no dependencies, invoke the contained sweeper fun with the region, and // add the success/fail status to the sweeperRunList. -func runSweeperWithRegion(region string, s *Sweeper) error { +func runSweeperWithRegion(region string, s *Sweeper, sweepers map[string]*Sweeper, sweeperRunList map[string]error, allowFailures bool) error { for _, dep := range s.Dependencies { - if depSweeper, ok := sweeperFuncs[dep]; ok { + if depSweeper, ok := sweepers[dep]; ok { log.Printf("[DEBUG] Sweeper (%s) has dependency (%s), running..", s.Name, dep) - if err := runSweeperWithRegion(region, depSweeper); err != nil { + err := runSweeperWithRegion(region, depSweeper, sweepers, sweeperRunList, allowFailures) + + if err != nil { + if allowFailures { + log.Printf("[ERROR] Error running Sweeper (%s) in region (%s): %s", depSweeper.Name, region, err) + continue + } + return err } } else { - log.Printf("[DEBUG] Sweeper (%s) has dependency (%s), but that sweeper was not found", s.Name, dep) + log.Printf("[WARN] Sweeper (%s) has dependency (%s), but that sweeper was not found", s.Name, dep) } } @@ -170,17 +247,21 @@ func runSweeperWithRegion(region string, s *Sweeper) error { return nil } + log.Printf("[DEBUG] Running Sweeper (%s) in region (%s)", s.Name, region) + runE := s.F(region) - if runE == nil { - sweeperRunList[s.Name] = true - } else { - sweeperRunList[s.Name] = false + + sweeperRunList[s.Name] = runE + + if runE != nil { + log.Printf("[ERROR] Error running Sweeper (%s) in region (%s): %s", s.Name, region, runE) } return runE } const TestEnvVar = "TF_ACC" +const TestDisableBinaryTestingFlagEnvVar = "TF_DISABLE_BINARY_TESTING" // TestProvider can be implemented by any ResourceProvider to provide custom // reset functionality at the start of an acceptance test. @@ -254,6 +335,11 @@ type TestCase struct { // IDRefreshIgnore is a list of configuration keys that will be ignored. IDRefreshName string IDRefreshIgnore []string + + // DisableBinaryDriver forces this test case to run using the legacy test + // driver, even if the binary test driver has been enabled. + // This property will be removed in version 2.0.0 of the SDK. + DisableBinaryDriver bool } // TestStep is a single apply sequence of a test, done within the @@ -464,6 +550,14 @@ func Test(t TestT, c TestCase) { TestEnvVar)) return } + if v := os.Getenv(TestDisableBinaryTestingFlagEnvVar); v != "" { + b, err := strconv.ParseBool(v) + if err != nil { + t.Error(fmt.Errorf("Error parsing EnvVar %q value %q: %s", TestDisableBinaryTestingFlagEnvVar, v, err)) + } + + c.DisableBinaryDriver = b + } logWriter, err := LogOutput(t) if err != nil { @@ -474,12 +568,6 @@ func Test(t TestT, c TestCase) { // We require verbose mode so that the user knows what is going on. if !testTesting && !testing.Verbose() && !c.IsUnitTest { t.Fatal("Acceptance tests must be run with the -v flag on tests") - return - } - - // Run the PreCheck if we have it - if c.PreCheck != nil { - c.PreCheck() } // get instances of all providers, so we can use the individual @@ -493,6 +581,32 @@ func Test(t TestT, c TestCase) { providers[name] = p } + if acctest.TestHelper != nil && c.DisableBinaryDriver == false { + // auto-configure all providers + for _, p := range providers { + err = p.Configure(terraform.NewResourceConfigRaw(nil)) + if err != nil { + t.Fatal(err) + } + } + + // Run the PreCheck if we have it. + // This is done after the auto-configure to allow providers + // to override the default auto-configure parameters. + if c.PreCheck != nil { + c.PreCheck() + } + + // inject providers for ImportStateVerify + RunNewTest(t.(*testing.T), c, providers) + return + } else { + // run the PreCheck if we have it + if c.PreCheck != nil { + c.PreCheck() + } + } + providerResolver, err := testProviderResolver(c) if err != nil { t.Fatal(err) @@ -773,12 +887,12 @@ func testIDOnlyRefresh(c TestCase, opts terraform.ContextOpts, step TestStep, r expected := r.Primary.Attributes // Remove fields we're ignoring for _, v := range c.IDRefreshIgnore { - for k, _ := range actual { + for k := range actual { if strings.HasPrefix(k, v) { delete(actual, k) } } - for k, _ := range expected { + for k := range expected { if strings.HasPrefix(k, v) { delete(expected, k) } @@ -916,28 +1030,28 @@ func ComposeAggregateTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc { // testing that computed values were set, when it is not possible to // know ahead of time what the values will be. func TestCheckResourceAttrSet(name, key string) TestCheckFunc { - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := primaryInstanceState(s, name) if err != nil { return err } return testCheckResourceAttrSet(is, name, key) - } + }) } // TestCheckModuleResourceAttrSet - as per TestCheckResourceAttrSet but with // support for non-root modules func TestCheckModuleResourceAttrSet(mp []string, name string, key string) TestCheckFunc { mpt := addrs.Module(mp).UnkeyedInstanceShim() - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := modulePathPrimaryInstanceState(s, mpt, name) if err != nil { return err } return testCheckResourceAttrSet(is, name, key) - } + }) } func testCheckResourceAttrSet(is *terraform.InstanceState, name string, key string) error { @@ -951,28 +1065,28 @@ func testCheckResourceAttrSet(is *terraform.InstanceState, name string, key stri // TestCheckResourceAttr is a TestCheckFunc which validates // the value in state for the given name/key combination. func TestCheckResourceAttr(name, key, value string) TestCheckFunc { - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := primaryInstanceState(s, name) if err != nil { return err } return testCheckResourceAttr(is, name, key, value) - } + }) } // TestCheckModuleResourceAttr - as per TestCheckResourceAttr but with // support for non-root modules func TestCheckModuleResourceAttr(mp []string, name string, key string, value string) TestCheckFunc { mpt := addrs.Module(mp).UnkeyedInstanceShim() - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := modulePathPrimaryInstanceState(s, mpt, name) if err != nil { return err } return testCheckResourceAttr(is, name, key, value) - } + }) } func testCheckResourceAttr(is *terraform.InstanceState, name string, key string, value string) error { @@ -1006,28 +1120,28 @@ func testCheckResourceAttr(is *terraform.InstanceState, name string, key string, // TestCheckNoResourceAttr is a TestCheckFunc which ensures that // NO value exists in state for the given name/key combination. func TestCheckNoResourceAttr(name, key string) TestCheckFunc { - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := primaryInstanceState(s, name) if err != nil { return err } return testCheckNoResourceAttr(is, name, key) - } + }) } // TestCheckModuleNoResourceAttr - as per TestCheckNoResourceAttr but with // support for non-root modules func TestCheckModuleNoResourceAttr(mp []string, name string, key string) TestCheckFunc { mpt := addrs.Module(mp).UnkeyedInstanceShim() - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := modulePathPrimaryInstanceState(s, mpt, name) if err != nil { return err } return testCheckNoResourceAttr(is, name, key) - } + }) } func testCheckNoResourceAttr(is *terraform.InstanceState, name string, key string) error { @@ -1054,28 +1168,28 @@ func testCheckNoResourceAttr(is *terraform.InstanceState, name string, key strin // TestMatchResourceAttr is a TestCheckFunc which checks that the value // in state for the given name/key combination matches the given regex. func TestMatchResourceAttr(name, key string, r *regexp.Regexp) TestCheckFunc { - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := primaryInstanceState(s, name) if err != nil { return err } return testMatchResourceAttr(is, name, key, r) - } + }) } // TestModuleMatchResourceAttr - as per TestMatchResourceAttr but with // support for non-root modules func TestModuleMatchResourceAttr(mp []string, name string, key string, r *regexp.Regexp) TestCheckFunc { mpt := addrs.Module(mp).UnkeyedInstanceShim() - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSet(key, func(s *terraform.State) error { is, err := modulePathPrimaryInstanceState(s, mpt, name) if err != nil { return err } return testMatchResourceAttr(is, name, key, r) - } + }) } func testMatchResourceAttr(is *terraform.InstanceState, name string, key string, r *regexp.Regexp) error { @@ -1111,7 +1225,7 @@ func TestCheckModuleResourceAttrPtr(mp []string, name string, key string, value // TestCheckResourceAttrPair is a TestCheckFunc which validates that the values // in state for a pair of name/key combinations are equal. func TestCheckResourceAttrPair(nameFirst, keyFirst, nameSecond, keySecond string) TestCheckFunc { - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSetPair(keyFirst, keySecond, func(s *terraform.State) error { isFirst, err := primaryInstanceState(s, nameFirst) if err != nil { return err @@ -1123,7 +1237,7 @@ func TestCheckResourceAttrPair(nameFirst, keyFirst, nameSecond, keySecond string } return testCheckResourceAttrPair(isFirst, nameFirst, keyFirst, isSecond, nameSecond, keySecond) - } + }) } // TestCheckModuleResourceAttrPair - as per TestCheckResourceAttrPair but with @@ -1131,7 +1245,7 @@ func TestCheckResourceAttrPair(nameFirst, keyFirst, nameSecond, keySecond string func TestCheckModuleResourceAttrPair(mpFirst []string, nameFirst string, keyFirst string, mpSecond []string, nameSecond string, keySecond string) TestCheckFunc { mptFirst := addrs.Module(mpFirst).UnkeyedInstanceShim() mptSecond := addrs.Module(mpSecond).UnkeyedInstanceShim() - return func(s *terraform.State) error { + return checkIfIndexesIntoTypeSetPair(keyFirst, keySecond, func(s *terraform.State) error { isFirst, err := modulePathPrimaryInstanceState(s, mptFirst, nameFirst) if err != nil { return err @@ -1143,7 +1257,7 @@ func TestCheckModuleResourceAttrPair(mpFirst []string, nameFirst string, keyFirs } return testCheckResourceAttrPair(isFirst, nameFirst, keyFirst, isSecond, nameSecond, keySecond) - } + }) } func testCheckResourceAttrPair(isFirst *terraform.InstanceState, nameFirst string, keyFirst string, isSecond *terraform.InstanceState, nameSecond string, keySecond string) error { @@ -1319,3 +1433,35 @@ func detailedErrorMessage(err error) string { return err.Error() } } + +// indexesIntoTypeSet is a heuristic to try and identify if a flatmap style +// string address uses a precalculated TypeSet hash, which are integers and +// typically are large and obviously not a list index +func indexesIntoTypeSet(key string) bool { + for _, part := range strings.Split(key, ".") { + if i, err := strconv.Atoi(part); err == nil && i > 100 { + return true + } + } + return false +} + +func checkIfIndexesIntoTypeSet(key string, f TestCheckFunc) TestCheckFunc { + return func(s *terraform.State) error { + err := f(s) + if err != nil && s.IsBinaryDrivenTest && indexesIntoTypeSet(key) { + return fmt.Errorf("Error in test check: %s\nTest check address %q likely indexes into TypeSet\nThis is not possible in V1 of the SDK while using the binary driver\nPlease disable the driver for this TestCase with DisableBinaryDriver: true", err, key) + } + return err + } +} + +func checkIfIndexesIntoTypeSetPair(keyFirst, keySecond string, f TestCheckFunc) TestCheckFunc { + return func(s *terraform.State) error { + err := f(s) + if err != nil && s.IsBinaryDrivenTest && (indexesIntoTypeSet(keyFirst) || indexesIntoTypeSet(keySecond)) { + return fmt.Errorf("Error in test check: %s\nTest check address %q or %q likely indexes into TypeSet\nThis is not possible in V1 of the SDK while using the binary driver\nPlease disable the driver for this TestCase with DisableBinaryDriver: true", err, keyFirst, keySecond) + } + return err + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_import_state.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_import_state.go index 9e547e2a0..7b7c30a7a 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_import_state.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_import_state.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" @@ -81,7 +81,7 @@ func testStepImportState( Config: cfg, Targets: []*terraform.ImportTarget{ - &terraform.ImportTarget{ + { Addr: importAddr, ID: importId, }, diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new.go new file mode 100644 index 000000000..34244e095 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new.go @@ -0,0 +1,195 @@ +package resource + +import ( + "fmt" + "log" + "reflect" + "strings" + "testing" + + "github.com/davecgh/go-spew/spew" + tfjson "github.com/hashicorp/terraform-json" + "github.com/hashicorp/terraform-plugin-sdk/acctest" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + tftest "github.com/hashicorp/terraform-plugin-test" +) + +func runPostTestDestroy(t *testing.T, c TestCase, wd *tftest.WorkingDir) error { + wd.RequireDestroy(t) + + if c.CheckDestroy != nil { + statePostDestroy := getState(t, wd) + + if err := c.CheckDestroy(statePostDestroy); err != nil { + return err + } + } + + return nil +} + +func RunNewTest(t *testing.T, c TestCase, providers map[string]terraform.ResourceProvider) { + spewConf := spew.NewDefaultConfig() + spewConf.SortKeys = true + wd := acctest.TestHelper.RequireNewWorkingDir(t) + + defer func() { + statePreDestroy := getState(t, wd) + + if !stateIsEmpty(statePreDestroy) { + runPostTestDestroy(t, c, wd) + } + + wd.Close() + }() + + providerCfg := testProviderConfig(c) + + wd.RequireSetConfig(t, providerCfg) + wd.RequireInit(t) + + // use this to track last step succesfully applied + // acts as default for import tests + var appliedCfg string + + for i, step := range c.Steps { + + if step.PreConfig != nil { + step.PreConfig() + } + + if step.SkipFunc != nil { + skip, err := step.SkipFunc() + if err != nil { + t.Fatal(err) + } + if skip { + log.Printf("[WARN] Skipping step %d", i) + continue + } + } + + if step.ImportState { + step.providers = providers + err := testStepNewImportState(t, c, wd, step, appliedCfg) + if err != nil { + t.Fatal(err) + } + continue + } + + if step.Config != "" { + err := testStepNewConfig(t, c, wd, step) + if step.ExpectError != nil { + if err == nil { + t.Fatal("Expected an error but got none") + } + if !step.ExpectError.MatchString(err.Error()) { + t.Fatalf("Expected an error with pattern, no match on: %s", err) + } + } else { + if err != nil { + t.Fatal(err) + } + } + appliedCfg = step.Config + continue + } + + t.Fatal("Unsupported test mode") + } +} + +func getState(t *testing.T, wd *tftest.WorkingDir) *terraform.State { + jsonState := wd.RequireState(t) + state, err := shimStateFromJson(jsonState) + if err != nil { + t.Fatal(err) + } + return state +} + +func stateIsEmpty(state *terraform.State) bool { + return state.Empty() || !state.HasResources() +} + +func planIsEmpty(plan *tfjson.Plan) bool { + for _, rc := range plan.ResourceChanges { + if rc.Mode == tfjson.DataResourceMode { + // Skip data sources as the current implementation ignores + // existing state and they are all re-read every time + continue + } + + for _, a := range rc.Change.Actions { + if a != tfjson.ActionNoop { + return false + } + } + } + return true +} + +func testIDRefresh(c TestCase, t *testing.T, wd *tftest.WorkingDir, step TestStep, r *terraform.ResourceState) error { + spewConf := spew.NewDefaultConfig() + spewConf.SortKeys = true + + // Build the state. The state is just the resource with an ID. There + // are no attributes. We only set what is needed to perform a refresh. + state := terraform.NewState() + state.RootModule().Resources = make(map[string]*terraform.ResourceState) + state.RootModule().Resources[c.IDRefreshName] = &terraform.ResourceState{} + + // Temporarily set the config to a minimal provider config for the refresh + // test. After the refresh we can reset it. + cfg := testProviderConfig(c) + wd.RequireSetConfig(t, cfg) + defer wd.RequireSetConfig(t, step.Config) + + // Refresh! + wd.RequireRefresh(t) + state = getState(t, wd) + + // Verify attribute equivalence. + actualR := state.RootModule().Resources[c.IDRefreshName] + if actualR == nil { + return fmt.Errorf("Resource gone!") + } + if actualR.Primary == nil { + return fmt.Errorf("Resource has no primary instance") + } + actual := actualR.Primary.Attributes + expected := r.Primary.Attributes + // Remove fields we're ignoring + for _, v := range c.IDRefreshIgnore { + for k := range actual { + if strings.HasPrefix(k, v) { + delete(actual, k) + } + } + for k := range expected { + if strings.HasPrefix(k, v) { + delete(expected, k) + } + } + } + + if !reflect.DeepEqual(actual, expected) { + // Determine only the different attributes + for k, v := range expected { + if av, ok := actual[k]; ok && v == av { + delete(expected, k) + delete(actual, k) + } + } + + spewConf := spew.NewDefaultConfig() + spewConf.SortKeys = true + return fmt.Errorf( + "Attributes not equivalent. Difference is shown below. Top is actual, bottom is expected."+ + "\n\n%s\n\n%s", + spewConf.Sdump(actual), spewConf.Sdump(expected)) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new_config.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new_config.go new file mode 100644 index 000000000..a59d685d8 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new_config.go @@ -0,0 +1,107 @@ +package resource + +import ( + "testing" + + "github.com/davecgh/go-spew/spew" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + tftest "github.com/hashicorp/terraform-plugin-test" +) + +func testStepNewConfig(t *testing.T, c TestCase, wd *tftest.WorkingDir, step TestStep) error { + spewConf := spew.NewDefaultConfig() + spewConf.SortKeys = true + + var idRefreshCheck *terraform.ResourceState + idRefresh := c.IDRefreshName != "" + + if !step.Destroy { + state := getState(t, wd) + if err := testStepTaint(state, step); err != nil { + t.Fatalf("Error when tainting resources: %s", err) + } + } + + wd.RequireSetConfig(t, step.Config) + + if !step.PlanOnly { + err := wd.Apply() + if err != nil { + return err + } + + state := getState(t, wd) + if step.Check != nil { + state.IsBinaryDrivenTest = true + if err := step.Check(state); err != nil { + t.Fatal(err) + } + } + } + + // Test for perpetual diffs by performing a plan, a refresh, and another plan + + // do a plan + wd.RequireCreatePlan(t) + plan := wd.RequireSavedPlan(t) + + if !planIsEmpty(plan) { + if step.ExpectNonEmptyPlan { + t.Log("[INFO] Got non-empty plan, as expected") + } else { + + t.Fatalf("After applying this test step, the plan was not empty. %s", spewConf.Sdump(plan)) + } + } + + // do a refresh + if !c.PreventPostDestroyRefresh { + wd.RequireRefresh(t) + } + + // do another plan + wd.RequireCreatePlan(t) + plan = wd.RequireSavedPlan(t) + + // check if plan is empty + if !planIsEmpty(plan) { + if step.ExpectNonEmptyPlan { + t.Log("[INFO] Got non-empty plan, as expected") + } else { + + t.Fatalf("After applying this test step and performing a `terraform refresh`, the plan was not empty. %s", spewConf.Sdump(plan)) + } + } + + // ID-ONLY REFRESH + // If we've never checked an id-only refresh and our state isn't + // empty, find the first resource and test it. + state := getState(t, wd) + if idRefresh && idRefreshCheck == nil && !state.Empty() { + // Find the first non-nil resource in the state + for _, m := range state.Modules { + if len(m.Resources) > 0 { + if v, ok := m.Resources[c.IDRefreshName]; ok { + idRefreshCheck = v + } + + break + } + } + + // If we have an instance to check for refreshes, do it + // immediately. We do it in the middle of another test + // because it shouldn't affect the overall state (refresh + // is read-only semantically) and we want to fail early if + // this fails. If refresh isn't read-only, then this will have + // caught a different bug. + if idRefreshCheck != nil { + if err := testIDRefresh(c, t, wd, step, idRefreshCheck); err != nil { + t.Fatalf( + "[ERROR] Test: ID-only test failed: %s", err) + } + } + } + + return nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new_import_state.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new_import_state.go new file mode 100644 index 000000000..ec2f99168 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/resource/testing_new_import_state.go @@ -0,0 +1,196 @@ +package resource + +import ( + "reflect" + "strings" + "testing" + + "github.com/davecgh/go-spew/spew" + "github.com/hashicorp/terraform-plugin-sdk/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + tftest "github.com/hashicorp/terraform-plugin-test" +) + +func testStepNewImportState(t *testing.T, c TestCase, wd *tftest.WorkingDir, step TestStep, cfg string) error { + spewConf := spew.NewDefaultConfig() + spewConf.SortKeys = true + + if step.ResourceName == "" { + t.Fatal("ResourceName is required for an import state test") + } + + // get state from check sequence + state := getState(t, wd) + + // Determine the ID to import + var importId string + switch { + case step.ImportStateIdFunc != nil: + var err error + importId, err = step.ImportStateIdFunc(state) + if err != nil { + t.Fatal(err) + } + case step.ImportStateId != "": + importId = step.ImportStateId + default: + resource, err := testResource(step, state) + if err != nil { + t.Fatal(err) + } + importId = resource.Primary.ID + } + importId = step.ImportStateIdPrefix + importId + + // Create working directory for import tests + if step.Config == "" { + step.Config = cfg + if step.Config == "" { + t.Fatal("Cannot import state with no specified config") + } + } + importWd := acctest.TestHelper.RequireNewWorkingDir(t) + defer importWd.Close() + importWd.RequireSetConfig(t, step.Config) + importWd.RequireInit(t) + importWd.RequireImport(t, step.ResourceName, importId) + importState := getState(t, wd) + + // Go through the imported state and verify + if step.ImportStateCheck != nil { + var states []*terraform.InstanceState + for _, r := range importState.RootModule().Resources { + if r.Primary != nil { + is := r.Primary.DeepCopy() + is.Ephemeral.Type = r.Type // otherwise the check function cannot see the type + states = append(states, is) + } + } + if err := step.ImportStateCheck(states); err != nil { + t.Fatal(err) + } + } + + // Verify that all the states match + if step.ImportStateVerify { + new := importState.RootModule().Resources + old := state.RootModule().Resources + + for _, r := range new { + // Find the existing resource + var oldR *terraform.ResourceState + for _, r2 := range old { + if r2.Primary != nil && r2.Primary.ID == r.Primary.ID && r2.Type == r.Type { + oldR = r2 + break + } + } + if oldR == nil { + t.Fatalf( + "Failed state verification, resource with ID %s not found", + r.Primary.ID) + } + + // We'll try our best to find the schema for this resource type + // so we can ignore Removed fields during validation. If we fail + // to find the schema then we won't ignore them and so the test + // will need to rely on explicit ImportStateVerifyIgnore, though + // this shouldn't happen in any reasonable case. + // KEM CHANGE FROM OLD FRAMEWORK: Fail test if this happens. + var rsrcSchema *schema.Resource + providerAddr, diags := addrs.ParseAbsProviderConfigStr("provider." + r.Provider + "." + r.Type) + if diags.HasErrors() { + t.Fatalf("Failed to find schema for resource with ID %s", r.Primary) + } + + providerType := providerAddr.ProviderConfig.Type + if provider, ok := step.providers[providerType]; ok { + if provider, ok := provider.(*schema.Provider); ok { + rsrcSchema = provider.ResourcesMap[r.Type] + } + } + + // don't add empty flatmapped containers, so we can more easily + // compare the attributes + skipEmpty := func(k, v string) bool { + if strings.HasSuffix(k, ".#") || strings.HasSuffix(k, ".%") { + if v == "0" { + return true + } + } + return false + } + + // Compare their attributes + actual := make(map[string]string) + for k, v := range r.Primary.Attributes { + if skipEmpty(k, v) { + continue + } + actual[k] = v + } + + expected := make(map[string]string) + for k, v := range oldR.Primary.Attributes { + if skipEmpty(k, v) { + continue + } + expected[k] = v + } + + // Remove fields we're ignoring + for _, v := range step.ImportStateVerifyIgnore { + for k := range actual { + if strings.HasPrefix(k, v) { + delete(actual, k) + } + } + for k := range expected { + if strings.HasPrefix(k, v) { + delete(expected, k) + } + } + } + + // Also remove any attributes that are marked as "Removed" in the + // schema, if we have a schema to check that against. + if rsrcSchema != nil { + for k := range actual { + for _, schema := range rsrcSchema.SchemasForFlatmapPath(k) { + if schema.Removed != "" { + delete(actual, k) + break + } + } + } + for k := range expected { + for _, schema := range rsrcSchema.SchemasForFlatmapPath(k) { + if schema.Removed != "" { + delete(expected, k) + break + } + } + } + } + + if !reflect.DeepEqual(actual, expected) { + // Determine only the different attributes + for k, v := range expected { + if av, ok := actual[k]; ok && v == av { + delete(expected, k) + delete(actual, k) + } + } + + t.Fatalf( + "ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected."+ + "\n\n%s\n\n%s", + spewConf.Sdump(actual), spewConf.Sdump(expected)) + } + } + } + + return nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/core_schema.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/core_schema.go index fa03d8338..d16abef88 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/core_schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/core_schema.go @@ -7,6 +7,26 @@ import ( "github.com/zclconf/go-cty/cty" ) +var ( + // DescriptionKind is the default StringKind of descriptions in this provider. + // It defaults to StringPlain but can be globally switched to StringMarkdown. + DescriptionKind = configschema.StringPlain + + // SchemaDescriptionBuilder converts helper/schema.Schema Descriptions to configschema.Attribute + // and Block Descriptions. This method can be used to modify the description text prior to it + // being returned in the schema. + SchemaDescriptionBuilder = func(s *Schema) string { + return s.Description + } + + // ResourceDescriptionBuilder converts helper/schema.Resource Descriptions to configschema.Block + // Descriptions at the resource top level. This method can be used to modify the description prior + // to it being returned in the schema. + ResourceDescriptionBuilder = func(r *Resource) string { + return r.Description + } +) + // The functions and methods in this file are concerned with the conversion // of this package's schema model into the slightly-lower-level schema model // used by Terraform core for configuration parsing. @@ -115,13 +135,22 @@ func (s *Schema) coreConfigSchemaAttribute() *configschema.Attribute { } } + desc := SchemaDescriptionBuilder(s) + descKind := DescriptionKind + if desc == "" { + // fallback to plain text if empty + descKind = configschema.StringPlain + } + return &configschema.Attribute{ - Type: s.coreConfigSchemaType(), - Optional: opt, - Required: reqd, - Computed: s.Computed, - Sensitive: s.Sensitive, - Description: s.Description, + Type: s.coreConfigSchemaType(), + Optional: opt, + Required: reqd, + Computed: s.Computed, + Sensitive: s.Sensitive, + Description: desc, + DescriptionKind: descKind, + Deprecated: s.Deprecated != "", } } @@ -132,6 +161,17 @@ func (s *Schema) coreConfigSchemaBlock() *configschema.NestedBlock { ret := &configschema.NestedBlock{} if nested := s.Elem.(*Resource).coreConfigSchema(); nested != nil { ret.Block = *nested + + desc := SchemaDescriptionBuilder(s) + descKind := DescriptionKind + if desc == "" { + // fallback to plain text if empty + descKind = configschema.StringPlain + } + // set these on the block from the attribute Schema + ret.Block.Description = desc + ret.Block.DescriptionKind = descKind + ret.Block.Deprecated = s.Deprecated != "" } switch s.Type { case TypeList: @@ -231,6 +271,18 @@ func (s *Schema) coreConfigSchemaType() cty.Type { func (r *Resource) CoreConfigSchema() *configschema.Block { block := r.coreConfigSchema() + desc := ResourceDescriptionBuilder(r) + descKind := DescriptionKind + if desc == "" { + // fallback to plain text if empty + descKind = configschema.StringPlain + } + + // Only apply Resource Description, Kind, Deprecation at top level + block.Description = desc + block.DescriptionKind = descKind + block.Deprecated = r.DeprecationMessage != "" + if block.Attributes == nil { block.Attributes = map[string]*configschema.Attribute{} } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader.go index 2a66a068f..b3c023d19 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader.go @@ -44,6 +44,8 @@ func (r *FieldReadResult) ValueOrZero(s *Schema) interface{} { // SchemasForFlatmapPath tries its best to find a sequence of schemas that // the given dot-delimited attribute path traverses through. +// +// Deprecated: This function will be removed in version 2 without replacement. func SchemasForFlatmapPath(path string, schemaMap map[string]*Schema) []*Schema { parts := strings.Split(path, ".") return addrToSchema(parts, schemaMap) @@ -205,7 +207,7 @@ func readListField( // Go through each count, and get the item value out of it result := make([]interface{}, countResult.Value.(int)) - for i, _ := range result { + for i := range result { is := strconv.FormatInt(int64(i), 10) addrPadded[len(addrPadded)-1] = is rawResult, err := r.ReadField(addrPadded) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_writer_map.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_writer_map.go index c09358b1b..85d05be4c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_writer_map.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_writer_map.go @@ -146,7 +146,7 @@ func (w *MapFieldWriter) setList( } } if err != nil { - for i, _ := range vs { + for i := range vs { is := strconv.FormatInt(int64(i), 10) setElement(is, nil) } @@ -227,7 +227,7 @@ func (w *MapFieldWriter) setObject( } } if err != nil { - for k1, _ := range v { + for k1 := range v { w.set(append(addrCopy, k1), nil) } } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go index bbea5dbd5..2f88f1eab 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go @@ -98,7 +98,7 @@ func (p *Provider) InternalValidate() error { } // Provider-specific checks - for k, _ := range sm { + for k := range sm { if isReservedProviderFieldName(k) { return fmt.Errorf("%s is a reserved field name for a provider", k) } @@ -454,7 +454,7 @@ func (p *Provider) ReadDataApply( // DataSources implementation of terraform.ResourceProvider interface. func (p *Provider) DataSources() []terraform.DataSource { keys := make([]string, 0, len(p.DataSourcesMap)) - for k, _ := range p.DataSourcesMap { + for k := range p.DataSourcesMap { keys = append(keys, k) } sort.Strings(keys) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go index 406dcdf71..1bc308088 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go @@ -172,6 +172,11 @@ type Resource struct { // actions (Create, Read, Update, Delete, Default) to the Resource struct, and // accessing them in the matching methods. Timeouts *ResourceTimeout + + // Description is used as the description for docs, the language server and + // other user facing usage. It can be plain-text or markdown depending on the + // global DescriptionKind setting. + Description string } // ShimInstanceStateFromValue converts a cty.Value to a @@ -689,7 +694,7 @@ func (r *Resource) InternalValidate(topSchemaMap schemaMap, writable bool) error // Data source if r.isTopLevel() && !writable { tsm = schemaMap(r.Schema) - for k, _ := range tsm { + for k := range tsm { if isReservedDataSourceFieldName(k) { return fmt.Errorf("%s is a reserved field name", k) } @@ -765,6 +770,8 @@ func (r *Resource) TestResourceData() *ResourceData { // SchemasForFlatmapPath tries its best to find a sequence of schemas that // the given dot-delimited attribute path traverses through in the schema // of the receiving Resource. +// +// Deprecated: This function will be removed in version 2 without replacement. func (r *Resource) SchemasForFlatmapPath(path string) []*Schema { return SchemasForFlatmapPath(path, r.Schema) } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource_data.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource_data.go index 0793524a3..a8a6e2236 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource_data.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource_data.go @@ -108,16 +108,11 @@ func (d *ResourceData) GetOk(key string) (interface{}, bool) { return r.Value, exists } -// GetOkExists returns the data for a given key and whether or not the key -// has been set to a non-zero value. This is only useful for determining -// if boolean attributes have been set, if they are Optional but do not -// have a Default value. +// GetOkExists can check if TypeBool attributes that are Optional with +// no Default value have been set. // -// This is nearly the same function as GetOk, yet it does not check -// for the zero value of the attribute's type. This allows for attributes -// without a default, to fully check for a literal assignment, regardless -// of the zero-value for that type. -// This should only be used if absolutely required/needed. +// Deprecated: usage is discouraged due to undefined behaviors and may be +// removed in a future version of the SDK func (d *ResourceData) GetOkExists(key string) (interface{}, bool) { r := d.getRaw(key, getSourceSet) exists := r.Exists && !r.Computed @@ -133,6 +128,16 @@ func (d *ResourceData) getRaw(key string, level getSource) getResult { return d.get(parts, level) } +// HasChanges returns whether or not any of the given keys has been changed. +func (d *ResourceData) HasChanges(keys ...string) bool { + for _, key := range keys { + if d.HasChange(key) { + return true + } + } + return false +} + // HasChange returns whether or not the given key has been changed. func (d *ResourceData) HasChange(key string) bool { o, n := d.GetChange(key) @@ -152,6 +157,9 @@ func (d *ResourceData) HasChange(key string) bool { // When partial state mode is enabled, then only key prefixes specified // by SetPartial will be in the final state. This allows providers to return // partial states for partially applied resources (when errors occur). +// +// Deprecated: Partial state has very limited benefit given Terraform refreshes +// before operations by default. func (d *ResourceData) Partial(on bool) { d.partial = on if on { @@ -201,6 +209,9 @@ func (d *ResourceData) Set(key string, value interface{}) error { // // If partial state mode is disabled, then this has no effect. Additionally, // whenever partial state mode is toggled, the partial data is cleared. +// +// Deprecated: Partial state has very limited benefit given Terraform refreshes +// before operations by default. func (d *ResourceData) SetPartial(k string) { if d.partial { d.partialMap[k] = struct{}{} @@ -304,7 +315,7 @@ func (d *ResourceData) State() *terraform.InstanceState { // integrity check of fields existing in the schema, allowing dynamic // keys to be created. hasDynamicAttributes := false - for k, _ := range d.schema { + for k := range d.schema { if k == "__has_dynamic_attributes" { hasDynamicAttributes = true log.Printf("[INFO] Resource %s has dynamic attributes", result.ID) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/schema.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/schema.go index 033b06843..df0172fa1 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/schema.go @@ -138,9 +138,9 @@ type Schema struct { Default interface{} DefaultFunc SchemaDefaultFunc - // Description is used as the description for docs or asking for user - // input. It should be relatively short (a few sentences max) and should - // be formatted to fit a CLI. + // Description is used as the description for docs, the language server and + // other user facing usage. It can be plain-text or markdown depending on the + // global DescriptionKind setting. Description string // InputDefault is the default value to use for when inputs are requested. @@ -216,7 +216,19 @@ type Schema struct { // This will only check that they're set in the _config_. This will not // raise an error for a malfunctioning resource that sets a conflicting // key. + // + // ExactlyOneOf is a set of schema keys that, when set, only one of the + // keys in that list can be specified. It will error if none are + // specified as well. + // + // AtLeastOneOf is a set of schema keys that, when set, at least one of + // the keys in that list must be specified. + // + // RequiredWith is a set of schema keys that must be set simultaneously. ConflictsWith []string + ExactlyOneOf []string + AtLeastOneOf []string + RequiredWith []string // When Deprecated is set, this attribute is deprecated. // @@ -227,6 +239,9 @@ type Schema struct { // When Removed is set, this attribute has been removed from the schema // + // Deprecated: This field will be removed in version 2 without replacement + // as the functionality is not necessary. + // // Removed attributes can be left in the Schema to generate informative error // messages for the user when they show up in resource configurations. // This string is the message shown to the user with instructions on @@ -616,7 +631,7 @@ func (m schemaMap) Input( input terraform.UIInput, c *terraform.ResourceConfig) (*terraform.ResourceConfig, error) { keys := make([]string, 0, len(m)) - for k, _ := range m { + for k := range m { keys = append(keys, k) } sort.Strings(keys) @@ -749,36 +764,39 @@ func (m schemaMap) internalValidate(topSchemaMap schemaMap, attrsOnly bool) erro return fmt.Errorf("%s: ConflictsWith cannot be set with Required", k) } + if len(v.ExactlyOneOf) > 0 && v.Required { + return fmt.Errorf("%s: ExactlyOneOf cannot be set with Required", k) + } + + if len(v.AtLeastOneOf) > 0 && v.Required { + return fmt.Errorf("%s: AtLeastOneOf cannot be set with Required", k) + } + if len(v.ConflictsWith) > 0 { - for _, key := range v.ConflictsWith { - parts := strings.Split(key, ".") - sm := topSchemaMap - var target *Schema - for _, part := range parts { - // Skip index fields - if _, err := strconv.Atoi(part); err == nil { - continue - } + err := checkKeysAgainstSchemaFlags(k, v.ConflictsWith, topSchemaMap, v, false) + if err != nil { + return fmt.Errorf("ConflictsWith: %+v", err) + } + } - var ok bool - if target, ok = sm[part]; !ok { - return fmt.Errorf("%s: ConflictsWith references unknown attribute (%s) at part (%s)", k, key, part) - } + if len(v.RequiredWith) > 0 { + err := checkKeysAgainstSchemaFlags(k, v.RequiredWith, topSchemaMap, v, true) + if err != nil { + return fmt.Errorf("RequiredWith: %+v", err) + } + } - if subResource, ok := target.Elem.(*Resource); ok { - sm = schemaMap(subResource.Schema) - } - } - if target == nil { - return fmt.Errorf("%s: ConflictsWith cannot find target attribute (%s), sm: %#v", k, key, sm) - } - if target.Required { - return fmt.Errorf("%s: ConflictsWith cannot contain Required attribute (%s)", k, key) - } + if len(v.ExactlyOneOf) > 0 { + err := checkKeysAgainstSchemaFlags(k, v.ExactlyOneOf, topSchemaMap, v, true) + if err != nil { + return fmt.Errorf("ExactlyOneOf: %+v", err) + } + } - if len(target.ComputedWhen) > 0 { - return fmt.Errorf("%s: ConflictsWith cannot contain Computed(When) attribute (%s)", k, key) - } + if len(v.AtLeastOneOf) > 0 { + err := checkKeysAgainstSchemaFlags(k, v.AtLeastOneOf, topSchemaMap, v, true) + if err != nil { + return fmt.Errorf("AtLeastOneOf: %+v", err) } } @@ -845,6 +863,62 @@ func (m schemaMap) internalValidate(topSchemaMap schemaMap, attrsOnly bool) erro return nil } +func checkKeysAgainstSchemaFlags(k string, keys []string, topSchemaMap schemaMap, self *Schema, allowSelfReference bool) error { + for _, key := range keys { + parts := strings.Split(key, ".") + sm := topSchemaMap + var target *Schema + for idx, part := range parts { + // Skip index fields if 0 + partInt, err := strconv.Atoi(part) + + if err == nil { + if partInt != 0 { + return fmt.Errorf("%s configuration block reference (%s) can only use the .0. index for TypeList and MaxItems: 1 configuration blocks", k, key) + } + + continue + } + + var ok bool + if target, ok = sm[part]; !ok { + return fmt.Errorf("%s references unknown attribute (%s) at part (%s)", k, key, part) + } + + subResource, ok := target.Elem.(*Resource) + + if !ok { + continue + } + + // Skip Type/MaxItems check if not the last element + if (target.Type == TypeSet || target.MaxItems != 1) && idx+1 != len(parts) { + return fmt.Errorf("%s configuration block reference (%s) can only be used with TypeList and MaxItems: 1 configuration blocks", k, key) + } + + sm = schemaMap(subResource.Schema) + } + + if target == nil { + return fmt.Errorf("%s cannot find target attribute (%s), sm: %#v", k, key, sm) + } + + if target == self && !allowSelfReference { + return fmt.Errorf("%s cannot reference self (%s)", k, key) + } + + if target.Required { + return fmt.Errorf("%s cannot contain Required attribute (%s)", k, key) + } + + if len(target.ComputedWhen) > 0 { + return fmt.Errorf("%s cannot contain Computed(When) attribute (%s)", k, key) + } + } + + return nil +} + func isValidFieldName(name string) bool { re := regexp.MustCompile("^[a-z0-9_]+$") return re.MatchString(name) @@ -1350,12 +1424,22 @@ func (m schemaMap) validate( // We're okay as long as we had a value set ok = raw != nil } + + err := validateExactlyOneAttribute(k, schema, c) + if err != nil { + return nil, []error{err} + } + + err = validateAtLeastOneAttribute(k, schema, c) + if err != nil { + return nil, []error{err} + } + if !ok { if schema.Required { return nil, []error{fmt.Errorf( "%q: required field is not set", k)} } - return nil, nil } @@ -1365,6 +1449,11 @@ func (m schemaMap) validate( "%q: this field cannot be set", k)} } + err = validateRequiredWithAttribute(k, schema, c) + if err != nil { + return nil, []error{err} + } + // If the value is unknown then we can't validate it yet. // In particular, this avoids spurious type errors where downstream // validation code sees UnknownVariableValue as being just a string. @@ -1377,7 +1466,7 @@ func (m schemaMap) validate( return nil, nil } - err := m.validateConflictingAttributes(k, schema, c) + err = validateConflictingAttributes(k, schema, c) if err != nil { return nil, []error{err} } @@ -1407,7 +1496,7 @@ func isWhollyKnown(raw interface{}) bool { } return true } -func (m schemaMap) validateConflictingAttributes( +func validateConflictingAttributes( k string, schema *Schema, c *terraform.ResourceConfig) error { @@ -1431,6 +1520,100 @@ func (m schemaMap) validateConflictingAttributes( return nil } +func removeDuplicates(elements []string) []string { + encountered := make(map[string]struct{}, 0) + result := []string{} + + for v := range elements { + if _, ok := encountered[elements[v]]; !ok { + encountered[elements[v]] = struct{}{} + result = append(result, elements[v]) + } + } + + return result +} + +func validateRequiredWithAttribute( + k string, + schema *Schema, + c *terraform.ResourceConfig) error { + + if len(schema.RequiredWith) == 0 { + return nil + } + + allKeys := removeDuplicates(append(schema.RequiredWith, k)) + sort.Strings(allKeys) + + for _, key := range allKeys { + if _, ok := c.Get(key); !ok { + return fmt.Errorf("%q: all of `%s` must be specified", k, strings.Join(allKeys, ",")) + } + } + + return nil +} + +func validateExactlyOneAttribute( + k string, + schema *Schema, + c *terraform.ResourceConfig) error { + + if len(schema.ExactlyOneOf) == 0 { + return nil + } + + allKeys := removeDuplicates(append(schema.ExactlyOneOf, k)) + sort.Strings(allKeys) + specified := make([]string, 0) + unknownVariableValueCount := 0 + for _, exactlyOneOfKey := range allKeys { + if c.IsComputed(exactlyOneOfKey) { + unknownVariableValueCount++ + continue + } + + _, ok := c.Get(exactlyOneOfKey) + if ok { + specified = append(specified, exactlyOneOfKey) + } + } + + if len(specified) == 0 && unknownVariableValueCount == 0 { + return fmt.Errorf("%q: one of `%s` must be specified", k, strings.Join(allKeys, ",")) + } + + if len(specified) > 1 { + return fmt.Errorf("%q: only one of `%s` can be specified, but `%s` were specified.", k, strings.Join(allKeys, ","), strings.Join(specified, ",")) + } + + return nil +} + +func validateAtLeastOneAttribute( + k string, + schema *Schema, + c *terraform.ResourceConfig) error { + + if len(schema.AtLeastOneOf) == 0 { + return nil + } + + allKeys := removeDuplicates(append(schema.AtLeastOneOf, k)) + sort.Strings(allKeys) + + for _, atLeastOneOfKey := range allKeys { + if _, ok := c.Get(atLeastOneOfKey); ok { + // We can ignore hcl2shim.UnknownVariable by assuming it's been set and additional validation elsewhere + // will uncover this if it is in fact null. + return nil + } + } + + return fmt.Errorf("%q: one of `%s` must be specified", k, strings.Join(allKeys, ",")) +} + func (m schemaMap) validateList( k string, raw interface{}, @@ -1486,7 +1669,7 @@ func (m schemaMap) validateList( // Now build the []interface{} raws := make([]interface{}, rawV.Len()) - for i, _ := range raws { + for i := range raws { raws[i] = rawV.Index(i).Interface() } @@ -1572,7 +1755,7 @@ func (m schemaMap) validateMap( // It is a slice, verify that all the elements are maps raws := make([]interface{}, rawV.Len()) - for i, _ := range raws { + for i := range raws { raws[i] = rawV.Index(i).Interface() } @@ -1696,7 +1879,7 @@ func (m schemaMap) validateObject( // Detect any extra/unknown keys and report those as errors. if m, ok := raw.(map[string]interface{}); ok { - for subk, _ := range m { + for subk := range m { if _, ok := schema[subk]; !ok { if subk == TimeoutsConfigKey { continue diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go index daa431ddb..1b39ff639 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go @@ -150,13 +150,46 @@ func (s *Set) Union(other *Set) *Set { return result } +func checkSetMapEqual(m1, m2 map[string]interface{}) bool { + if (m1 == nil) != (m2 == nil) { + return false + } + if len(m1) != len(m2) { + return false + } + for k := range m1 { + v1 := m1[k] + v2, ok := m2[k] + if !ok { + return false + } + switch v1.(type) { + case map[string]interface{}: + same := checkSetMapEqual(v1.(map[string]interface{}), v2.(map[string]interface{})) + if !same { + return false + } + case *Set: + same := v1.(*Set).Equal(v2) + if !same { + return false + } + default: + same := reflect.DeepEqual(v1, v2) + if !same { + return false + } + } + } + return true +} + func (s *Set) Equal(raw interface{}) bool { other, ok := raw.(*Set) if !ok { return false } - - return reflect.DeepEqual(s.m, other.m) + return checkSetMapEqual(s.m, other.m) } // HashEqual simply checks to the keys the top-level map to the keys in the diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/float.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/float.go new file mode 100644 index 000000000..f0bfbfa53 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/float.go @@ -0,0 +1,64 @@ +package validation + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// FloatBetween returns a SchemaValidateFunc which tests if the provided value +// is of type float64 and is between min and max (inclusive). +func FloatBetween(min, max float64) schema.SchemaValidateFunc { + return func(i interface{}, k string) (s []string, es []error) { + v, ok := i.(float64) + if !ok { + es = append(es, fmt.Errorf("expected type of %s to be float64", k)) + return + } + + if v < min || v > max { + es = append(es, fmt.Errorf("expected %s to be in the range (%f - %f), got %f", k, min, max, v)) + return + } + + return + } +} + +// FloatAtLeast returns a SchemaValidateFunc which tests if the provided value +// is of type float and is at least min (inclusive) +func FloatAtLeast(min float64) schema.SchemaValidateFunc { + return func(i interface{}, k string) (s []string, es []error) { + v, ok := i.(float64) + if !ok { + es = append(es, fmt.Errorf("expected type of %s to be float", k)) + return + } + + if v < min { + es = append(es, fmt.Errorf("expected %s to be at least (%f), got %f", k, min, v)) + return + } + + return + } +} + +// FloatAtMost returns a SchemaValidateFunc which tests if the provided value +// is of type float and is at most max (inclusive) +func FloatAtMost(max float64) schema.SchemaValidateFunc { + return func(i interface{}, k string) (s []string, es []error) { + v, ok := i.(float64) + if !ok { + es = append(es, fmt.Errorf("expected type of %s to be float", k)) + return + } + + if v > max { + es = append(es, fmt.Errorf("expected %s to be at most (%f), got %f", k, max, v)) + return + } + + return + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/int.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/int.go new file mode 100644 index 000000000..8ade5b1e6 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/int.go @@ -0,0 +1,125 @@ +package validation + +import ( + "fmt" + "math" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// IntBetween returns a SchemaValidateFunc which tests if the provided value +// is of type int and is between min and max (inclusive) +func IntBetween(min, max int) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be integer", k)) + return warnings, errors + } + + if v < min || v > max { + errors = append(errors, fmt.Errorf("expected %s to be in the range (%d - %d), got %d", k, min, max, v)) + return warnings, errors + } + + return warnings, errors + } +} + +// IntAtLeast returns a SchemaValidateFunc which tests if the provided value +// is of type int and is at least min (inclusive) +func IntAtLeast(min int) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be integer", k)) + return warnings, errors + } + + if v < min { + errors = append(errors, fmt.Errorf("expected %s to be at least (%d), got %d", k, min, v)) + return warnings, errors + } + + return warnings, errors + } +} + +// IntAtMost returns a SchemaValidateFunc which tests if the provided value +// is of type int and is at most max (inclusive) +func IntAtMost(max int) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be integer", k)) + return warnings, errors + } + + if v > max { + errors = append(errors, fmt.Errorf("expected %s to be at most (%d), got %d", k, max, v)) + return warnings, errors + } + + return warnings, errors + } +} + +// IntDivisibleBy returns a SchemaValidateFunc which tests if the provided value +// is of type int and is divisible by a given number +func IntDivisibleBy(divisor int) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be integer", k)) + return warnings, errors + } + + if math.Mod(float64(v), float64(divisor)) != 0 { + errors = append(errors, fmt.Errorf("expected %s to be divisible by %d, got: %v", k, divisor, i)) + return warnings, errors + } + + return warnings, errors + } +} + +// IntInSlice returns a SchemaValidateFunc which tests if the provided value +// is of type int and matches the value of an element in the valid slice +func IntInSlice(valid []int) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be integer", k)) + return warnings, errors + } + + for _, validInt := range valid { + if v == validInt { + return warnings, errors + } + } + + errors = append(errors, fmt.Errorf("expected %s to be one of %v, got %d", k, valid, v)) + return warnings, errors + } +} + +// IntNotInSlice returns a SchemaValidateFunc which tests if the provided value +// is of type int and matches the value of an element in the valid slice +func IntNotInSlice(valid []int) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be integer", k)) + return warnings, errors + } + + for _, validInt := range valid { + if v == validInt { + errors = append(errors, fmt.Errorf("expected %s to not be one of %v, got %d", k, valid, v)) + } + } + + return warnings, errors + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/list.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/list.go new file mode 100644 index 000000000..d60a4882f --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/list.go @@ -0,0 +1,41 @@ +package validation + +import "fmt" + +// ValidateListUniqueStrings is a ValidateFunc that ensures a list has no +// duplicate items in it. It's useful for when a list is needed over a set +// because order matters, yet the items still need to be unique. +// +// Deprecated: use ListOfUniqueStrings +func ValidateListUniqueStrings(i interface{}, k string) (warnings []string, errors []error) { + return ListOfUniqueStrings(i, k) +} + +// ListOfUniqueStrings is a ValidateFunc that ensures a list has no +// duplicate items in it. It's useful for when a list is needed over a set +// because order matters, yet the items still need to be unique. +func ListOfUniqueStrings(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.([]interface{}) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be List", k)) + return warnings, errors + } + + for _, e := range v { + if _, eok := e.(string); !eok { + errors = append(errors, fmt.Errorf("expected %q to only contain string elements, found :%v", k, e)) + return warnings, errors + } + } + + for n1, i1 := range v { + for n2, i2 := range v { + if i1.(string) == i2.(string) && n1 != n2 { + errors = append(errors, fmt.Errorf("expected %q to not have duplicates: found 2 or more of %v", k, i1)) + return warnings, errors + } + } + } + + return warnings, errors +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/meta.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/meta.go new file mode 100644 index 000000000..b05557ac2 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/meta.go @@ -0,0 +1,59 @@ +package validation + +import ( + "fmt" + "reflect" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// NoZeroValues is a SchemaValidateFunc which tests if the provided value is +// not a zero value. It's useful in situations where you want to catch +// explicit zero values on things like required fields during validation. +func NoZeroValues(i interface{}, k string) (s []string, es []error) { + if reflect.ValueOf(i).Interface() == reflect.Zero(reflect.TypeOf(i)).Interface() { + switch reflect.TypeOf(i).Kind() { + case reflect.String: + es = append(es, fmt.Errorf("%s must not be empty, got %v", k, i)) + case reflect.Int, reflect.Float64: + es = append(es, fmt.Errorf("%s must not be zero, got %v", k, i)) + default: + // this validator should only ever be applied to TypeString, TypeInt and TypeFloat + panic(fmt.Errorf("can't use NoZeroValues with %T attribute %s", i, k)) + } + } + return +} + +// All returns a SchemaValidateFunc which tests if the provided value +// passes all provided SchemaValidateFunc +func All(validators ...schema.SchemaValidateFunc) schema.SchemaValidateFunc { + return func(i interface{}, k string) ([]string, []error) { + var allErrors []error + var allWarnings []string + for _, validator := range validators { + validatorWarnings, validatorErrors := validator(i, k) + allWarnings = append(allWarnings, validatorWarnings...) + allErrors = append(allErrors, validatorErrors...) + } + return allWarnings, allErrors + } +} + +// Any returns a SchemaValidateFunc which tests if the provided value +// passes any of the provided SchemaValidateFunc +func Any(validators ...schema.SchemaValidateFunc) schema.SchemaValidateFunc { + return func(i interface{}, k string) ([]string, []error) { + var allErrors []error + var allWarnings []string + for _, validator := range validators { + validatorWarnings, validatorErrors := validator(i, k) + if len(validatorWarnings) == 0 && len(validatorErrors) == 0 { + return []string{}, []error{} + } + allWarnings = append(allWarnings, validatorWarnings...) + allErrors = append(allErrors, validatorErrors...) + } + return allWarnings, allErrors + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/network.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/network.go new file mode 100644 index 000000000..4fea71798 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/network.go @@ -0,0 +1,194 @@ +package validation + +import ( + "bytes" + "fmt" + "net" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// SingleIP returns a SchemaValidateFunc which tests if the provided value +// is of type string, and in valid single Value notation +// +// Deprecated: use IsIPAddress instead +func SingleIP() schema.SchemaValidateFunc { + return IsIPAddress +} + +// IsIPAddress is a SchemaValidateFunc which tests if the provided value is of type string and is a single IP (v4 or v6) +func IsIPAddress(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return warnings, errors + } + + ip := net.ParseIP(v) + if ip == nil { + errors = append(errors, fmt.Errorf("expected %s to contain a valid IP, got: %s", k, v)) + } + + return warnings, errors +} + +// IsIPv6Address is a SchemaValidateFunc which tests if the provided value is of type string and a valid IPv6 address +func IsIPv6Address(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return warnings, errors + } + + ip := net.ParseIP(v) + if six := ip.To16(); six == nil { + errors = append(errors, fmt.Errorf("expected %s to contain a valid IPv6 address, got: %s", k, v)) + } + + return warnings, errors +} + +// IsIPv4Address is a SchemaValidateFunc which tests if the provided value is of type string and a valid IPv4 address +func IsIPv4Address(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return warnings, errors + } + + ip := net.ParseIP(v) + if four := ip.To4(); four == nil { + errors = append(errors, fmt.Errorf("expected %s to contain a valid IPv4 address, got: %s", k, v)) + } + + return warnings, errors +} + +// IPRange returns a SchemaValidateFunc which tests if the provided value is of type string, and in valid IP range +// +// Deprecated: use IsIPv4Range instead +func IPRange() schema.SchemaValidateFunc { + return IsIPv4Range +} + +// IsIPv4Range is a SchemaValidateFunc which tests if the provided value is of type string, and in valid IP range +func IsIPv4Range(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + ips := strings.Split(v, "-") + if len(ips) != 2 { + errors = append(errors, fmt.Errorf("expected %s to contain a valid IP range, got: %s", k, v)) + return warnings, errors + } + + ip1 := net.ParseIP(ips[0]) + ip2 := net.ParseIP(ips[1]) + if ip1 == nil || ip2 == nil || bytes.Compare(ip1, ip2) > 0 { + errors = append(errors, fmt.Errorf("expected %s to contain a valid IP range, got: %s", k, v)) + } + + return warnings, errors +} + +// IsCIDR is a SchemaValidateFunc which tests if the provided value is of type string and a valid CIDR +func IsCIDR(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + if _, _, err := net.ParseCIDR(v); err != nil { + errors = append(errors, fmt.Errorf("expected %q to be a valid IPv4 Value, got %v: %v", k, i, err)) + } + + return warnings, errors +} + +// CIDRNetwork returns a SchemaValidateFunc which tests if the provided value +// is of type string, is in valid Value network notation, and has significant bits between min and max (inclusive) +// +// Deprecated: use IsCIDRNetwork instead +func CIDRNetwork(min, max int) schema.SchemaValidateFunc { + return IsCIDRNetwork(min, max) +} + +// IsCIDRNetwork returns a SchemaValidateFunc which tests if the provided value +// is of type string, is in valid Value network notation, and has significant bits between min and max (inclusive) +func IsCIDRNetwork(min, max int) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + _, ipnet, err := net.ParseCIDR(v) + if err != nil { + errors = append(errors, fmt.Errorf("expected %s to contain a valid Value, got: %s with err: %s", k, v, err)) + return warnings, errors + } + + if ipnet == nil || v != ipnet.String() { + errors = append(errors, fmt.Errorf("expected %s to contain a valid network Value, expected %s, got %s", + k, ipnet, v)) + } + + sigbits, _ := ipnet.Mask.Size() + if sigbits < min || sigbits > max { + errors = append(errors, fmt.Errorf("expected %q to contain a network Value with between %d and %d significant bits, got: %d", k, min, max, sigbits)) + } + + return warnings, errors + } +} + +// IsMACAddress is a SchemaValidateFunc which tests if the provided value is of type string and a valid MAC address +func IsMACAddress(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return warnings, errors + } + + if _, err := net.ParseMAC(v); err != nil { + errors = append(errors, fmt.Errorf("expected %q to be a valid MAC address, got %v: %v", k, i, err)) + } + + return warnings, errors +} + +// IsPortNumber is a SchemaValidateFunc which tests if the provided value is of type string and a valid TCP Port Number +func IsPortNumber(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be integer", k)) + return warnings, errors + } + + if 1 > v || v > 65535 { + errors = append(errors, fmt.Errorf("expected %q to be a valid port number, got: %v", k, v)) + } + + return warnings, errors +} + +// IsPortNumberOrZero is a SchemaValidateFunc which tests if the provided value is of type string and a valid TCP Port Number or zero +func IsPortNumberOrZero(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be integer", k)) + return warnings, errors + } + + if 0 > v || v > 65535 { + errors = append(errors, fmt.Errorf("expected %q to be a valid port number or 0, got: %v", k, v)) + } + + return warnings, errors +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/strings.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/strings.go new file mode 100644 index 000000000..c4e53b512 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/strings.go @@ -0,0 +1,253 @@ +package validation + +import ( + "encoding/base64" + "fmt" + "regexp" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/structure" +) + +// StringIsNotEmpty is a ValidateFunc that ensures a string is not empty +func StringIsNotEmpty(i interface{}, k string) ([]string, []error) { + v, ok := i.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %q to be string", k)} + } + + if v == "" { + return nil, []error{fmt.Errorf("expected %q to not be an empty string, got %v", k, i)} + } + + return nil, nil +} + +// StringIsNotWhiteSpace is a ValidateFunc that ensures a string is not empty or consisting entirely of whitespace characters +func StringIsNotWhiteSpace(i interface{}, k string) ([]string, []error) { + v, ok := i.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %q to be string", k)} + } + + if strings.TrimSpace(v) == "" { + return nil, []error{fmt.Errorf("expected %q to not be an empty string or whitespace", k)} + } + + return nil, nil +} + +// StringIsEmpty is a ValidateFunc that ensures a string has no characters +func StringIsEmpty(i interface{}, k string) ([]string, []error) { + v, ok := i.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %q to be string", k)} + } + + if v != "" { + return nil, []error{fmt.Errorf("expected %q to be an empty string: got %v", k, v)} + } + + return nil, nil +} + +// StringIsWhiteSpace is a ValidateFunc that ensures a string is composed of entirely whitespace +func StringIsWhiteSpace(i interface{}, k string) ([]string, []error) { + v, ok := i.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %q to be string", k)} + } + + if strings.TrimSpace(v) != "" { + return nil, []error{fmt.Errorf("expected %q to be an empty string or whitespace: got %v", k, v)} + } + + return nil, nil +} + +// StringLenBetween returns a SchemaValidateFunc which tests if the provided value +// is of type string and has length between min and max (inclusive) +func StringLenBetween(min, max int) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + if len(v) < min || len(v) > max { + errors = append(errors, fmt.Errorf("expected length of %s to be in the range (%d - %d), got %s", k, min, max, v)) + } + + return warnings, errors + } +} + +// StringMatch returns a SchemaValidateFunc which tests if the provided value +// matches a given regexp. Optionally an error message can be provided to +// return something friendlier than "must match some globby regexp". +func StringMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc { + return func(i interface{}, k string) ([]string, []error) { + v, ok := i.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %s to be string", k)} + } + + if ok := r.MatchString(v); !ok { + if message != "" { + return nil, []error{fmt.Errorf("invalid value for %s (%s)", k, message)} + + } + return nil, []error{fmt.Errorf("expected value of %s to match regular expression %q, got %v", k, r, i)} + } + return nil, nil + } +} + +// StringDoesNotMatch returns a SchemaValidateFunc which tests if the provided value +// does not match a given regexp. Optionally an error message can be provided to +// return something friendlier than "must not match some globby regexp". +func StringDoesNotMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc { + return func(i interface{}, k string) ([]string, []error) { + v, ok := i.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %s to be string", k)} + } + + if ok := r.MatchString(v); ok { + if message != "" { + return nil, []error{fmt.Errorf("invalid value for %s (%s)", k, message)} + + } + return nil, []error{fmt.Errorf("expected value of %s to not match regular expression %q, got %v", k, r, i)} + } + return nil, nil + } +} + +// StringInSlice returns a SchemaValidateFunc which tests if the provided value +// is of type string and matches the value of an element in the valid slice +// will test with in lower case if ignoreCase is true +func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + for _, str := range valid { + if v == str || (ignoreCase && strings.ToLower(v) == strings.ToLower(str)) { + return warnings, errors + } + } + + errors = append(errors, fmt.Errorf("expected %s to be one of %v, got %s", k, valid, v)) + return warnings, errors + } +} + +// StringNotInSlice returns a SchemaValidateFunc which tests if the provided value +// is of type string and does not match the value of any element in the invalid slice +// will test with in lower case if ignoreCase is true +func StringNotInSlice(invalid []string, ignoreCase bool) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + for _, str := range invalid { + if v == str || (ignoreCase && strings.ToLower(v) == strings.ToLower(str)) { + errors = append(errors, fmt.Errorf("expected %s to not be any of %v, got %s", k, invalid, v)) + return warnings, errors + } + } + + return warnings, errors + } +} + +// StringDoesNotContainAny returns a SchemaValidateFunc which validates that the +// provided value does not contain any of the specified Unicode code points in chars. +func StringDoesNotContainAny(chars string) schema.SchemaValidateFunc { + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + if strings.ContainsAny(v, chars) { + errors = append(errors, fmt.Errorf("expected value of %s to not contain any of %q, got %v", k, chars, i)) + return warnings, errors + } + + return warnings, errors + } +} + +// StringIsBase64 is a ValidateFunc that ensures a string can be parsed as Base64 +func StringIsBase64(i interface{}, k string) (warnings []string, errors []error) { + // Empty string is not allowed + if warnings, errors = StringIsNotEmpty(i, k); len(errors) > 0 { + return + } + + // NoEmptyStrings checks it is a string + v, _ := i.(string) + + if _, err := base64.StdEncoding.DecodeString(v); err != nil { + errors = append(errors, fmt.Errorf("expected %q to be a base64 string, got %v", k, v)) + } + + return warnings, errors +} + +// ValidateJsonString is a SchemaValidateFunc which tests to make sure the +// supplied string is valid JSON. +// +// Deprecated: use StringIsJSON instead +func ValidateJsonString(i interface{}, k string) (warnings []string, errors []error) { + return StringIsJSON(i, k) +} + +// StringIsJSON is a SchemaValidateFunc which tests to make sure the supplied string is valid JSON. +func StringIsJSON(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + if _, err := structure.NormalizeJsonString(v); err != nil { + errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) + } + + return warnings, errors +} + +// ValidateRegexp returns a SchemaValidateFunc which tests to make sure the +// supplied string is a valid regular expression. +// +// Deprecated: use StringIsValidRegExp instead +func ValidateRegexp(i interface{}, k string) (warnings []string, errors []error) { + return StringIsValidRegExp(i, k) +} + +// StringIsValidRegExp returns a SchemaValidateFunc which tests to make sure the supplied string is a valid regular expression. +func StringIsValidRegExp(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return warnings, errors + } + + if _, err := regexp.Compile(v); err != nil { + errors = append(errors, fmt.Errorf("%q: %s", k, err)) + } + + return warnings, errors +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/testing.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/testing.go new file mode 100644 index 000000000..8a2da7f89 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/testing.go @@ -0,0 +1,43 @@ +package validation + +import ( + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +type testCase struct { + val interface{} + f schema.SchemaValidateFunc + expectedErr *regexp.Regexp +} + +func runTestCases(t *testing.T, cases []testCase) { + matchErr := func(errs []error, r *regexp.Regexp) bool { + // err must match one provided + for _, err := range errs { + if r.MatchString(err.Error()) { + return true + } + } + + return false + } + + for i, tc := range cases { + _, errs := tc.f(tc.val, "test_property") + + if len(errs) == 0 && tc.expectedErr == nil { + continue + } + + if len(errs) != 0 && tc.expectedErr == nil { + t.Fatalf("expected test case %d to produce no errors, got %v", i, errs) + } + + if !matchErr(errs, tc.expectedErr) { + t.Fatalf("expected test case %d to produce error matching \"%s\", got %v", i, tc.expectedErr, errs) + } + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/time.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/time.go new file mode 100644 index 000000000..1c6788c68 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/time.go @@ -0,0 +1,61 @@ +package validation + +import ( + "fmt" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// IsDayOfTheWeek id a SchemaValidateFunc which tests if the provided value is of type string and a valid english day of the week +func IsDayOfTheWeek(ignoreCase bool) schema.SchemaValidateFunc { + return StringInSlice([]string{ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday", + }, ignoreCase) +} + +// IsMonth id a SchemaValidateFunc which tests if the provided value is of type string and a valid english month +func IsMonth(ignoreCase bool) schema.SchemaValidateFunc { + return StringInSlice([]string{ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", + }, ignoreCase) +} + +// IsRFC3339Time is a SchemaValidateFunc which tests if the provided value is of type string and a valid RFC33349Time +func IsRFC3339Time(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return warnings, errors + } + + if _, err := time.Parse(time.RFC3339, v); err != nil { + errors = append(errors, fmt.Errorf("expected %q to be a valid RFC3339 date, got %q: %+v", k, i, err)) + } + + return warnings, errors +} + +// ValidateRFC3339TimeString is a ValidateFunc that ensures a string parses as time.RFC3339 format +// +// Deprecated: use IsRFC3339Time() instead +func ValidateRFC3339TimeString(i interface{}, k string) (warnings []string, errors []error) { + return IsRFC3339Time(i, k) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/uuid.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/uuid.go new file mode 100644 index 000000000..00783fafc --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/uuid.go @@ -0,0 +1,22 @@ +package validation + +import ( + "fmt" + + "github.com/hashicorp/go-uuid" +) + +// IsUUID is a ValidateFunc that ensures a string can be parsed as UUID +func IsUUID(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return + } + + if _, err := uuid.ParseUUID(v); err != nil { + errors = append(errors, fmt.Errorf("expected %q to be a valid UUID, got %v", k, v)) + } + + return warnings, errors +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/validation.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/validation.go deleted file mode 100644 index fd3dbd951..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/validation.go +++ /dev/null @@ -1,341 +0,0 @@ -package validation - -import ( - "bytes" - "fmt" - "net" - "reflect" - "regexp" - "strings" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/structure" -) - -// All returns a SchemaValidateFunc which tests if the provided value -// passes all provided SchemaValidateFunc -func All(validators ...schema.SchemaValidateFunc) schema.SchemaValidateFunc { - return func(i interface{}, k string) ([]string, []error) { - var allErrors []error - var allWarnings []string - for _, validator := range validators { - validatorWarnings, validatorErrors := validator(i, k) - allWarnings = append(allWarnings, validatorWarnings...) - allErrors = append(allErrors, validatorErrors...) - } - return allWarnings, allErrors - } -} - -// Any returns a SchemaValidateFunc which tests if the provided value -// passes any of the provided SchemaValidateFunc -func Any(validators ...schema.SchemaValidateFunc) schema.SchemaValidateFunc { - return func(i interface{}, k string) ([]string, []error) { - var allErrors []error - var allWarnings []string - for _, validator := range validators { - validatorWarnings, validatorErrors := validator(i, k) - if len(validatorWarnings) == 0 && len(validatorErrors) == 0 { - return []string{}, []error{} - } - allWarnings = append(allWarnings, validatorWarnings...) - allErrors = append(allErrors, validatorErrors...) - } - return allWarnings, allErrors - } -} - -// IntBetween returns a SchemaValidateFunc which tests if the provided value -// is of type int and is between min and max (inclusive) -func IntBetween(min, max int) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(int) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be int", k)) - return - } - - if v < min || v > max { - es = append(es, fmt.Errorf("expected %s to be in the range (%d - %d), got %d", k, min, max, v)) - return - } - - return - } -} - -// IntAtLeast returns a SchemaValidateFunc which tests if the provided value -// is of type int and is at least min (inclusive) -func IntAtLeast(min int) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(int) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be int", k)) - return - } - - if v < min { - es = append(es, fmt.Errorf("expected %s to be at least (%d), got %d", k, min, v)) - return - } - - return - } -} - -// IntAtMost returns a SchemaValidateFunc which tests if the provided value -// is of type int and is at most max (inclusive) -func IntAtMost(max int) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(int) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be int", k)) - return - } - - if v > max { - es = append(es, fmt.Errorf("expected %s to be at most (%d), got %d", k, max, v)) - return - } - - return - } -} - -// IntInSlice returns a SchemaValidateFunc which tests if the provided value -// is of type int and matches the value of an element in the valid slice -func IntInSlice(valid []int) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(int) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be an integer", k)) - return - } - - for _, validInt := range valid { - if v == validInt { - return - } - } - - es = append(es, fmt.Errorf("expected %s to be one of %v, got %d", k, valid, v)) - return - } -} - -// StringInSlice returns a SchemaValidateFunc which tests if the provided value -// is of type string and matches the value of an element in the valid slice -// will test with in lower case if ignoreCase is true -func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(string) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be string", k)) - return - } - - for _, str := range valid { - if v == str || (ignoreCase && strings.ToLower(v) == strings.ToLower(str)) { - return - } - } - - es = append(es, fmt.Errorf("expected %s to be one of %v, got %s", k, valid, v)) - return - } -} - -// StringLenBetween returns a SchemaValidateFunc which tests if the provided value -// is of type string and has length between min and max (inclusive) -func StringLenBetween(min, max int) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(string) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be string", k)) - return - } - if len(v) < min || len(v) > max { - es = append(es, fmt.Errorf("expected length of %s to be in the range (%d - %d), got %s", k, min, max, v)) - } - return - } -} - -// StringMatch returns a SchemaValidateFunc which tests if the provided value -// matches a given regexp. Optionally an error message can be provided to -// return something friendlier than "must match some globby regexp". -func StringMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc { - return func(i interface{}, k string) ([]string, []error) { - v, ok := i.(string) - if !ok { - return nil, []error{fmt.Errorf("expected type of %s to be string", k)} - } - - if ok := r.MatchString(v); !ok { - if message != "" { - return nil, []error{fmt.Errorf("invalid value for %s (%s)", k, message)} - - } - return nil, []error{fmt.Errorf("expected value of %s to match regular expression %q", k, r)} - } - return nil, nil - } -} - -// NoZeroValues is a SchemaValidateFunc which tests if the provided value is -// not a zero value. It's useful in situations where you want to catch -// explicit zero values on things like required fields during validation. -func NoZeroValues(i interface{}, k string) (s []string, es []error) { - if reflect.ValueOf(i).Interface() == reflect.Zero(reflect.TypeOf(i)).Interface() { - switch reflect.TypeOf(i).Kind() { - case reflect.String: - es = append(es, fmt.Errorf("%s must not be empty", k)) - case reflect.Int, reflect.Float64: - es = append(es, fmt.Errorf("%s must not be zero", k)) - default: - // this validator should only ever be applied to TypeString, TypeInt and TypeFloat - panic(fmt.Errorf("can't use NoZeroValues with %T attribute %s", i, k)) - } - } - return -} - -// CIDRNetwork returns a SchemaValidateFunc which tests if the provided value -// is of type string, is in valid CIDR network notation, and has significant bits between min and max (inclusive) -func CIDRNetwork(min, max int) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(string) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be string", k)) - return - } - - _, ipnet, err := net.ParseCIDR(v) - if err != nil { - es = append(es, fmt.Errorf( - "expected %s to contain a valid CIDR, got: %s with err: %s", k, v, err)) - return - } - - if ipnet == nil || v != ipnet.String() { - es = append(es, fmt.Errorf( - "expected %s to contain a valid network CIDR, expected %s, got %s", - k, ipnet, v)) - } - - sigbits, _ := ipnet.Mask.Size() - if sigbits < min || sigbits > max { - es = append(es, fmt.Errorf( - "expected %q to contain a network CIDR with between %d and %d significant bits, got: %d", - k, min, max, sigbits)) - } - - return - } -} - -// SingleIP returns a SchemaValidateFunc which tests if the provided value -// is of type string, and in valid single IP notation -func SingleIP() schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(string) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be string", k)) - return - } - - ip := net.ParseIP(v) - if ip == nil { - es = append(es, fmt.Errorf( - "expected %s to contain a valid IP, got: %s", k, v)) - } - return - } -} - -// IPRange returns a SchemaValidateFunc which tests if the provided value -// is of type string, and in valid IP range notation -func IPRange() schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(string) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be string", k)) - return - } - - ips := strings.Split(v, "-") - if len(ips) != 2 { - es = append(es, fmt.Errorf( - "expected %s to contain a valid IP range, got: %s", k, v)) - return - } - ip1 := net.ParseIP(ips[0]) - ip2 := net.ParseIP(ips[1]) - if ip1 == nil || ip2 == nil || bytes.Compare(ip1, ip2) > 0 { - es = append(es, fmt.Errorf( - "expected %s to contain a valid IP range, got: %s", k, v)) - } - return - } -} - -// ValidateJsonString is a SchemaValidateFunc which tests to make sure the -// supplied string is valid JSON. -func ValidateJsonString(v interface{}, k string) (ws []string, errors []error) { - if _, err := structure.NormalizeJsonString(v); err != nil { - errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err)) - } - return -} - -// ValidateListUniqueStrings is a ValidateFunc that ensures a list has no -// duplicate items in it. It's useful for when a list is needed over a set -// because order matters, yet the items still need to be unique. -func ValidateListUniqueStrings(v interface{}, k string) (ws []string, errors []error) { - for n1, v1 := range v.([]interface{}) { - for n2, v2 := range v.([]interface{}) { - if v1.(string) == v2.(string) && n1 != n2 { - errors = append(errors, fmt.Errorf("%q: duplicate entry - %s", k, v1.(string))) - } - } - } - return -} - -// ValidateRegexp returns a SchemaValidateFunc which tests to make sure the -// supplied string is a valid regular expression. -func ValidateRegexp(v interface{}, k string) (ws []string, errors []error) { - if _, err := regexp.Compile(v.(string)); err != nil { - errors = append(errors, fmt.Errorf("%q: %s", k, err)) - } - return -} - -// ValidateRFC3339TimeString is a ValidateFunc that ensures a string parses -// as time.RFC3339 format -func ValidateRFC3339TimeString(v interface{}, k string) (ws []string, errors []error) { - if _, err := time.Parse(time.RFC3339, v.(string)); err != nil { - errors = append(errors, fmt.Errorf("%q: invalid RFC3339 timestamp", k)) - } - return -} - -// FloatBetween returns a SchemaValidateFunc which tests if the provided value -// is of type float64 and is between min and max (inclusive). -func FloatBetween(min, max float64) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(float64) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be float64", k)) - return - } - - if v < min || v > max { - es = append(es, fmt.Errorf("expected %s to be in the range (%f - %f), got %f", k, min, max, v)) - return - } - - return - } -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/web.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/web.go new file mode 100644 index 000000000..eb5437f14 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/validation/web.go @@ -0,0 +1,55 @@ +package validation + +import ( + "fmt" + "net/url" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// IsURLWithHTTPS is a SchemaValidateFunc which tests if the provided value is of type string and a valid HTTPS URL +func IsURLWithHTTPS(i interface{}, k string) (_ []string, errors []error) { + return IsURLWithScheme([]string{"https"})(i, k) +} + +// IsURLWithHTTPorHTTPS is a SchemaValidateFunc which tests if the provided value is of type string and a valid HTTP or HTTPS URL +func IsURLWithHTTPorHTTPS(i interface{}, k string) (_ []string, errors []error) { + return IsURLWithScheme([]string{"http", "https"})(i, k) +} + +// IsURLWithScheme is a SchemaValidateFunc which tests if the provided value is of type string and a valid URL with the provided schemas +func IsURLWithScheme(validSchemes []string) schema.SchemaValidateFunc { + return func(i interface{}, k string) (_ []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return + } + + if v == "" { + errors = append(errors, fmt.Errorf("expected %q url to not be empty, got %v", k, i)) + return + } + + u, err := url.Parse(v) + if err != nil { + errors = append(errors, fmt.Errorf("expected %q to be a valid url, got %v: %+v", k, v, err)) + return + } + + if u.Host == "" { + errors = append(errors, fmt.Errorf("expected %q to have a host, got %v", k, v)) + return + } + + for _, s := range validSchemes { + if u.Scheme == s { + return //last check so just return + } + } + + errors = append(errors, fmt.Errorf("expected %q to have a url with schema of: %q, got %v", k, strings.Join(validSchemes, ","), v)) + return + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/httpclient/useragent.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/httpclient/useragent.go new file mode 100644 index 000000000..36b494c01 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/httpclient/useragent.go @@ -0,0 +1,26 @@ +package httpclient + +import ( + "fmt" + "log" + "os" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/meta" +) + +const uaEnvVar = "TF_APPEND_USER_AGENT" + +func TerraformUserAgent(version string) string { + ua := fmt.Sprintf("HashiCorp Terraform/%s (+https://www.terraform.io) Terraform Plugin SDK/%s", version, meta.SDKVersionString()) + + if add := os.Getenv(uaEnvVar); add != "" { + add = strings.TrimSpace(add) + if len(add) > 0 { + ua += " " + add + log.Printf("[DEBUG] Using modified User-Agent: %s", ua) + } + } + + return ua +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module.go index 6420c6301..1533f853c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module.go @@ -16,13 +16,6 @@ import ( // Although Module is a slice, it should be treated as immutable after creation. type Module []string -// RootModule is the module address representing the root of the static module -// call tree, which is also the zero value of Module. -// -// Note that this is not the root of the dynamic module tree, which is instead -// represented by RootModuleInstance. -var RootModule Module - // IsRoot returns true if the receiver is the address of the root module, // or false otherwise. func (m Module) IsRoot() bool { @@ -36,23 +29,6 @@ func (m Module) String() string { return strings.Join([]string(m), ".") } -// Child returns the address of a child call in the receiver, identified by the -// given name. -func (m Module) Child(name string) Module { - ret := make(Module, 0, len(m)+1) - ret = append(ret, m...) - return append(ret, name) -} - -// Parent returns the address of the parent module of the receiver, or the -// receiver itself if there is no parent (if it's the root module address). -func (m Module) Parent() Module { - if len(m) == 0 { - return m - } - return m[:len(m)-1] -} - // Call returns the module call address that corresponds to the given module // instance, along with the address of the module that contains it. // diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module_call.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module_call.go index 09596cc84..d138fade7 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module_call.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module_call.go @@ -18,15 +18,6 @@ func (c ModuleCall) String() string { return "module." + c.Name } -// Instance returns the address of an instance of the receiver identified by -// the given key. -func (c ModuleCall) Instance(key InstanceKey) ModuleCallInstance { - return ModuleCallInstance{ - Call: c, - Key: key, - } -} - // ModuleCallInstance is the address of one instance of a module created from // a module call, which might create multiple instances using "count" or // "for_each" arguments. @@ -51,15 +42,6 @@ func (c ModuleCallInstance) ModuleInstance(caller ModuleInstance) ModuleInstance return caller.Child(c.Call.Name, c.Key) } -// Output returns the address of an output of the receiver identified by its -// name. -func (c ModuleCallInstance) Output(name string) ModuleCallOutput { - return ModuleCallOutput{ - Call: c, - Name: name, - } -} - // ModuleCallOutput is the address of a particular named output produced by // an instance of a module call. type ModuleCallOutput struct { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module_instance.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module_instance.go index 1353622a0..bb0901a26 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module_instance.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/module_instance.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/gocty" @@ -264,12 +264,6 @@ func (m ModuleInstance) String() string { return buf.String() } -// Equal returns true if the receiver and the given other value -// contains the exact same parts. -func (m ModuleInstance) Equal(o ModuleInstance) bool { - return m.String() == o.String() -} - // Less returns true if the receiver should sort before the given other value // in a sorted list of addresses. func (m ModuleInstance) Less(o ModuleInstance) bool { @@ -305,27 +299,6 @@ func (m ModuleInstance) Ancestors() []ModuleInstance { return ret } -// IsAncestor returns true if the receiver is an ancestor of the given -// other value. -func (m ModuleInstance) IsAncestor(o ModuleInstance) bool { - // Longer or equal sized paths means the receiver cannot - // be an ancestor of the given module insatnce. - if len(m) >= len(o) { - return false - } - - for i, ms := range m { - if ms.Name != o[i].Name { - return false - } - if ms.InstanceKey != NoKey && ms.InstanceKey != o[i].InstanceKey { - return false - } - } - - return true -} - // Call returns the module call address that corresponds to the given module // instance, along with the address of the module instance that contains it. // diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/parse_ref.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/parse_ref.go index eccbcda4c..a2ee16441 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/parse_ref.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/parse_ref.go @@ -3,8 +3,8 @@ package addrs import ( "fmt" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" ) @@ -290,7 +290,7 @@ func parseResourceRef(mode ResourceMode, startRange hcl.Range, traversal hcl.Tra // of the resource, but we don't have enough context here to decide // so we'll let the caller resolve that ambiguity. return &Reference{ - Subject: resourceInstAddr, + Subject: resourceAddr, SourceRange: tfdiags.SourceRangeFromHCL(rng), }, diags } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/parse_target.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/parse_target.go index 4f0430989..5b922e8b6 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/parse_target.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/parse_target.go @@ -3,9 +3,9 @@ package addrs import ( "fmt" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" ) @@ -169,84 +169,6 @@ func ParseTargetStr(str string) (*Target, tfdiags.Diagnostics) { return target, diags } -// ParseAbsResource attempts to interpret the given traversal as an absolute -// resource address, using the same syntax as expected by ParseTarget. -// -// If no error diagnostics are returned, the returned target includes the -// address that was extracted and the source range it was extracted from. -// -// If error diagnostics are returned then the AbsResource value is invalid and -// must not be used. -func ParseAbsResource(traversal hcl.Traversal) (AbsResource, tfdiags.Diagnostics) { - addr, diags := ParseTarget(traversal) - if diags.HasErrors() { - return AbsResource{}, diags - } - - switch tt := addr.Subject.(type) { - - case AbsResource: - return tt, diags - - case AbsResourceInstance: // Catch likely user error with specialized message - // Assume that the last element of the traversal must be the index, - // since that's required for a valid resource instance address. - indexStep := traversal[len(traversal)-1] - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid address", - Detail: "A resource address is required. This instance key identifies a specific resource instance, which is not expected here.", - Subject: indexStep.SourceRange().Ptr(), - }) - return AbsResource{}, diags - - case ModuleInstance: // Catch likely user error with specialized message - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid address", - Detail: "A resource address is required here. The module path must be followed by a resource specification.", - Subject: traversal.SourceRange().Ptr(), - }) - return AbsResource{}, diags - - default: // Generic message for other address types - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid address", - Detail: "A resource address is required here.", - Subject: traversal.SourceRange().Ptr(), - }) - return AbsResource{}, diags - - } -} - -// ParseAbsResourceStr is a helper wrapper around ParseAbsResource that takes a -// string and parses it with the HCL native syntax traversal parser before -// interpreting it. -// -// Error diagnostics are returned if either the parsing fails or the analysis -// of the traversal fails. There is no way for the caller to distinguish the -// two kinds of diagnostics programmatically. If error diagnostics are returned -// the returned address may be incomplete. -// -// Since this function has no context about the source of the given string, -// any returned diagnostics will not have meaningful source location -// information. -func ParseAbsResourceStr(str string) (AbsResource, tfdiags.Diagnostics) { - var diags tfdiags.Diagnostics - - traversal, parseDiags := hclsyntax.ParseTraversalAbs([]byte(str), "", hcl.Pos{Line: 1, Column: 1}) - diags = diags.Append(parseDiags) - if parseDiags.HasErrors() { - return AbsResource{}, diags - } - - addr, addrDiags := ParseAbsResource(traversal) - diags = diags.Append(addrDiags) - return addr, diags -} - // ParseAbsResourceInstance attempts to interpret the given traversal as an // absolute resource instance address, using the same syntax as expected by // ParseTarget. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/provider_config.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/provider_config.go index 4d1ed2557..c6fce1a50 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/provider_config.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/provider_config.go @@ -5,8 +5,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" ) // ProviderConfig is the address of a provider configuration. @@ -18,14 +18,6 @@ type ProviderConfig struct { Alias string } -// NewDefaultProviderConfig returns the address of the default (un-aliased) -// configuration for the provider with the given type name. -func NewDefaultProviderConfig(typeName string) ProviderConfig { - return ProviderConfig{ - Type: typeName, - } -} - // ParseProviderConfigCompact parses the given absolute traversal as a relative // provider address in compact form. The following are examples of traversals // that can be successfully parsed as compact relative provider configuration diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/resource.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/resource.go index b075a6d1d..103f8a28c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/resource.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/addrs/resource.go @@ -28,10 +28,6 @@ func (r Resource) String() string { } } -func (r Resource) Equal(o Resource) bool { - return r.String() == o.String() -} - // Instance produces the address for a specific instance of the receiver // that is idenfied by the given key. func (r Resource) Instance(key InstanceKey) ResourceInstance { @@ -90,10 +86,6 @@ func (r ResourceInstance) String() string { return r.Resource.String() + r.Key.String() } -func (r ResourceInstance) Equal(o ResourceInstance) bool { - return r.String() == o.String() -} - // Absolute returns an AbsResourceInstance from the receiver and the given module // instance address. func (r ResourceInstance) Absolute(module ModuleInstance) AbsResourceInstance { @@ -157,10 +149,6 @@ func (r AbsResource) String() string { return fmt.Sprintf("%s.%s", r.Module.String(), r.Resource.String()) } -func (r AbsResource) Equal(o AbsResource) bool { - return r.String() == o.String() -} - // AbsResourceInstance is an absolute address for a resource instance under a // given module path. type AbsResourceInstance struct { @@ -216,10 +204,6 @@ func (r AbsResourceInstance) String() string { return fmt.Sprintf("%s.%s", r.Module.String(), r.Resource.String()) } -func (r AbsResourceInstance) Equal(o AbsResourceInstance) bool { - return r.String() == o.String() -} - // Less returns true if the receiver should sort before the given other value // in a sorted list of addresses. func (r AbsResourceInstance) Less(o AbsResourceInstance) bool { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/command/format/diagnostic.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/command/format/diagnostic.go index 6f64f6c92..c054acf0a 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/command/format/diagnostic.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/command/format/diagnostic.go @@ -7,9 +7,9 @@ import ( "sort" "strings" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcled" - "github.com/hashicorp/hcl2/hclparse" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hcled" + "github.com/hashicorp/hcl/v2/hclparse" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" "github.com/mitchellh/colorstring" wordwrap "github.com/mitchellh/go-wordwrap" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/command/format/plan.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/command/format/plan.go deleted file mode 100644 index 7d3030041..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/command/format/plan.go +++ /dev/null @@ -1,306 +0,0 @@ -package format - -import ( - "bytes" - "fmt" - "log" - "sort" - "strings" - - "github.com/mitchellh/colorstring" - - "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" - "github.com/hashicorp/terraform-plugin-sdk/internal/plans" - "github.com/hashicorp/terraform-plugin-sdk/internal/states" - "github.com/hashicorp/terraform-plugin-sdk/terraform" -) - -// Plan is a representation of a plan optimized for display to -// an end-user, as opposed to terraform.Plan which is for internal use. -// -// DisplayPlan excludes implementation details that may otherwise appear -// in the main plan, such as destroy actions on data sources (which are -// there only to clean up the state). -type Plan struct { - Resources []*InstanceDiff -} - -// InstanceDiff is a representation of an instance diff optimized -// for display, in conjunction with DisplayPlan. -type InstanceDiff struct { - Addr *terraform.ResourceAddress - Action plans.Action - - // Attributes describes changes to the attributes of the instance. - // - // For destroy diffs this is always nil. - Attributes []*AttributeDiff - - Tainted bool - Deposed bool -} - -// AttributeDiff is a representation of an attribute diff optimized -// for display, in conjunction with DisplayInstanceDiff. -type AttributeDiff struct { - // Path is a dot-delimited traversal through possibly many levels of list and map structure, - // intended for display purposes only. - Path string - - Action plans.Action - - OldValue string - NewValue string - - NewComputed bool - Sensitive bool - ForcesNew bool -} - -// PlanStats gives summary counts for a Plan. -type PlanStats struct { - ToAdd, ToChange, ToDestroy int -} - -// NewPlan produces a display-oriented Plan from a terraform.Plan. -func NewPlan(changes *plans.Changes) *Plan { - log.Printf("[TRACE] NewPlan for %#v", changes) - ret := &Plan{} - if changes == nil { - // Nothing to do! - return ret - } - - for _, rc := range changes.Resources { - addr := rc.Addr - log.Printf("[TRACE] NewPlan found %s (%s)", addr, rc.Action) - dataSource := addr.Resource.Resource.Mode == addrs.DataResourceMode - - // We create "delete" actions for data resources so we can clean - // up their entries in state, but this is an implementation detail - // that users shouldn't see. - if dataSource && rc.Action == plans.Delete { - continue - } - - if rc.Action == plans.NoOp { - continue - } - - // For now we'll shim this to work with our old types. - // TODO: Update for the new plan types, ideally also switching over to - // a structural diff renderer instead of a flat renderer. - did := &InstanceDiff{ - Addr: terraform.NewLegacyResourceInstanceAddress(addr), - Action: rc.Action, - } - - if rc.DeposedKey != states.NotDeposed { - did.Deposed = true - } - - // Since this is just a temporary stub implementation on the way - // to us replacing this with the structural diff renderer, we currently - // don't include any attributes here. - // FIXME: Implement the structural diff renderer to replace this - // codepath altogether. - - ret.Resources = append(ret.Resources, did) - } - - // Sort the instance diffs by their addresses for display. - sort.Slice(ret.Resources, func(i, j int) bool { - iAddr := ret.Resources[i].Addr - jAddr := ret.Resources[j].Addr - return iAddr.Less(jAddr) - }) - - return ret -} - -// Format produces and returns a text representation of the receiving plan -// intended for display in a terminal. -// -// If color is not nil, it is used to colorize the output. -func (p *Plan) Format(color *colorstring.Colorize) string { - if p.Empty() { - return "This plan does nothing." - } - - if color == nil { - color = &colorstring.Colorize{ - Colors: colorstring.DefaultColors, - Reset: false, - } - } - - // Find the longest path length of all the paths that are changing, - // so we can align them all. - keyLen := 0 - for _, r := range p.Resources { - for _, attr := range r.Attributes { - key := attr.Path - - if len(key) > keyLen { - keyLen = len(key) - } - } - } - - buf := new(bytes.Buffer) - for _, r := range p.Resources { - formatPlanInstanceDiff(buf, r, keyLen, color) - } - - return strings.TrimSpace(buf.String()) -} - -// Stats returns statistics about the plan -func (p *Plan) Stats() PlanStats { - var ret PlanStats - for _, r := range p.Resources { - switch r.Action { - case plans.Create: - ret.ToAdd++ - case plans.Update: - ret.ToChange++ - case plans.DeleteThenCreate, plans.CreateThenDelete: - ret.ToAdd++ - ret.ToDestroy++ - case plans.Delete: - ret.ToDestroy++ - } - } - return ret -} - -// ActionCounts returns the number of diffs for each action type -func (p *Plan) ActionCounts() map[plans.Action]int { - ret := map[plans.Action]int{} - for _, r := range p.Resources { - ret[r.Action]++ - } - return ret -} - -// Empty returns true if there is at least one resource diff in the receiving plan. -func (p *Plan) Empty() bool { - return len(p.Resources) == 0 -} - -// DiffActionSymbol returns a string that, once passed through a -// colorstring.Colorize, will produce a result that can be written -// to a terminal to produce a symbol made of three printable -// characters, possibly interspersed with VT100 color codes. -func DiffActionSymbol(action plans.Action) string { - switch action { - case plans.DeleteThenCreate: - return "[red]-[reset]/[green]+[reset]" - case plans.CreateThenDelete: - return "[green]+[reset]/[red]-[reset]" - case plans.Create: - return " [green]+[reset]" - case plans.Delete: - return " [red]-[reset]" - case plans.Read: - return " [cyan]<=[reset]" - case plans.Update: - return " [yellow]~[reset]" - default: - return " ?" - } -} - -// formatPlanInstanceDiff writes the text representation of the given instance diff -// to the given buffer, using the given colorizer. -func formatPlanInstanceDiff(buf *bytes.Buffer, r *InstanceDiff, keyLen int, colorizer *colorstring.Colorize) { - addrStr := r.Addr.String() - - // Determine the color for the text (green for adding, yellow - // for change, red for delete), and symbol, and output the - // resource header. - color := "yellow" - symbol := DiffActionSymbol(r.Action) - oldValues := true - switch r.Action { - case plans.DeleteThenCreate, plans.CreateThenDelete: - color = "yellow" - case plans.Create: - color = "green" - oldValues = false - case plans.Delete: - color = "red" - case plans.Read: - color = "cyan" - oldValues = false - } - - var extraStr string - if r.Tainted { - extraStr = extraStr + " (tainted)" - } - if r.Deposed { - extraStr = extraStr + " (deposed)" - } - if r.Action.IsReplace() { - extraStr = extraStr + colorizer.Color(" [red][bold](new resource required)") - } - - buf.WriteString( - colorizer.Color(fmt.Sprintf( - "[%s]%s [%s]%s%s\n", - color, symbol, color, addrStr, extraStr, - )), - ) - - for _, attr := range r.Attributes { - - v := attr.NewValue - var dispV string - switch { - case v == "" && attr.NewComputed: - dispV = "" - case attr.Sensitive: - dispV = "" - default: - dispV = fmt.Sprintf("%q", v) - } - - updateMsg := "" - switch { - case attr.ForcesNew && r.Action.IsReplace(): - updateMsg = colorizer.Color(" [red](forces new resource)") - case attr.Sensitive && oldValues: - updateMsg = colorizer.Color(" [yellow](attribute changed)") - } - - if oldValues { - u := attr.OldValue - var dispU string - switch { - case attr.Sensitive: - dispU = "" - default: - dispU = fmt.Sprintf("%q", u) - } - buf.WriteString(fmt.Sprintf( - " %s:%s %s => %s%s\n", - attr.Path, - strings.Repeat(" ", keyLen-len(attr.Path)), - dispU, dispV, - updateMsg, - )) - } else { - buf.WriteString(fmt.Sprintf( - " %s:%s %s%s\n", - attr.Path, - strings.Repeat(" ", keyLen-len(attr.Path)), - dispV, - updateMsg, - )) - } - } - - // Write the reset color so we don't bleed color into later text - buf.WriteString(colorizer.Color("[reset]\n")) -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/backend.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/backend.go index 6c7848d23..76d161d72 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/backend.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/backend.go @@ -1,10 +1,7 @@ package configs import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcldec" - "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" - "github.com/zclconf/go-cty/cty" + "github.com/hashicorp/hcl/v2" ) // Backend represents a "backend" block inside a "terraform" block in a module @@ -25,31 +22,3 @@ func decodeBackendBlock(block *hcl.Block) (*Backend, hcl.Diagnostics) { DeclRange: block.DefRange, }, nil } - -// Hash produces a hash value for the reciever that covers the type and the -// portions of the config that conform to the given schema. -// -// If the config does not conform to the schema then the result is not -// meaningful for comparison since it will be based on an incomplete result. -// -// As an exception, required attributes in the schema are treated as optional -// for the purpose of hashing, so that an incomplete configuration can still -// be hashed. Other errors, such as extraneous attributes, have no such special -// case. -func (b *Backend) Hash(schema *configschema.Block) int { - // Don't fail if required attributes are not set. Instead, we'll just - // hash them as nulls. - schema = schema.NoneRequired() - spec := schema.DecoderSpec() - val, _ := hcldec.Decode(b.Config, spec, nil) - if val == cty.NilVal { - val = cty.UnknownVal(schema.ImpliedType()) - } - - toHash := cty.TupleVal([]cty.Value{ - cty.StringVal(b.Type), - val, - }) - - return toHash.Hash() -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/compat_shim.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/compat_shim.go index 66037fcdc..e594ebd40 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/compat_shim.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/compat_shim.go @@ -1,8 +1,8 @@ package configs import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/config.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/config.go index c90b51a11..82c88a10f 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/config.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/config.go @@ -4,7 +4,7 @@ import ( "sort" version "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" ) @@ -86,18 +86,6 @@ func NewEmptyConfig() *Config { return ret } -// Depth returns the number of "hops" the receiver is from the root of its -// module tree, with the root module having a depth of zero. -func (c *Config) Depth() int { - ret := 0 - this := c - for this.Parent != nil { - ret++ - this = this.Parent - } - return ret -} - // DeepEach calls the given function once for each module in the tree, starting // with the receiver. // @@ -116,35 +104,6 @@ func (c *Config) DeepEach(cb func(c *Config)) { } } -// AllModules returns a slice of all the receiver and all of its descendent -// nodes in the module tree, in the same order they would be visited by -// DeepEach. -func (c *Config) AllModules() []*Config { - var ret []*Config - c.DeepEach(func(c *Config) { - ret = append(ret, c) - }) - return ret -} - -// Descendent returns the descendent config that has the given path beneath -// the receiver, or nil if there is no such module. -// -// The path traverses the static module tree, prior to any expansion to handle -// count and for_each arguments. -// -// An empty path will just return the receiver, and is therefore pointless. -func (c *Config) Descendent(path addrs.Module) *Config { - current := c - for _, name := range path { - current = current.Children[name] - if current == nil { - return nil - } - } - return current -} - // DescendentForInstance is like Descendent except that it accepts a path // to a particular module instance in the dynamic module graph, returning // the node from the static module graph that corresponds to it. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/config_build.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/config_build.go index f1129bc19..cb46b65aa 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/config_build.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/config_build.go @@ -4,7 +4,7 @@ import ( "sort" version "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" ) @@ -158,23 +158,3 @@ type ModuleRequest struct { // rather than to either its source address or its version number. CallRange hcl.Range } - -// DisabledModuleWalker is a ModuleWalker that doesn't support -// child modules at all, and so will return an error if asked to load one. -// -// This is provided primarily for testing. There is no good reason to use this -// in the main application. -var DisabledModuleWalker ModuleWalker - -func init() { - DisabledModuleWalker = ModuleWalkerFunc(func(req *ModuleRequest) (*Module, *version.Version, hcl.Diagnostics) { - return nil, nil, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Child modules are not supported", - Detail: "Child module calls are not allowed in this context.", - Subject: &req.CallRange, - }, - } - }) -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader.go index 302b6b5d7..0d12d7d2a 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader.go @@ -2,11 +2,10 @@ package configload import ( "fmt" - "path/filepath" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" "github.com/hashicorp/terraform-plugin-sdk/internal/registry" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco" + "github.com/hashicorp/terraform-svchost/disco" "github.com/spf13/afero" ) @@ -95,56 +94,8 @@ func (l *Loader) RefreshModules() error { return l.modules.readModuleManifestSnapshot() } -// Parser returns the underlying parser for this loader. -// -// This is useful for loading other sorts of files than the module directories -// that a loader deals with, since then they will share the source code cache -// for this loader and can thus be shown as snippets in diagnostic messages. -func (l *Loader) Parser() *configs.Parser { - return l.parser -} - // Sources returns the source code cache for the underlying parser of this // loader. This is a shorthand for l.Parser().Sources(). func (l *Loader) Sources() map[string][]byte { return l.parser.Sources() } - -// IsConfigDir returns true if and only if the given directory contains at -// least one Terraform configuration file. This is a wrapper around calling -// the same method name on the loader's parser. -func (l *Loader) IsConfigDir(path string) bool { - return l.parser.IsConfigDir(path) -} - -// ImportSources writes into the receiver's source code the given source -// code buffers. -// -// This is useful in the situation where an ancillary loader is created for -// some reason (e.g. loading config from a plan file) but the cached source -// code from that loader must be imported into the "main" loader in order -// to return source code snapshots in diagnostic messages. -// -// loader.ImportSources(otherLoader.Sources()) -func (l *Loader) ImportSources(sources map[string][]byte) { - p := l.Parser() - for name, src := range sources { - p.ForceFileSource(name, src) - } -} - -// ImportSourcesFromSnapshot writes into the receiver's source code the -// source files from the given snapshot. -// -// This is similar to ImportSources but knows how to unpack and flatten a -// snapshot data structure to get the corresponding flat source file map. -func (l *Loader) ImportSourcesFromSnapshot(snap *Snapshot) { - p := l.Parser() - for _, m := range snap.Modules { - baseDir := m.Dir - for fn, src := range m.Files { - fullPath := filepath.Join(baseDir, fn) - p.ForceFileSource(fullPath, src) - } - } -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader_load.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader_load.go index 64219bb77..bcfa733e6 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader_load.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader_load.go @@ -4,7 +4,7 @@ import ( "fmt" version "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader_snapshot.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader_snapshot.go index 0eb2c376d..0772edc71 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader_snapshot.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/loader_snapshot.go @@ -9,7 +9,7 @@ import ( "time" version "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" "github.com/hashicorp/terraform-plugin-sdk/internal/modsdir" "github.com/spf13/afero" @@ -77,18 +77,6 @@ type Snapshot struct { Modules map[string]*SnapshotModule } -// NewEmptySnapshot constructs and returns a snapshot containing only an empty -// root module. This is not useful for anything except placeholders in tests. -func NewEmptySnapshot() *Snapshot { - return &Snapshot{ - Modules: map[string]*SnapshotModule{ - "": &SnapshotModule{ - Files: map[string][]byte{}, - }, - }, - } -} - // SnapshotModule represents a single module within a Snapshot. type SnapshotModule struct { // Dir is the path, relative to the root directory given when the diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/module_mgr.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/module_mgr.go index 170320266..797f50d24 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/module_mgr.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload/module_mgr.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/internal/modsdir" "github.com/hashicorp/terraform-plugin-sdk/internal/registry" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco" + "github.com/hashicorp/terraform-svchost/disco" "github.com/spf13/afero" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/decoder_spec.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/decoder_spec.go index c4bc3be03..2c21ca5e5 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/decoder_spec.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/decoder_spec.go @@ -1,7 +1,7 @@ package configschema import ( - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2/hcldec" ) var mapLabelNames = []string{"key"} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/implied_type.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/implied_type.go index c0ee8419d..51f51cebc 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/implied_type.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/implied_type.go @@ -1,7 +1,7 @@ package configschema import ( - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) @@ -19,24 +19,3 @@ func (b *Block) ImpliedType() cty.Type { return hcldec.ImpliedType(b.DecoderSpec()) } - -// ContainsSensitive returns true if any of the attributes of the receiving -// block or any of its descendent blocks are marked as sensitive. -// -// Blocks themselves cannot be sensitive as a whole -- sensitivity is a -// per-attribute idea -- but sometimes we want to include a whole object -// decoded from a block in some UI output, and that is safe to do only if -// none of the contained attributes are sensitive. -func (b *Block) ContainsSensitive() bool { - for _, attrS := range b.Attributes { - if attrS.Sensitive { - return true - } - } - for _, blockS := range b.BlockTypes { - if blockS.ContainsSensitive() { - return true - } - } - return false -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/schema.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/schema.go index f4702d369..b41a30968 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/schema.go @@ -4,6 +4,17 @@ import ( "github.com/zclconf/go-cty/cty" ) +// StringKind represents the format a string is in. +type StringKind int + +const ( + // StringPlain indicates a string is plain-text and requires no processing for display. + StringPlain StringKind = iota + // StringMarkdown indicates a string is in markdown format and may + // require additional processing to display. + StringMarkdown +) + // Block represents a configuration block. // // "Block" here is a logical grouping construct, though it happens to map @@ -21,6 +32,15 @@ type Block struct { // BlockTypes describes any nested block types that may appear directly // inside the block. BlockTypes map[string]*NestedBlock + + // Description and DescriptionKind contain a user facing description of the block + // and the format of that string. + Description string + DescriptionKind StringKind + + // Deprecated indicates whether the block has been marked as deprecated in the + // provider and usage should be discouraged. + Deprecated bool } // Attribute represents a configuration attribute, within a block. @@ -32,7 +52,8 @@ type Attribute struct { // usage of the attribute. A description should be concise and use only // one or two sentences, leaving full definition to longer-form // documentation defined elsewhere. - Description string + Description string + DescriptionKind StringKind // Required, if set to true, specifies that an omitted or null value is // not permitted. @@ -55,6 +76,10 @@ type Attribute struct { // future to help Terraform mask sensitive information. (Terraform // currently achieves this in a limited sense via other mechanisms.) Sensitive bool + + // Deprecated indicates whether the attribute has been marked as deprecated in the + // provider and usage should be discouraged. + Deprecated bool } // NestedBlock represents the embedding of one block within another. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/validate_traversal.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/validate_traversal.go index 2873830c2..446705baf 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/validate_traversal.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/validate_traversal.go @@ -4,8 +4,8 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/internal/helper/didyoumean" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/depends_on.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/depends_on.go index b1984768f..036c2d6c3 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/depends_on.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/depends_on.go @@ -1,7 +1,7 @@ package configs import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) func decodeDependsOn(attr *hcl.Attribute) ([]hcl.Traversal, hcl.Diagnostics) { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim/single_attr_body.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim/single_attr_body.go index 19651c81c..68f48da8f 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim/single_attr_body.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim/single_attr_body.go @@ -3,7 +3,7 @@ package hcl2shim import ( "fmt" - hcl2 "github.com/hashicorp/hcl2/hcl" + hcl2 "github.com/hashicorp/hcl/v2" ) // SingleAttrBody is a weird implementation of hcl2.Body that acts as if diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim/values.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim/values.go index c0c816418..a074c749d 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim/values.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/hcl2shim/values.go @@ -4,7 +4,6 @@ import ( "fmt" "math/big" - "github.com/hashicorp/hil/ast" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" @@ -229,125 +228,3 @@ func HCL2ValueFromConfigValue(v interface{}) cty.Value { panic(fmt.Errorf("can't convert %#v to cty.Value", v)) } } - -func HILVariableFromHCL2Value(v cty.Value) ast.Variable { - if v.IsNull() { - // Caller should guarantee/check this before calling - panic("Null values cannot be represented in HIL") - } - if !v.IsKnown() { - return ast.Variable{ - Type: ast.TypeUnknown, - Value: UnknownVariableValue, - } - } - - switch v.Type() { - case cty.Bool: - return ast.Variable{ - Type: ast.TypeBool, - Value: v.True(), - } - case cty.Number: - v := ConfigValueFromHCL2(v) - switch tv := v.(type) { - case int: - return ast.Variable{ - Type: ast.TypeInt, - Value: tv, - } - case float64: - return ast.Variable{ - Type: ast.TypeFloat, - Value: tv, - } - default: - // should never happen - panic("invalid return value for configValueFromHCL2") - } - case cty.String: - return ast.Variable{ - Type: ast.TypeString, - Value: v.AsString(), - } - } - - if v.Type().IsListType() || v.Type().IsSetType() || v.Type().IsTupleType() { - l := make([]ast.Variable, 0, v.LengthInt()) - it := v.ElementIterator() - for it.Next() { - _, ev := it.Element() - l = append(l, HILVariableFromHCL2Value(ev)) - } - // If we were given a tuple then this could actually produce an invalid - // list with non-homogenous types, which we expect to be caught inside - // HIL just like a user-supplied non-homogenous list would be. - return ast.Variable{ - Type: ast.TypeList, - Value: l, - } - } - - if v.Type().IsMapType() || v.Type().IsObjectType() { - l := make(map[string]ast.Variable) - it := v.ElementIterator() - for it.Next() { - ek, ev := it.Element() - l[ek.AsString()] = HILVariableFromHCL2Value(ev) - } - // If we were given an object then this could actually produce an invalid - // map with non-homogenous types, which we expect to be caught inside - // HIL just like a user-supplied non-homogenous map would be. - return ast.Variable{ - Type: ast.TypeMap, - Value: l, - } - } - - // If we fall out here then we have some weird type that we haven't - // accounted for. This should never happen unless the caller is using - // capsule types, and we don't currently have any such types defined. - panic(fmt.Errorf("can't convert %#v to HIL variable", v)) -} - -func HCL2ValueFromHILVariable(v ast.Variable) cty.Value { - switch v.Type { - case ast.TypeList: - vals := make([]cty.Value, len(v.Value.([]ast.Variable))) - for i, ev := range v.Value.([]ast.Variable) { - vals[i] = HCL2ValueFromHILVariable(ev) - } - return cty.TupleVal(vals) - case ast.TypeMap: - vals := make(map[string]cty.Value, len(v.Value.(map[string]ast.Variable))) - for k, ev := range v.Value.(map[string]ast.Variable) { - vals[k] = HCL2ValueFromHILVariable(ev) - } - return cty.ObjectVal(vals) - default: - return HCL2ValueFromConfigValue(v.Value) - } -} - -func HCL2TypeForHILType(hilType ast.Type) cty.Type { - switch hilType { - case ast.TypeAny: - return cty.DynamicPseudoType - case ast.TypeUnknown: - return cty.DynamicPseudoType - case ast.TypeBool: - return cty.Bool - case ast.TypeInt: - return cty.Number - case ast.TypeFloat: - return cty.Number - case ast.TypeString: - return cty.String - case ast.TypeList: - return cty.List(cty.DynamicPseudoType) - case ast.TypeMap: - return cty.Map(cty.DynamicPseudoType) - default: - return cty.NilType // equilvalent to ast.TypeInvalid - } -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module.go index d45ed8a9c..78223c3b8 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module.go @@ -3,7 +3,7 @@ package configs import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_call.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_call.go index 8c3ba67ce..a484ffef9 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_call.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_call.go @@ -3,9 +3,9 @@ package configs import ( "fmt" - "github.com/hashicorp/hcl2/gohcl" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/gohcl" + "github.com/hashicorp/hcl/v2/hclsyntax" ) // ModuleCall represents a "module" block in a module or file. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_merge.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_merge.go index 12916ef8c..6fb82acfb 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_merge.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_merge.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_merge_body.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_merge_body.go index 0ed561eee..7b51eae85 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_merge_body.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/module_merge_body.go @@ -1,7 +1,7 @@ package configs import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // MergeBodies creates a new HCL body that contains a combination of the diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/named_values.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/named_values.go index 66468c3bd..8c8398e0b 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/named_values.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/named_values.go @@ -3,14 +3,12 @@ package configs import ( "fmt" - "github.com/hashicorp/hcl2/ext/typeexpr" - "github.com/hashicorp/hcl2/gohcl" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/ext/typeexpr" + "github.com/hashicorp/hcl/v2/gohcl" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" - - "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" ) // A consistent detail message for all "not a valid identifier" diagnostics. @@ -323,14 +321,6 @@ func decodeLocalsBlock(block *hcl.Block) ([]*Local, hcl.Diagnostics) { return locals, diags } -// Addr returns the address of the local value declared by the receiver, -// relative to its containing module. -func (l *Local) Addr() addrs.LocalValue { - return addrs.LocalValue{ - Name: l.Name, - } -} - var variableBlockSchema = &hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser.go index 8176fa1b7..2a621b577 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hclparse" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclparse" "github.com/spf13/afero" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_config.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_config.go index 7f2ff2714..d4cbc945c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_config.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_config.go @@ -1,7 +1,7 @@ package configs import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // LoadConfigFile reads the file at the given path and parses it as a config diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_config_dir.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_config_dir.go index 752d6d9ca..afdd69833 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_config_dir.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_config_dir.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // LoadConfigDir reads the .tf and .tf.json files in the given directory diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_values.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_values.go index b7f1c1c5d..10d98e5b0 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_values.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/parser_values.go @@ -1,7 +1,7 @@ package configs import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/provider.go index 99f0f26de..cb9ba1f3f 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/provider.go @@ -3,9 +3,9 @@ package configs import ( "fmt" - "github.com/hashicorp/hcl2/gohcl" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/gohcl" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/provisioner.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/provisioner.go index 311f107f8..47b656791 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/provisioner.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/provisioner.go @@ -3,7 +3,7 @@ package configs import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Provisioner represents a "provisioner" block when used within a diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/resource.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/resource.go index 22657fad0..cd9991a38 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/resource.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/resource.go @@ -3,9 +3,9 @@ package configs import ( "fmt" - "github.com/hashicorp/hcl2/gohcl" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/gohcl" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/synth_body.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/synth_body.go index 3ae1bff6a..cd914e5db 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/synth_body.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/synth_body.go @@ -3,8 +3,8 @@ package configs import ( "fmt" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/util.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/util.go index 5fbde4310..e135546fb 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/util.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/util.go @@ -1,8 +1,8 @@ package configs import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" ) // exprIsNativeQuotedString determines whether the given expression looks like diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/version_constraint.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/version_constraint.go index e40ce1639..0f541dc71 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/version_constraint.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/version_constraint.go @@ -4,7 +4,7 @@ import ( "fmt" version "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/dag/dot.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/dag/dot.go index 7e6d2af3b..65a351b6f 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/dag/dot.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/dag/dot.go @@ -276,7 +276,3 @@ func (w *indentWriter) WriteByte(b byte) error { w.indent() return w.Buffer.WriteByte(b) } -func (w *indentWriter) WriteRune(r rune) (int, error) { - w.indent() - return w.Buffer.WriteRune(r) -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/dag/marshal.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/dag/marshal.go index c567d2719..7b23ea9c1 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/dag/marshal.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/dag/marshal.go @@ -458,17 +458,3 @@ func newEdgeInfo(infoType string, e Edge, info string) *marshalEdgeInfo { Info: info, } } - -// JSON2Dot reads a Graph debug log from and io.Reader, and converts the final -// graph dot format. -// -// TODO: Allow returning the output at a certain point during decode. -// Encode extra information from the json log into the Dot. -func JSON2Dot(r io.Reader) ([]byte, error) { - g, err := decodeGraph(r) - if err != nil { - return nil, err - } - - return g.Dot(nil), nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig/config.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig/config.go index 98b159b47..b86bd7923 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig/config.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig/config.go @@ -1,15 +1,9 @@ package earlyconfig import ( - "fmt" - "sort" - version "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-config-inspect/tfconfig" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" - "github.com/hashicorp/terraform-plugin-sdk/internal/moduledeps" - "github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery" - "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" ) // A Config is a node in the tree of modules within a configuration. @@ -67,57 +61,3 @@ type Config struct { // be nil. Version *version.Version } - -// ProviderDependencies returns the provider dependencies for the recieving -// config, including all of its descendent modules. -func (c *Config) ProviderDependencies() (*moduledeps.Module, tfdiags.Diagnostics) { - var diags tfdiags.Diagnostics - - var name string - if len(c.Path) > 0 { - name = c.Path[len(c.Path)-1] - } - - ret := &moduledeps.Module{ - Name: name, - } - - providers := make(moduledeps.Providers) - for name, reqs := range c.Module.RequiredProviders { - inst := moduledeps.ProviderInstance(name) - var constraints version.Constraints - for _, reqStr := range reqs { - if reqStr != "" { - constraint, err := version.NewConstraint(reqStr) - if err != nil { - diags = diags.Append(wrapDiagnostic(tfconfig.Diagnostic{ - Severity: tfconfig.DiagError, - Summary: "Invalid provider version constraint", - Detail: fmt.Sprintf("Invalid version constraint %q for provider %s.", reqStr, name), - })) - continue - } - constraints = append(constraints, constraint...) - } - } - providers[inst] = moduledeps.ProviderDependency{ - Constraints: discovery.NewConstraints(constraints), - Reason: moduledeps.ProviderDependencyExplicit, - } - } - ret.Providers = providers - - childNames := make([]string, 0, len(c.Children)) - for name := range c.Children { - childNames = append(childNames, name) - } - sort.Strings(childNames) - - for _, name := range childNames { - child, childDiags := c.Children[name].ProviderDependencies() - ret.Children = append(ret.Children, child) - diags = diags.Append(childDiags) - } - - return ret, diags -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/flatmap/map.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/flatmap/map.go index 46b72c401..435e04a39 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/flatmap/map.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/flatmap/map.go @@ -25,7 +25,7 @@ func (m Map) Contains(key string) bool { // Delete deletes a key out of the map with the given prefix. func (m Map) Delete(prefix string) { - for k, _ := range m { + for k := range m { match := k == prefix if !match { if !strings.HasPrefix(k, prefix) { @@ -44,7 +44,7 @@ func (m Map) Delete(prefix string) { // Keys returns all of the top-level keys in this map func (m Map) Keys() []string { ks := make(map[string]struct{}) - for k, _ := range m { + for k := range m { idx := strings.Index(k, ".") if idx == -1 { idx = len(k) @@ -54,7 +54,7 @@ func (m Map) Keys() []string { } result := make([]string, 0, len(ks)) - for k, _ := range ks { + for k := range ks { result = append(result, k) } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/config/decode.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/config/decode.go deleted file mode 100644 index f470c9b4b..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/config/decode.go +++ /dev/null @@ -1,28 +0,0 @@ -package config - -import ( - "github.com/mitchellh/mapstructure" -) - -func Decode(target interface{}, raws ...interface{}) (*mapstructure.Metadata, error) { - var md mapstructure.Metadata - decoderConfig := &mapstructure.DecoderConfig{ - Metadata: &md, - Result: target, - WeaklyTypedInput: true, - } - - decoder, err := mapstructure.NewDecoder(decoderConfig) - if err != nil { - return nil, err - } - - for _, raw := range raws { - err := decoder.Decode(raw) - if err != nil { - return nil, err - } - } - - return &md, nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/config/validator.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/config/validator.go index 35a3e7a49..be5db8b98 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/config/validator.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/config/validator.go @@ -76,7 +76,7 @@ func (v *Validator) Validate( } // The rest are unknown - for k, _ := range flat { + for k := range flat { es = append(es, fmt.Errorf("Unknown configuration: %s", k)) } @@ -116,7 +116,7 @@ type basicValidatorKey struct { func (v *basicValidatorKey) Validate( m map[string]string) ([]string, []string, []error) { - for k, _ := range m { + for k := range m { // If we have the exact key its a match if k == v.Key { return []string{k}, nil, nil @@ -188,7 +188,7 @@ func (v *nestedValidatorKey) validate( u = append(u, prefix) // Mark all prefixes of this - for k, _ := range m { + for k := range m { if !strings.HasPrefix(k, prefix+".") { continue } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/load_config.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/load_config.go deleted file mode 100644 index 02c3c6f70..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/load_config.go +++ /dev/null @@ -1,56 +0,0 @@ -package initwd - -import ( - "fmt" - - version "github.com/hashicorp/go-version" - "github.com/hashicorp/terraform-config-inspect/tfconfig" - "github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig" - "github.com/hashicorp/terraform-plugin-sdk/internal/modsdir" - "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" -) - -// LoadConfig loads a full configuration tree that has previously had all of -// its dependent modules installed to the given modulesDir using a -// ModuleInstaller. -// -// This uses the early configuration loader and thus only reads top-level -// metadata from the modules in the configuration. Most callers should use -// the configs/configload package to fully load a configuration. -func LoadConfig(rootDir, modulesDir string) (*earlyconfig.Config, tfdiags.Diagnostics) { - rootMod, diags := earlyconfig.LoadModule(rootDir) - if rootMod == nil { - return nil, diags - } - - manifest, err := modsdir.ReadManifestSnapshotForDir(modulesDir) - if err != nil { - diags = diags.Append(tfdiags.Sourceless( - tfdiags.Error, - "Failed to read module manifest", - fmt.Sprintf("Terraform failed to read its manifest of locally-cached modules: %s.", err), - )) - return nil, diags - } - - return earlyconfig.BuildConfig(rootMod, earlyconfig.ModuleWalkerFunc( - func(req *earlyconfig.ModuleRequest) (*tfconfig.Module, *version.Version, tfdiags.Diagnostics) { - var diags tfdiags.Diagnostics - - key := manifest.ModuleKey(req.Path) - record, exists := manifest[key] - if !exists { - diags = diags.Append(tfdiags.Sourceless( - tfdiags.Error, - "Module not installed", - fmt.Sprintf("Module %s is not yet installed. Run \"terraform init\" to install all modules required by this configuration.", req.Path.String()), - )) - return nil, nil, diags - } - - mod, mDiags := earlyconfig.LoadModule(record.Dir) - diags = diags.Append(mDiags) - return mod, record.Version, diags - }, - )) -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/testing.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/testing.go deleted file mode 100644 index c4c67fd18..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/testing.go +++ /dev/null @@ -1,73 +0,0 @@ -package initwd - -import ( - "github.com/hashicorp/terraform-plugin-sdk/internal/registry" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/internal/configs" - "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload" - "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" -) - -// LoadConfigForTests is a convenience wrapper around configload.NewLoaderForTests, -// ModuleInstaller.InstallModules and configload.Loader.LoadConfig that allows -// a test configuration to be loaded in a single step. -// -// If module installation fails, t.Fatal (or similar) is called to halt -// execution of the test, under the assumption that installation failures are -// not expected. If installation failures _are_ expected then use -// NewLoaderForTests and work with the loader object directly. If module -// installation succeeds but generates warnings, these warnings are discarded. -// -// If installation succeeds but errors are detected during loading then a -// possibly-incomplete config is returned along with error diagnostics. The -// test run is not aborted in this case, so that the caller can make assertions -// against the returned diagnostics. -// -// As with NewLoaderForTests, a cleanup function is returned which must be -// called before the test completes in order to remove the temporary -// modules directory. -func LoadConfigForTests(t *testing.T, rootDir string) (*configs.Config, *configload.Loader, func(), tfdiags.Diagnostics) { - t.Helper() - - var diags tfdiags.Diagnostics - - loader, cleanup := configload.NewLoaderForTests(t) - inst := NewModuleInstaller(loader.ModulesDir(), registry.NewClient(nil, nil)) - - _, moreDiags := inst.InstallModules(rootDir, true, ModuleInstallHooksImpl{}) - diags = diags.Append(moreDiags) - if diags.HasErrors() { - cleanup() - t.Fatal(diags.Err()) - return nil, nil, func() {}, diags - } - - // Since module installer has modified the module manifest on disk, we need - // to refresh the cache of it in the loader. - if err := loader.RefreshModules(); err != nil { - t.Fatalf("failed to refresh modules after installation: %s", err) - } - - config, hclDiags := loader.LoadConfig(rootDir) - diags = diags.Append(hclDiags) - return config, loader, cleanup, diags -} - -// MustLoadConfigForTests is a variant of LoadConfigForTests which calls -// t.Fatal (or similar) if there are any errors during loading, and thus -// does not return diagnostics at all. -// -// This is useful for concisely writing tests that don't expect errors at -// all. For tests that expect errors and need to assert against them, use -// LoadConfigForTests instead. -func MustLoadConfigForTests(t *testing.T, rootDir string) (*configs.Config, *configload.Loader, func()) { - t.Helper() - - config, loader, cleanup, diags := LoadConfigForTests(t, rootDir) - if diags.HasErrors() { - cleanup() - t.Fatal(diags.Err()) - } - return config, loader, cleanup -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/version_required.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/version_required.go deleted file mode 100644 index 803fb4b52..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/initwd/version_required.go +++ /dev/null @@ -1,83 +0,0 @@ -package initwd - -import ( - "fmt" - - version "github.com/hashicorp/go-version" - "github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig" - "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" - tfversion "github.com/hashicorp/terraform-plugin-sdk/internal/version" -) - -// CheckCoreVersionRequirements visits each of the modules in the given -// early configuration tree and verifies that any given Core version constraints -// match with the version of Terraform Core that is being used. -// -// The returned diagnostics will contain errors if any constraints do not match. -// The returned diagnostics might also return warnings, which should be -// displayed to the user. -func CheckCoreVersionRequirements(earlyConfig *earlyconfig.Config) tfdiags.Diagnostics { - if earlyConfig == nil { - return nil - } - - var diags tfdiags.Diagnostics - module := earlyConfig.Module - - var constraints version.Constraints - for _, constraintStr := range module.RequiredCore { - constraint, err := version.NewConstraint(constraintStr) - if err != nil { - // Unfortunately the early config parser doesn't preserve a source - // location for this, so we're unable to indicate a specific - // location where this constraint came from, but we can at least - // say which module set it. - switch { - case len(earlyConfig.Path) == 0: - diags = diags.Append(tfdiags.Sourceless( - tfdiags.Error, - "Invalid provider version constraint", - fmt.Sprintf("Invalid version core constraint %q in the root module.", constraintStr), - )) - default: - diags = diags.Append(tfdiags.Sourceless( - tfdiags.Error, - "Invalid provider version constraint", - fmt.Sprintf("Invalid version core constraint %q in %s.", constraintStr, earlyConfig.Path), - )) - } - continue - } - constraints = append(constraints, constraint...) - } - - if !constraints.Check(tfversion.SemVer) { - switch { - case len(earlyConfig.Path) == 0: - diags = diags.Append(tfdiags.Sourceless( - tfdiags.Error, - "Unsupported Terraform Core version", - fmt.Sprintf( - "This configuration does not support Terraform version %s. To proceed, either choose another supported Terraform version or update the root module's version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.", - tfversion.String(), - ), - )) - default: - diags = diags.Append(tfdiags.Sourceless( - tfdiags.Error, - "Unsupported Terraform Core version", - fmt.Sprintf( - "Module %s (from %q) does not support Terraform version %s. To proceed, either choose another supported Terraform version or update the module's version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.", - earlyConfig.Path, earlyConfig.SourceAddr, tfversion.String(), - ), - )) - } - } - - for _, c := range earlyConfig.Children { - childDiags := CheckCoreVersionRequirements(c) - diags = diags.Append(childDiags) - } - - return diags -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/fixup.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/fixup.go index 18db20185..f782f6b75 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/fixup.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/fixup.go @@ -1,8 +1,8 @@ package blocktoattr import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/schema.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/schema.go index d6048cf13..129ee0e82 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/schema.go @@ -1,7 +1,7 @@ package blocktoattr import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/zclconf/go-cty/cty" ) @@ -117,30 +117,3 @@ func SchemaForCtyElementType(ty cty.Type) *configschema.Block { } return ret } - -// SchemaForCtyContainerType converts a cty list-of-object or set-of-object type -// into an approximately-equivalent configschema.NestedBlock. If the given type -// is not of the expected kind then this function will panic. -func SchemaForCtyContainerType(ty cty.Type) *configschema.NestedBlock { - var nesting configschema.NestingMode - switch { - case ty.IsListType(): - nesting = configschema.NestingList - case ty.IsSetType(): - nesting = configschema.NestingSet - default: - panic("unsuitable type") - } - nested := SchemaForCtyElementType(ty.ElementType()) - return &configschema.NestedBlock{ - Nesting: nesting, - Block: *nested, - } -} - -// TypeCanBeBlocks returns true if the given type is a list-of-object or -// set-of-object type, and would thus be subject to the blocktoattr fixup -// if used as an attribute type. -func TypeCanBeBlocks(ty cty.Type) bool { - return (ty.IsListType() || ty.IsSetType()) && ty.ElementType().IsObjectType() -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/variables.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/variables.go index 065139b9a..f5ed1c539 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/variables.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr/variables.go @@ -1,9 +1,9 @@ package blocktoattr import ( - "github.com/hashicorp/hcl2/ext/dynblock" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/ext/dynblock" + "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/data.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/data.go index f7d0246ff..13f7ed935 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/data.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/data.go @@ -24,7 +24,7 @@ type Data interface { GetCountAttr(addrs.CountAttr, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) GetForEachAttr(addrs.ForEachAttr, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) - GetResourceInstance(addrs.ResourceInstance, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) + GetResource(addrs.Resource, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) GetLocalValue(addrs.LocalValue, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) GetModuleInstance(addrs.ModuleCallInstance, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) GetModuleInstanceOutput(addrs.ModuleCallOutput, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/eval.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/eval.go index 28552bb50..ec48a873f 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/eval.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/eval.go @@ -5,9 +5,9 @@ import ( "log" "strconv" - "github.com/hashicorp/hcl2/ext/dynblock" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/ext/dynblock" + "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr" @@ -194,8 +194,8 @@ func (s *Scope) evalContext(refs []*addrs.Reference, selfAddr addrs.Referenceabl // it, since that allows us to gather a full set of any errors and // warnings, but once we've gathered all the data we'll then skip anything // that's redundant in the process of populating our values map. - dataResources := map[string]map[string]map[addrs.InstanceKey]cty.Value{} - managedResources := map[string]map[string]map[addrs.InstanceKey]cty.Value{} + dataResources := map[string]map[string]cty.Value{} + managedResources := map[string]map[string]cty.Value{} wholeModules := map[string]map[addrs.InstanceKey]cty.Value{} moduleOutputs := map[string]map[addrs.InstanceKey]map[string]cty.Value{} inputVariables := map[string]cty.Value{} @@ -208,7 +208,6 @@ func (s *Scope) evalContext(refs []*addrs.Reference, selfAddr addrs.Referenceabl for _, ref := range refs { rng := ref.SourceRange - isSelf := false rawSubj := ref.Subject if rawSubj == addrs.Self { @@ -226,45 +225,60 @@ func (s *Scope) evalContext(refs []*addrs.Reference, selfAddr addrs.Referenceabl continue } - // Treat "self" as an alias for the configured self address. - rawSubj = selfAddr - isSelf = true - - if rawSubj == addrs.Self { + if selfAddr == addrs.Self { // Programming error: the self address cannot alias itself. panic("scope SelfAddr attempting to alias itself") } + + // self can only be used within a resource instance + subj := selfAddr.(addrs.ResourceInstance) + + val, valDiags := normalizeRefValue(s.Data.GetResource(subj.ContainingResource(), rng)) + + diags = diags.Append(valDiags) + + // Self is an exception in that it must always resolve to a + // particular instance. We will still insert the full resource into + // the context below. + switch k := subj.Key.(type) { + case addrs.IntKey: + self = val.Index(cty.NumberIntVal(int64(k))) + case addrs.StringKey: + self = val.Index(cty.StringVal(string(k))) + default: + self = val + } + + continue } // This type switch must cover all of the "Referenceable" implementations - // in package addrs. - switch subj := rawSubj.(type) { + // in package addrs, however we are removing the possibility of + // ResourceInstance beforehand. + if addr, ok := rawSubj.(addrs.ResourceInstance); ok { + rawSubj = addr.ContainingResource() + } - case addrs.ResourceInstance: - var into map[string]map[string]map[addrs.InstanceKey]cty.Value - switch subj.Resource.Mode { + switch subj := rawSubj.(type) { + case addrs.Resource: + var into map[string]map[string]cty.Value + switch subj.Mode { case addrs.ManagedResourceMode: into = managedResources case addrs.DataResourceMode: into = dataResources default: - panic(fmt.Errorf("unsupported ResourceMode %s", subj.Resource.Mode)) + panic(fmt.Errorf("unsupported ResourceMode %s", subj.Mode)) } - val, valDiags := normalizeRefValue(s.Data.GetResourceInstance(subj, rng)) + val, valDiags := normalizeRefValue(s.Data.GetResource(subj, rng)) diags = diags.Append(valDiags) - r := subj.Resource + r := subj if into[r.Type] == nil { - into[r.Type] = make(map[string]map[addrs.InstanceKey]cty.Value) - } - if into[r.Type][r.Name] == nil { - into[r.Type][r.Name] = make(map[addrs.InstanceKey]cty.Value) - } - into[r.Type][r.Name][subj.Key] = val - if isSelf { - self = val + into[r.Type] = make(map[string]cty.Value) } + into[r.Type][r.Name] = val case addrs.ModuleCallInstance: val, valDiags := normalizeRefValue(s.Data.GetModuleInstance(subj, rng)) @@ -274,9 +288,6 @@ func (s *Scope) evalContext(refs []*addrs.Reference, selfAddr addrs.Referenceabl wholeModules[subj.Call.Name] = make(map[addrs.InstanceKey]cty.Value) } wholeModules[subj.Call.Name][subj.Key] = val - if isSelf { - self = val - } case addrs.ModuleCallOutput: val, valDiags := normalizeRefValue(s.Data.GetModuleInstanceOutput(subj, rng)) @@ -291,57 +302,36 @@ func (s *Scope) evalContext(refs []*addrs.Reference, selfAddr addrs.Referenceabl moduleOutputs[callName][callKey] = make(map[string]cty.Value) } moduleOutputs[callName][callKey][subj.Name] = val - if isSelf { - self = val - } case addrs.InputVariable: val, valDiags := normalizeRefValue(s.Data.GetInputVariable(subj, rng)) diags = diags.Append(valDiags) inputVariables[subj.Name] = val - if isSelf { - self = val - } case addrs.LocalValue: val, valDiags := normalizeRefValue(s.Data.GetLocalValue(subj, rng)) diags = diags.Append(valDiags) localValues[subj.Name] = val - if isSelf { - self = val - } case addrs.PathAttr: val, valDiags := normalizeRefValue(s.Data.GetPathAttr(subj, rng)) diags = diags.Append(valDiags) pathAttrs[subj.Name] = val - if isSelf { - self = val - } case addrs.TerraformAttr: val, valDiags := normalizeRefValue(s.Data.GetTerraformAttr(subj, rng)) diags = diags.Append(valDiags) terraformAttrs[subj.Name] = val - if isSelf { - self = val - } case addrs.CountAttr: val, valDiags := normalizeRefValue(s.Data.GetCountAttr(subj, rng)) diags = diags.Append(valDiags) countAttrs[subj.Name] = val - if isSelf { - self = val - } case addrs.ForEachAttr: val, valDiags := normalizeRefValue(s.Data.GetForEachAttr(subj, rng)) diags = diags.Append(valDiags) forEachAttrs[subj.Name] = val - if isSelf { - self = val - } default: // Should never happen @@ -367,13 +357,9 @@ func (s *Scope) evalContext(refs []*addrs.Reference, selfAddr addrs.Referenceabl return ctx, diags } -func buildResourceObjects(resources map[string]map[string]map[addrs.InstanceKey]cty.Value) map[string]cty.Value { +func buildResourceObjects(resources map[string]map[string]cty.Value) map[string]cty.Value { vals := make(map[string]cty.Value) - for typeName, names := range resources { - nameVals := make(map[string]cty.Value) - for name, keys := range names { - nameVals[name] = buildInstanceObjects(keys) - } + for typeName, nameVals := range resources { vals[typeName] = cty.ObjectVal(nameVals) } return vals diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/funcs/filesystem.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/funcs/filesystem.go index 016b102d9..786d3e74b 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/funcs/filesystem.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/funcs/filesystem.go @@ -8,8 +8,8 @@ import ( "path/filepath" "unicode/utf8" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" homedir "github.com/mitchellh/go-homedir" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/references.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/references.go index 8df09e9a8..7923d5113 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/references.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/lang/references.go @@ -1,7 +1,7 @@ package lang import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/moduledeps/module.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/moduledeps/module.go index 388a2ce1f..5189acfc1 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/moduledeps/module.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/moduledeps/module.go @@ -71,15 +71,6 @@ func (m *Module) SortChildren() { sort.Sort(sortModules{m.Children}) } -// SortDescendents is a convenience wrapper for calling SortChildren on -// the receiver and all of its descendent modules. -func (m *Module) SortDescendents() { - m.WalkTree(func(path []string, parent *Module, current *Module) error { - current.SortChildren() - return nil - }) -} - type sortModules struct { modules []*Module } @@ -141,64 +132,3 @@ func (m *Module) AllPluginRequirements() discovery.PluginRequirements { }) return ret } - -// Equal returns true if the receiver is the root of an identical tree -// to the other given Module. This is a deep comparison that considers -// the equality of all downstream modules too. -// -// The children are considered to be ordered, so callers may wish to use -// SortDescendents first to normalize the order of the slices of child nodes. -// -// The implementation of this function is not optimized since it is provided -// primarily for use in tests. -func (m *Module) Equal(other *Module) bool { - // take care of nils first - if m == nil && other == nil { - return true - } else if (m == nil && other != nil) || (m != nil && other == nil) { - return false - } - - if m.Name != other.Name { - return false - } - - if len(m.Providers) != len(other.Providers) { - return false - } - if len(m.Children) != len(other.Children) { - return false - } - - // Can't use reflect.DeepEqual on this provider structure because - // the nested Constraints objects contain function pointers that - // never compare as equal. So we'll need to walk it the long way. - for inst, dep := range m.Providers { - if _, exists := other.Providers[inst]; !exists { - return false - } - - if dep.Reason != other.Providers[inst].Reason { - return false - } - - // Constraints are not too easy to compare robustly, so - // we'll just use their string representations as a proxy - // for now. - if dep.Constraints.String() != other.Providers[inst].Constraints.String() { - return false - } - } - - // Above we already checked that we have the same number of children - // in each module, so now we just need to check that they are - // recursively equal. - for i := range m.Children { - if !m.Children[i].Equal(other.Children[i]) { - return false - } - } - - // If we fall out here then they are equal - return true -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plans/changes_state.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plans/changes_state.go deleted file mode 100644 index c4fd3b0f4..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plans/changes_state.go +++ /dev/null @@ -1,15 +0,0 @@ -package plans - -import ( - "github.com/hashicorp/terraform-plugin-sdk/internal/states" -) - -// PlannedState merges the set of changes described by the receiver into the -// given prior state to produce the planned result state. -// -// The result is an approximation of the state as it would exist after -// applying these changes, omitting any values that cannot be determined until -// the changes are actually applied. -func (c *Changes) PlannedState(prior *states.State) (*states.State, error) { - panic("Changes.PlannedState not yet implemented") -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/convert/schema.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/convert/schema.go index 105c32c6f..88b8a9a69 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/convert/schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/convert/schema.go @@ -2,6 +2,7 @@ package convert import ( "encoding/json" + "log" "reflect" "sort" @@ -13,17 +14,24 @@ import ( // ConfigSchemaToProto takes a *configschema.Block and converts it to a // proto.Schema_Block for a grpc response. func ConfigSchemaToProto(b *configschema.Block) *proto.Schema_Block { - block := &proto.Schema_Block{} + block := &proto.Schema_Block{ + Description: b.Description, + DescriptionKind: protoStringKind(b.DescriptionKind), + Deprecated: b.Deprecated, + } for _, name := range sortedKeys(b.Attributes) { a := b.Attributes[name] + attr := &proto.Schema_Attribute{ - Name: name, - Description: a.Description, - Optional: a.Optional, - Computed: a.Computed, - Required: a.Required, - Sensitive: a.Sensitive, + Name: name, + Description: a.Description, + DescriptionKind: protoStringKind(a.DescriptionKind), + Optional: a.Optional, + Computed: a.Computed, + Required: a.Required, + Sensitive: a.Sensitive, + Deprecated: a.Deprecated, } ty, err := json.Marshal(a.Type) @@ -44,6 +52,18 @@ func ConfigSchemaToProto(b *configschema.Block) *proto.Schema_Block { return block } +func protoStringKind(k configschema.StringKind) proto.StringKind { + switch k { + default: + log.Printf("[TRACE] unexpected configschema.StringKind: %d", k) + return proto.StringKind_PLAIN + case configschema.StringPlain: + return proto.StringKind_PLAIN + case configschema.StringMarkdown: + return proto.StringKind_MARKDOWN + } +} + func protoSchemaNestedBlock(name string, b *configschema.NestedBlock) *proto.Schema_NestedBlock { var nesting proto.Schema_NestedBlock_NestingMode switch b.Nesting { @@ -83,15 +103,21 @@ func ProtoToConfigSchema(b *proto.Schema_Block) *configschema.Block { block := &configschema.Block{ Attributes: make(map[string]*configschema.Attribute), BlockTypes: make(map[string]*configschema.NestedBlock), + + Description: b.Description, + DescriptionKind: schemaStringKind(b.DescriptionKind), + Deprecated: b.Deprecated, } for _, a := range b.Attributes { attr := &configschema.Attribute{ - Description: a.Description, - Required: a.Required, - Optional: a.Optional, - Computed: a.Computed, - Sensitive: a.Sensitive, + Description: a.Description, + DescriptionKind: schemaStringKind(a.DescriptionKind), + Required: a.Required, + Optional: a.Optional, + Computed: a.Computed, + Sensitive: a.Sensitive, + Deprecated: a.Deprecated, } if err := json.Unmarshal(a.Type, &attr.Type); err != nil { @@ -108,6 +134,18 @@ func ProtoToConfigSchema(b *proto.Schema_Block) *configschema.Block { return block } +func schemaStringKind(k proto.StringKind) configschema.StringKind { + switch k { + default: + log.Printf("[TRACE] unexpected proto.StringKind: %d", k) + return configschema.StringPlain + case proto.StringKind_PLAIN: + return configschema.StringPlain + case proto.StringKind_MARKDOWN: + return configschema.StringMarkdown + } +} + func schemaNestedBlock(b *proto.Schema_NestedBlock) *configschema.NestedBlock { var nesting configschema.NestingMode switch b.Nesting { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/get.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/get.go index ff90a266a..722bb28a2 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/get.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/get.go @@ -21,9 +21,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/internal/registry" "github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc" "github.com/hashicorp/terraform-plugin-sdk/internal/registry/response" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" tfversion "github.com/hashicorp/terraform-plugin-sdk/internal/version" + "github.com/hashicorp/terraform-svchost/disco" "github.com/mitchellh/cli" ) @@ -43,13 +43,6 @@ func init() { getter.Getters["https"] = httpGetter } -// An Installer maintains a local cache of plugins by downloading plugins -// from an online repository. -type Installer interface { - Get(provider addrs.ProviderType, req Constraints) (PluginMeta, tfdiags.Diagnostics, error) - PurgeUnused(used map[string]PluginMeta) (removed PluginMetaSet, err error) -} - // ProviderInstaller is an Installer implementation that knows how to // download Terraform providers from the official HashiCorp releases service // into a local directory. The files downloaded are compliant with the diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/requirements.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/requirements.go index 0466ab25a..75430fdd6 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/requirements.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/requirements.go @@ -4,12 +4,6 @@ import ( "bytes" ) -// PluginInstallProtocolVersion is the protocol version TF-core -// supports to communicate with servers, and is used to resolve -// plugin discovery with terraform registry, in addition to -// any specified plugin version constraints -const PluginInstallProtocolVersion = 5 - // PluginRequirements describes a set of plugins (assumed to be of a consistent // kind) that are required to exist and have versions within the given // corresponding sets. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/version_set.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/version_set.go index de02f5ec5..fc8b6f8bd 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/version_set.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/plugin/discovery/version_set.go @@ -81,9 +81,3 @@ func (s Constraints) Append(other Constraints) Constraints { func (s Constraints) String() string { return s.raw.String() } - -// Unconstrained returns true if and only if the receiver is an empty -// constraint set. -func (s Constraints) Unconstrained() bool { - return len(s.raw) == 0 -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/providers/resolver.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/providers/resolver.go index f5529ff32..b42e49202 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/providers/resolver.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/providers/resolver.go @@ -66,47 +66,3 @@ func FactoryFixed(p Interface) Factory { return p, nil } } - -// ProviderHasResource is a helper that requests schema from the given provider -// and checks if it has a resource type of the given name. -// -// This function is more expensive than it may first appear since it must -// retrieve the entire schema from the underlying provider, and so it should -// be used sparingly and especially not in tight loops. -// -// Since retrieving the provider may fail (e.g. if the provider is accessed -// over an RPC channel that has operational problems), this function will -// return false if the schema cannot be retrieved, under the assumption that -// a subsequent call to do anything with the resource type would fail -// anyway. -func ProviderHasResource(provider Interface, typeName string) bool { - resp := provider.GetSchema() - if resp.Diagnostics.HasErrors() { - return false - } - - _, exists := resp.ResourceTypes[typeName] - return exists -} - -// ProviderHasDataSource is a helper that requests schema from the given -// provider and checks if it has a data source of the given name. -// -// This function is more expensive than it may first appear since it must -// retrieve the entire schema from the underlying provider, and so it should -// be used sparingly and especially not in tight loops. -// -// Since retrieving the provider may fail (e.g. if the provider is accessed -// over an RPC channel that has operational problems), this function will -// return false if the schema cannot be retrieved, under the assumption that -// a subsequent call to do anything with the data source would fail -// anyway. -func ProviderHasDataSource(provider Interface, dataSourceName string) bool { - resp := provider.GetSchema() - if resp.Diagnostics.HasErrors() { - return false - } - - _, exists := resp.DataSources[dataSourceName] - return exists -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/provisioners/factory.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/provisioners/factory.go index 590b97a84..7a9dca0a0 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/provisioners/factory.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/provisioners/factory.go @@ -3,17 +3,3 @@ package provisioners // Factory is a function type that creates a new instance of a resource // provisioner, or returns an error if that is impossible. type Factory func() (Interface, error) - -// FactoryFixed is a helper that creates a Factory that just returns some given -// single provisioner. -// -// Unlike usual factories, the exact same instance is returned for each call -// to the factory and so this must be used in only specialized situations where -// the caller can take care to either not mutate the given provider at all -// or to mutate it in ways that will not cause unexpected behavior for others -// holding the same reference. -func FactoryFixed(p Interface) Factory { - return func() (Interface, error) { - return p, nil - } -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/client.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/client.go index 313951b38..4ef22052c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/client.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/client.go @@ -11,12 +11,13 @@ import ( "strings" "time" - "github.com/hashicorp/terraform-plugin-sdk/internal/httpclient" + "github.com/hashicorp/terraform-plugin-sdk/httpclient" + internalhttpclient "github.com/hashicorp/terraform-plugin-sdk/internal/httpclient" "github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc" "github.com/hashicorp/terraform-plugin-sdk/internal/registry/response" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco" "github.com/hashicorp/terraform-plugin-sdk/internal/version" + "github.com/hashicorp/terraform-svchost" + "github.com/hashicorp/terraform-svchost/disco" ) const ( @@ -46,12 +47,14 @@ func NewClient(services *disco.Disco, client *http.Client) *Client { } if client == nil { - client = httpclient.New() + client = internalhttpclient.New() client.Timeout = requestTimeout } services.Transport = client.Transport + services.SetUserAgent(httpclient.TerraformUserAgent(version.String())) + return &Client{ client: client, services: services, diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/errors.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/errors.go index 8b22ec142..b05438c4d 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/errors.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/errors.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco" + "github.com/hashicorp/terraform-svchost/disco" ) type errModuleNotFound struct { @@ -31,14 +31,6 @@ func (e *errProviderNotFound) Error() string { return fmt.Sprintf("provider %s not found", e.addr) } -// IsProviderNotFound returns true only if the given error is a "provider not found" -// error. This allows callers to recognize this particular error condition -// as distinct from operational errors such as poor network connectivity. -func IsProviderNotFound(err error) bool { - _, ok := err.(*errProviderNotFound) - return ok -} - // IsServiceNotProvided returns true only if the given error is a "service not provided" // error. This allows callers to recognize this particular error condition // as distinct from operational errors such as poor network connectivity. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/friendly_host.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/friendly_host.go index e67942a71..c9bc40bee 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/friendly_host.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/friendly_host.go @@ -4,7 +4,7 @@ import ( "regexp" "strings" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" + "github.com/hashicorp/terraform-svchost" ) var ( diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/module.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/module.go index 4c83afadb..eb37481ff 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/module.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/module.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" + svchost "github.com/hashicorp/terraform-svchost" ) var ( @@ -35,14 +35,6 @@ var ( fmt.Sprintf("^(%s)\\/(%s)\\/(%s)(?:\\/\\/(.*))?$", nameSubRe, nameSubRe, providerSubRe)) - // NameRe is a regular expression defining the format allowed for namespace - // or name fields in module registry implementations. - NameRe = regexp.MustCompile("^" + nameSubRe + "$") - - // ProviderRe is a regular expression defining the format allowed for - // provider fields in module registry implementations. - ProviderRe = regexp.MustCompile("^" + providerSubRe + "$") - // these hostnames are not allowed as registry sources, because they are // already special case module sources in terraform. disallowed = map[string]bool{ @@ -67,28 +59,6 @@ type Module struct { RawSubmodule string } -// NewModule construct a new module source from separate parts. Pass empty -// string if host or submodule are not needed. -func NewModule(host, namespace, name, provider, submodule string) (*Module, error) { - m := &Module{ - RawNamespace: namespace, - RawName: name, - RawProvider: provider, - RawSubmodule: submodule, - } - if host != "" { - h := NewFriendlyHost(host) - if h != nil { - fmt.Println("HOST:", h) - if !h.Valid() || disallowed[h.Display()] { - return nil, ErrInvalidModuleSource - } - } - m.RawHost = h - } - return m, nil -} - // ParseModuleSource attempts to parse source as a Terraform registry module // source. If the string is not found to be in a valid format, // ErrInvalidModuleSource is returned. Note that this can only be used on diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/terraform_provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/terraform_provider.go index 42ab3f77c..7205d03b8 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/terraform_provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc/terraform_provider.go @@ -5,7 +5,7 @@ import ( "runtime" "strings" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" + "github.com/hashicorp/terraform-svchost" ) var ( diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module.go index 3bd2b3df2..06163963e 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module.go @@ -1,52 +1,5 @@ package response -import ( - "time" -) - -// Module is the response structure with the data for a single module version. -type Module struct { - ID string `json:"id"` - - //--------------------------------------------------------------- - // Metadata about the overall module. - - Owner string `json:"owner"` - Namespace string `json:"namespace"` - Name string `json:"name"` - Version string `json:"version"` - Provider string `json:"provider"` - Description string `json:"description"` - Source string `json:"source"` - PublishedAt time.Time `json:"published_at"` - Downloads int `json:"downloads"` - Verified bool `json:"verified"` -} - -// ModuleDetail represents a module in full detail. -type ModuleDetail struct { - Module - - //--------------------------------------------------------------- - // Metadata about the overall module. This is only available when - // requesting the specific module (not in list responses). - - // Root is the root module. - Root *ModuleSubmodule `json:"root"` - - // Submodules are the other submodules that are available within - // this module. - Submodules []*ModuleSubmodule `json:"submodules"` - - //--------------------------------------------------------------- - // The fields below are only set when requesting this specific - // module. They are available to easily know all available versions - // and providers without multiple API calls. - - Providers []string `json:"providers"` // All available providers - Versions []string `json:"versions"` // All versions -} - // ModuleSubmodule is the metadata about a specific submodule within // a module. This includes the root module as a special case. type ModuleSubmodule struct { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module_list.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module_list.go deleted file mode 100644 index 978374822..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module_list.go +++ /dev/null @@ -1,7 +0,0 @@ -package response - -// ModuleList is the response structure for a pageable list of modules. -type ModuleList struct { - Meta PaginationMeta `json:"meta"` - Modules []*Module `json:"modules"` -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module_provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module_provider.go deleted file mode 100644 index e48499dce..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/module_provider.go +++ /dev/null @@ -1,14 +0,0 @@ -package response - -// ModuleProvider represents a single provider for modules. -type ModuleProvider struct { - Name string `json:"name"` - Downloads int `json:"downloads"` - ModuleCount int `json:"module_count"` -} - -// ModuleProviderList is the response structure for a pageable list of ModuleProviders. -type ModuleProviderList struct { - Meta PaginationMeta `json:"meta"` - Providers []*ModuleProvider `json:"providers"` -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/provider.go deleted file mode 100644 index 5e8bae354..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/provider.go +++ /dev/null @@ -1,36 +0,0 @@ -package response - -import ( - "time" -) - -// Provider is the response structure with the data for a single provider -// version. This is just the metadata. A full provider response will be -// ProviderDetail. -type Provider struct { - ID string `json:"id"` - - //--------------------------------------------------------------- - // Metadata about the overall provider. - - Owner string `json:"owner"` - Namespace string `json:"namespace"` - Name string `json:"name"` - Version string `json:"version"` - Description string `json:"description"` - Source string `json:"source"` - PublishedAt time.Time `json:"published_at"` - Downloads int `json:"downloads"` -} - -// ProviderDetail represents a Provider with full detail. -type ProviderDetail struct { - Provider - - //--------------------------------------------------------------- - // The fields below are only set when requesting this specific - // module. They are available to easily know all available versions - // without multiple API calls. - - Versions []string `json:"versions"` // All versions -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/provider_list.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/provider_list.go deleted file mode 100644 index 1dc7d237f..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/provider_list.go +++ /dev/null @@ -1,7 +0,0 @@ -package response - -// ProviderList is the response structure for a pageable list of providers. -type ProviderList struct { - Meta PaginationMeta `json:"meta"` - Providers []*Provider `json:"providers"` -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/redirect.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/redirect.go deleted file mode 100644 index d5eb49ba6..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/registry/response/redirect.go +++ /dev/null @@ -1,6 +0,0 @@ -package response - -// Redirect causes the frontend to perform a window redirect. -type Redirect struct { - URL string `json:"url"` -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/module.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/module.go index 8c89278c5..6b74cbfa6 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/module.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/module.go @@ -146,23 +146,6 @@ func (ms *Module) SetResourceInstanceDeposed(addr addrs.ResourceInstance, key De } } -// ForgetResourceInstanceAll removes the record of all objects associated with -// the specified resource instance, if present. If not present, this is a no-op. -func (ms *Module) ForgetResourceInstanceAll(addr addrs.ResourceInstance) { - rs := ms.Resource(addr.Resource) - if rs == nil { - return - } - delete(rs.Instances, addr.Key) - - if rs.EachMode == NoEach && len(rs.Instances) == 0 { - // Also clean up if we only expect to have one instance anyway - // and there are none. We leave the resource behind if an each mode - // is active because an empty list or map of instances is a valid state. - delete(ms.Resources, addr.Resource.String()) - } -} - // ForgetResourceInstanceDeposed removes the record of the deposed object with // the given address and key, if present. If not present, this is a no-op. func (ms *Module) ForgetResourceInstanceDeposed(addr addrs.ResourceInstance, key DeposedKey) { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/resource.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/resource.go index aacdb9d2d..32ea638ac 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/resource.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/resource.go @@ -88,12 +88,6 @@ func (i *ResourceInstance) HasDeposed(key DeposedKey) bool { return i != nil && i.Deposed[key] != nil } -// HasAnyDeposed returns true if this resource instance has one or more -// deposed objects. -func (i *ResourceInstance) HasAnyDeposed() bool { - return i != nil && len(i.Deposed) > 0 -} - // HasObjects returns true if this resource has any objects at all, whether // current or deposed. func (i *ResourceInstance) HasObjects() bool { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile/file.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile/file.go index 9f7ae00e4..70c8ba6ce 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile/file.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile/file.go @@ -4,7 +4,6 @@ import ( version "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-sdk/internal/states" - tfversion "github.com/hashicorp/terraform-plugin-sdk/internal/version" ) // File is the in-memory representation of a state file. It includes the state @@ -30,33 +29,3 @@ type File struct { // State is the actual state represented by this file. State *states.State } - -func New(state *states.State, lineage string, serial uint64) *File { - // To make life easier on callers, we'll accept a nil state here and just - // allocate an empty one, which is required for this file to be successfully - // written out. - if state == nil { - state = states.NewState() - } - - return &File{ - TerraformVersion: tfversion.SemVer, - State: state, - Lineage: lineage, - Serial: serial, - } -} - -// DeepCopy is a convenience method to create a new File object whose state -// is a deep copy of the receiver's, as implemented by states.State.DeepCopy. -func (f *File) DeepCopy() *File { - if f == nil { - return nil - } - return &File{ - TerraformVersion: f.TerraformVersion, - Serial: f.Serial, - Lineage: f.Lineage, - State: f.State.DeepCopy(), - } -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile/marshal_equal.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile/marshal_equal.go deleted file mode 100644 index 41f485d17..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile/marshal_equal.go +++ /dev/null @@ -1,40 +0,0 @@ -package statefile - -import ( - "bytes" - - "github.com/hashicorp/terraform-plugin-sdk/internal/states" -) - -// StatesMarshalEqual returns true if and only if the two given states have -// an identical (byte-for-byte) statefile representation. -// -// This function compares only the portions of the state that are persisted -// in state files, so for example it will not return false if the only -// differences between the two states are local values or descendent module -// outputs. -func StatesMarshalEqual(a, b *states.State) bool { - var aBuf bytes.Buffer - var bBuf bytes.Buffer - - // nil states are not valid states, and so they can never martial equal. - if a == nil || b == nil { - return false - } - - // We write here some temporary files that have no header information - // populated, thus ensuring that we're only comparing the state itself - // and not any metadata. - err := Write(&File{State: a}, &aBuf) - if err != nil { - // Should never happen, because we're writing to an in-memory buffer - panic(err) - } - err = Write(&File{State: b}, &bBuf) - if err != nil { - // Should never happen, because we're writing to an in-memory buffer - panic(err) - } - - return bytes.Equal(aBuf.Bytes(), bBuf.Bytes()) -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/sync.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/sync.go index 8675efc3c..6d2361254 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/sync.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/states/sync.go @@ -48,17 +48,6 @@ func (s *SyncState) Module(addr addrs.ModuleInstance) *Module { return ret } -// RemoveModule removes the entire state for the given module, taking with -// it any resources associated with the module. This should generally be -// called only for modules whose resources have all been destroyed, but -// that is not enforced by this method. -func (s *SyncState) RemoveModule(addr addrs.ModuleInstance) { - s.lock.Lock() - defer s.lock.Unlock() - - s.state.RemoveModule(addr) -} - // OutputValue returns a snapshot of the state of the output value with the // given address, or nil if no such output value is tracked. // @@ -193,20 +182,6 @@ func (s *SyncState) SetResourceMeta(addr addrs.AbsResource, eachMode EachMode, p ms.SetResourceMeta(addr.Resource, eachMode, provider) } -// RemoveResource removes the entire state for the given resource, taking with -// it any instances associated with the resource. This should generally be -// called only for resource objects whose instances have all been destroyed, -// but that is not enforced by this method. (Use RemoveResourceIfEmpty instead -// to safely check first.) -func (s *SyncState) RemoveResource(addr addrs.AbsResource) { - s.lock.Lock() - defer s.lock.Unlock() - - ms := s.state.EnsureModule(addr.Module) - ms.RemoveResource(addr.Resource) - s.maybePruneModule(addr.Module) -} - // RemoveResourceIfEmpty is similar to RemoveResource but first checks to // make sure there are no instances or objects left in the resource. // @@ -387,34 +362,6 @@ func (s *SyncState) DeposeResourceInstanceObjectForceKey(addr addrs.AbsResourceI ms.deposeResourceInstanceObject(addr.Resource, forcedKey) } -// ForgetResourceInstanceAll removes the record of all objects associated with -// the specified resource instance, if present. If not present, this is a no-op. -func (s *SyncState) ForgetResourceInstanceAll(addr addrs.AbsResourceInstance) { - s.lock.Lock() - defer s.lock.Unlock() - - ms := s.state.Module(addr.Module) - if ms == nil { - return - } - ms.ForgetResourceInstanceAll(addr.Resource) - s.maybePruneModule(addr.Module) -} - -// ForgetResourceInstanceDeposed removes the record of the deposed object with -// the given address and key, if present. If not present, this is a no-op. -func (s *SyncState) ForgetResourceInstanceDeposed(addr addrs.AbsResourceInstance, key DeposedKey) { - s.lock.Lock() - defer s.lock.Unlock() - - ms := s.state.Module(addr.Module) - if ms == nil { - return - } - ms.ForgetResourceInstanceDeposed(addr.Resource, key) - s.maybePruneModule(addr.Module) -} - // MaybeRestoreResourceInstanceDeposed will restore the deposed object with the // given key on the specified resource as the current object for that instance // if and only if that would not cause us to forget an existing current diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/from_map.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/from_map.go deleted file mode 100644 index f91006aec..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/from_map.go +++ /dev/null @@ -1,18 +0,0 @@ -package auth - -// HostCredentialsFromMap converts a map of key-value pairs from a credentials -// definition provided by the user (e.g. in a config file, or via a credentials -// helper) into a HostCredentials object if possible, or returns nil if -// no credentials could be extracted from the map. -// -// This function ignores map keys it is unfamiliar with, to allow for future -// expansion of the credentials map format for new credential types. -func HostCredentialsFromMap(m map[string]interface{}) HostCredentials { - if m == nil { - return nil - } - if token, ok := m["token"].(string); ok { - return HostCredentialsToken(token) - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/token_credentials.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/token_credentials.go deleted file mode 100644 index 9358bcb64..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/token_credentials.go +++ /dev/null @@ -1,25 +0,0 @@ -package auth - -import ( - "net/http" -) - -// HostCredentialsToken is a HostCredentials implementation that represents a -// single "bearer token", to be sent to the server via an Authorization header -// with the auth type set to "Bearer" -type HostCredentialsToken string - -// PrepareRequest alters the given HTTP request by setting its Authorization -// header to the string "Bearer " followed by the encapsulated authentication -// token. -func (tc HostCredentialsToken) PrepareRequest(req *http.Request) { - if req.Header == nil { - req.Header = http.Header{} - } - req.Header.Set("Authorization", "Bearer "+string(tc)) -} - -// Token returns the authentication token. -func (tc HostCredentialsToken) Token() string { - return string(tc) -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/contextual.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/contextual.go index 25b214037..59c06b70b 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/contextual.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/contextual.go @@ -1,7 +1,7 @@ package tfdiags import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/gocty" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/diagnostic.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/diagnostic.go index f3b0ea1e4..a7699cf01 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/diagnostic.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/diagnostic.go @@ -1,7 +1,7 @@ package tfdiags import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) type Diagnostic interface { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/diagnostics.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/diagnostics.go index 465b230f6..a19fa80c4 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/diagnostics.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/diagnostics.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/errwrap" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // Diagnostics is a list of diagnostics. Diagnostics is intended to be used @@ -177,18 +177,6 @@ func (diags Diagnostics) NonFatalErr() error { return NonFatalError{diags} } -// Sort applies an ordering to the diagnostics in the receiver in-place. -// -// The ordering is: warnings before errors, sourceless before sourced, -// short source paths before long source paths, and then ordering by -// position within each file. -// -// Diagnostics that do not differ by any of these sortable characteristics -// will remain in the same relative order after this method returns. -func (diags Diagnostics) Sort() { - sort.Stable(sortDiagnostics(diags)) -} - type diagnosticsAsError struct { Diagnostics } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/hcl.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/hcl.go index f9aec41c9..8c781611a 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/hcl.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags/hcl.go @@ -1,7 +1,7 @@ package tfdiags import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // hclDiagnostic is a Diagnostic implementation that wraps a HCL Diagnostic diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go index 86fd21e41..84179725d 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go @@ -24,6 +24,31 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +type StringKind int32 + +const ( + StringKind_PLAIN StringKind = 0 + StringKind_MARKDOWN StringKind = 1 +) + +var StringKind_name = map[int32]string{ + 0: "PLAIN", + 1: "MARKDOWN", +} + +var StringKind_value = map[string]int32{ + "PLAIN": 0, + "MARKDOWN": 1, +} + +func (x StringKind) String() string { + return proto.EnumName(StringKind_name, int32(x)) +} + +func (StringKind) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_17ae6090ff270234, []int{0} +} + type Diagnostic_Severity int32 const ( @@ -542,6 +567,9 @@ type Schema_Block struct { Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` Attributes []*Schema_Attribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"` BlockTypes []*Schema_NestedBlock `protobuf:"bytes,3,rep,name=block_types,json=blockTypes,proto3" json:"block_types,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + DescriptionKind StringKind `protobuf:"varint,5,opt,name=description_kind,json=descriptionKind,proto3,enum=tfplugin5.StringKind" json:"description_kind,omitempty"` + Deprecated bool `protobuf:"varint,6,opt,name=deprecated,proto3" json:"deprecated,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -593,17 +621,40 @@ func (m *Schema_Block) GetBlockTypes() []*Schema_NestedBlock { return nil } +func (m *Schema_Block) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Schema_Block) GetDescriptionKind() StringKind { + if m != nil { + return m.DescriptionKind + } + return StringKind_PLAIN +} + +func (m *Schema_Block) GetDeprecated() bool { + if m != nil { + return m.Deprecated + } + return false +} + type Schema_Attribute struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Type []byte `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` - Optional bool `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"` - Computed bool `protobuf:"varint,6,opt,name=computed,proto3" json:"computed,omitempty"` - Sensitive bool `protobuf:"varint,7,opt,name=sensitive,proto3" json:"sensitive,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type []byte `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` + Optional bool `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"` + Computed bool `protobuf:"varint,6,opt,name=computed,proto3" json:"computed,omitempty"` + Sensitive bool `protobuf:"varint,7,opt,name=sensitive,proto3" json:"sensitive,omitempty"` + DescriptionKind StringKind `protobuf:"varint,8,opt,name=description_kind,json=descriptionKind,proto3,enum=tfplugin5.StringKind" json:"description_kind,omitempty"` + Deprecated bool `protobuf:"varint,9,opt,name=deprecated,proto3" json:"deprecated,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Schema_Attribute) Reset() { *m = Schema_Attribute{} } @@ -680,6 +731,20 @@ func (m *Schema_Attribute) GetSensitive() bool { return false } +func (m *Schema_Attribute) GetDescriptionKind() StringKind { + if m != nil { + return m.DescriptionKind + } + return StringKind_PLAIN +} + +func (m *Schema_Attribute) GetDeprecated() bool { + if m != nil { + return m.Deprecated + } + return false +} + type Schema_NestedBlock struct { TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` Block *Schema_Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` @@ -818,6 +883,7 @@ type GetProviderSchema_Response struct { ResourceSchemas map[string]*Schema `protobuf:"bytes,2,rep,name=resource_schemas,json=resourceSchemas,proto3" json:"resource_schemas,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` DataSourceSchemas map[string]*Schema `protobuf:"bytes,3,rep,name=data_source_schemas,json=dataSourceSchemas,proto3" json:"data_source_schemas,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Diagnostics []*Diagnostic `protobuf:"bytes,4,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` + ProviderMeta *Schema `protobuf:"bytes,5,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -876,6 +942,13 @@ func (m *GetProviderSchema_Response) GetDiagnostics() []*Diagnostic { return nil } +func (m *GetProviderSchema_Response) GetProviderMeta() *Schema { + if m != nil { + return m.ProviderMeta + } + return nil +} + type PrepareProviderConfig struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1524,6 +1597,7 @@ type ReadResource_Request struct { TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` CurrentState *DynamicValue `protobuf:"bytes,2,opt,name=current_state,json=currentState,proto3" json:"current_state,omitempty"` Private []byte `protobuf:"bytes,3,opt,name=private,proto3" json:"private,omitempty"` + ProviderMeta *DynamicValue `protobuf:"bytes,4,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1575,6 +1649,13 @@ func (m *ReadResource_Request) GetPrivate() []byte { return nil } +func (m *ReadResource_Request) GetProviderMeta() *DynamicValue { + if m != nil { + return m.ProviderMeta + } + return nil +} + type ReadResource_Response struct { NewState *DynamicValue `protobuf:"bytes,1,opt,name=new_state,json=newState,proto3" json:"new_state,omitempty"` Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` @@ -1667,6 +1748,7 @@ type PlanResourceChange_Request struct { ProposedNewState *DynamicValue `protobuf:"bytes,3,opt,name=proposed_new_state,json=proposedNewState,proto3" json:"proposed_new_state,omitempty"` Config *DynamicValue `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` PriorPrivate []byte `protobuf:"bytes,5,opt,name=prior_private,json=priorPrivate,proto3" json:"prior_private,omitempty"` + ProviderMeta *DynamicValue `protobuf:"bytes,6,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1732,6 +1814,13 @@ func (m *PlanResourceChange_Request) GetPriorPrivate() []byte { return nil } +func (m *PlanResourceChange_Request) GetProviderMeta() *DynamicValue { + if m != nil { + return m.ProviderMeta + } + return nil +} + type PlanResourceChange_Response struct { PlannedState *DynamicValue `protobuf:"bytes,1,opt,name=planned_state,json=plannedState,proto3" json:"planned_state,omitempty"` RequiresReplace []*AttributePath `protobuf:"bytes,2,rep,name=requires_replace,json=requiresReplace,proto3" json:"requires_replace,omitempty"` @@ -1851,6 +1940,7 @@ type ApplyResourceChange_Request struct { PlannedState *DynamicValue `protobuf:"bytes,3,opt,name=planned_state,json=plannedState,proto3" json:"planned_state,omitempty"` Config *DynamicValue `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` PlannedPrivate []byte `protobuf:"bytes,5,opt,name=planned_private,json=plannedPrivate,proto3" json:"planned_private,omitempty"` + ProviderMeta *DynamicValue `protobuf:"bytes,6,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1916,6 +2006,13 @@ func (m *ApplyResourceChange_Request) GetPlannedPrivate() []byte { return nil } +func (m *ApplyResourceChange_Request) GetProviderMeta() *DynamicValue { + if m != nil { + return m.ProviderMeta + } + return nil +} + type ApplyResourceChange_Response struct { NewState *DynamicValue `protobuf:"bytes,1,opt,name=new_state,json=newState,proto3" json:"new_state,omitempty"` Private []byte `protobuf:"bytes,2,opt,name=private,proto3" json:"private,omitempty"` @@ -2204,6 +2301,7 @@ var xxx_messageInfo_ReadDataSource proto.InternalMessageInfo type ReadDataSource_Request struct { TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + ProviderMeta *DynamicValue `protobuf:"bytes,3,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2248,6 +2346,13 @@ func (m *ReadDataSource_Request) GetConfig() *DynamicValue { return nil } +func (m *ReadDataSource_Request) GetProviderMeta() *DynamicValue { + if m != nil { + return m.ProviderMeta + } + return nil +} + type ReadDataSource_Response struct { State *DynamicValue `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` @@ -2639,6 +2744,7 @@ func (m *ProvisionResource_Response) GetDiagnostics() []*Diagnostic { } func init() { + proto.RegisterEnum("tfplugin5.StringKind", StringKind_name, StringKind_value) proto.RegisterEnum("tfplugin5.Diagnostic_Severity", Diagnostic_Severity_name, Diagnostic_Severity_value) proto.RegisterEnum("tfplugin5.Schema_NestedBlock_NestingMode", Schema_NestedBlock_NestingMode_name, Schema_NestedBlock_NestingMode_value) proto.RegisterType((*DynamicValue)(nil), "tfplugin5.DynamicValue") @@ -2701,137 +2807,147 @@ func init() { proto.RegisterType((*ProvisionResource_Response)(nil), "tfplugin5.ProvisionResource.Response") } -func init() { proto.RegisterFile("tfplugin5.proto", fileDescriptor_17ae6090ff270234) } +func init() { + proto.RegisterFile("tfplugin5.proto", fileDescriptor_17ae6090ff270234) +} var fileDescriptor_17ae6090ff270234 = []byte{ - // 1880 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcb, 0x6f, 0x23, 0x49, - 0x19, 0x9f, 0xf6, 0x23, 0xb1, 0x3f, 0xe7, 0xe1, 0xd4, 0xcc, 0x0e, 0xa6, 0x77, 0x17, 0x82, 0x79, - 0x24, 0xab, 0xdd, 0xf1, 0xac, 0x32, 0xb0, 0xbb, 0x84, 0xd1, 0x8a, 0x6c, 0x26, 0x64, 0x22, 0x66, - 0xb2, 0xa1, 0x3c, 0x0f, 0x24, 0xa4, 0xb5, 0x6a, 0xdc, 0x15, 0x4f, 0x33, 0x76, 0x77, 0x6f, 0x75, - 0x39, 0x89, 0x85, 0xc4, 0x05, 0xc1, 0x19, 0x09, 0xf1, 0x90, 0x78, 0x5c, 0x40, 0xe2, 0x1f, 0xe0, - 0x00, 0xdc, 0x38, 0xf1, 0x0f, 0x70, 0x03, 0x4e, 0x08, 0x6e, 0x9c, 0xe1, 0x82, 0x84, 0xea, 0xd5, - 0x5d, 0xb6, 0xdb, 0x4e, 0x4f, 0xb2, 0x23, 0xc4, 0xad, 0xab, 0xbe, 0x5f, 0x7d, 0xdf, 0x57, 0xdf, - 0xab, 0xbe, 0xcf, 0x86, 0x55, 0x7e, 0x1c, 0xf5, 0x87, 0x3d, 0x3f, 0xf8, 0x42, 0x2b, 0x62, 0x21, - 0x0f, 0x51, 0x35, 0xd9, 0x68, 0xde, 0x86, 0xa5, 0x3b, 0xa3, 0x80, 0x0c, 0xfc, 0xee, 0x23, 0xd2, - 0x1f, 0x52, 0xd4, 0x80, 0xc5, 0x41, 0xdc, 0x8b, 0x48, 0xf7, 0x59, 0xc3, 0x59, 0x77, 0x36, 0x97, - 0xb0, 0x59, 0x22, 0x04, 0xa5, 0x6f, 0xc6, 0x61, 0xd0, 0x28, 0xc8, 0x6d, 0xf9, 0xdd, 0xfc, 0x9b, - 0x03, 0x70, 0xc7, 0x27, 0xbd, 0x20, 0x8c, 0xb9, 0xdf, 0x45, 0xdb, 0x50, 0x89, 0xe9, 0x09, 0x65, - 0x3e, 0x1f, 0xc9, 0xd3, 0x2b, 0x5b, 0x9f, 0x68, 0xa5, 0xb2, 0x53, 0x60, 0xab, 0xad, 0x51, 0x38, - 0xc1, 0x0b, 0xc1, 0xf1, 0x70, 0x30, 0x20, 0x6c, 0x24, 0x25, 0x54, 0xb1, 0x59, 0xa2, 0xeb, 0xb0, - 0xe0, 0x51, 0x4e, 0xfc, 0x7e, 0xa3, 0x28, 0x09, 0x7a, 0x85, 0xde, 0x82, 0x2a, 0xe1, 0x9c, 0xf9, - 0x4f, 0x86, 0x9c, 0x36, 0x4a, 0xeb, 0xce, 0x66, 0x6d, 0xab, 0x61, 0x89, 0xdb, 0x31, 0xb4, 0x23, - 0xc2, 0x9f, 0xe2, 0x14, 0xda, 0xbc, 0x09, 0x15, 0x23, 0x1f, 0xd5, 0x60, 0xf1, 0xe0, 0xf0, 0xd1, - 0xce, 0xbd, 0x83, 0x3b, 0xf5, 0x2b, 0xa8, 0x0a, 0xe5, 0x3d, 0x8c, 0xdf, 0xc7, 0x75, 0x47, 0xec, - 0x3f, 0xde, 0xc1, 0x87, 0x07, 0x87, 0xfb, 0xf5, 0x42, 0xf3, 0x2f, 0x0e, 0x2c, 0x8f, 0x71, 0x43, - 0xb7, 0xa0, 0x1c, 0x73, 0x1a, 0xc5, 0x0d, 0x67, 0xbd, 0xb8, 0x59, 0xdb, 0x7a, 0x75, 0x96, 0xd8, - 0x56, 0x9b, 0xd3, 0x08, 0x2b, 0xac, 0xfb, 0x43, 0x07, 0x4a, 0x62, 0x8d, 0x36, 0x60, 0x25, 0xd1, - 0xa6, 0x13, 0x90, 0x01, 0x95, 0xc6, 0xaa, 0xde, 0xbd, 0x82, 0x97, 0x93, 0xfd, 0x43, 0x32, 0xa0, - 0xa8, 0x05, 0x88, 0xf6, 0xe9, 0x80, 0x06, 0xbc, 0xf3, 0x8c, 0x8e, 0x3a, 0x31, 0x67, 0x7e, 0xd0, - 0x53, 0xe6, 0xb9, 0x7b, 0x05, 0xd7, 0x35, 0xed, 0xab, 0x74, 0xd4, 0x96, 0x14, 0xb4, 0x09, 0xab, - 0x36, 0xde, 0x0f, 0xb8, 0x34, 0x59, 0x51, 0x70, 0x4e, 0xc1, 0x07, 0x01, 0x7f, 0x0f, 0x84, 0xa7, - 0xfa, 0xb4, 0xcb, 0x43, 0xd6, 0xbc, 0x25, 0xd4, 0x0a, 0x23, 0xb7, 0x0a, 0x8b, 0x98, 0x7e, 0x38, - 0xa4, 0x31, 0x77, 0xd7, 0xa1, 0x82, 0x69, 0x1c, 0x85, 0x41, 0x4c, 0xd1, 0x35, 0x28, 0xef, 0x31, - 0x16, 0x32, 0xa5, 0x24, 0x56, 0x8b, 0xe6, 0x8f, 0x1c, 0xa8, 0x60, 0x72, 0xda, 0xe6, 0x84, 0xd3, - 0x24, 0x34, 0x9c, 0x34, 0x34, 0xd0, 0x36, 0x2c, 0x1e, 0xf7, 0x09, 0x1f, 0x90, 0xa8, 0x51, 0x90, - 0x46, 0x5a, 0xb7, 0x8c, 0x64, 0x4e, 0xb6, 0xbe, 0xa2, 0x20, 0x7b, 0x01, 0x67, 0x23, 0x6c, 0x0e, - 0xb8, 0xdb, 0xb0, 0x64, 0x13, 0x50, 0x1d, 0x8a, 0xcf, 0xe8, 0x48, 0x2b, 0x20, 0x3e, 0x85, 0x52, - 0x27, 0x22, 0x5e, 0x75, 0xac, 0xa8, 0xc5, 0x76, 0xe1, 0x1d, 0xa7, 0xf9, 0x8f, 0x32, 0x2c, 0xb4, - 0xbb, 0x4f, 0xe9, 0x80, 0x88, 0x90, 0x3a, 0xa1, 0x2c, 0xf6, 0xb5, 0x66, 0x45, 0x6c, 0x96, 0xe8, - 0x06, 0x94, 0x9f, 0xf4, 0xc3, 0xee, 0x33, 0x79, 0xbc, 0xb6, 0xf5, 0x31, 0x4b, 0x35, 0x75, 0xb6, - 0xf5, 0x9e, 0x20, 0x63, 0x85, 0x72, 0x7f, 0xe1, 0x40, 0x59, 0x6e, 0xcc, 0x61, 0xf9, 0x25, 0x80, - 0xc4, 0x79, 0xb1, 0xbe, 0xf2, 0xcb, 0xd3, 0x7c, 0x93, 0xf0, 0xc0, 0x16, 0x1c, 0xbd, 0x0b, 0x35, - 0x29, 0xa9, 0xc3, 0x47, 0x11, 0x8d, 0x1b, 0xc5, 0xa9, 0xa8, 0xd2, 0xa7, 0x0f, 0x69, 0xcc, 0xa9, - 0xa7, 0x74, 0x03, 0x79, 0xe2, 0x81, 0x38, 0xe0, 0xfe, 0xd1, 0x81, 0x6a, 0xc2, 0x59, 0xb8, 0x23, - 0x8d, 0x2a, 0x2c, 0xbf, 0xc5, 0x9e, 0xe0, 0x6d, 0xb2, 0x57, 0x7c, 0xa3, 0x75, 0xa8, 0x79, 0x34, - 0xee, 0x32, 0x3f, 0xe2, 0xe2, 0x42, 0x2a, 0xbb, 0xec, 0x2d, 0xe4, 0x42, 0x85, 0xd1, 0x0f, 0x87, - 0x3e, 0xa3, 0x9e, 0xcc, 0xb0, 0x0a, 0x4e, 0xd6, 0x82, 0x16, 0x4a, 0x14, 0xe9, 0x37, 0xca, 0x8a, - 0x66, 0xd6, 0x82, 0xd6, 0x0d, 0x07, 0xd1, 0x90, 0x53, 0xaf, 0xb1, 0xa0, 0x68, 0x66, 0x8d, 0x5e, - 0x81, 0x6a, 0x4c, 0x83, 0xd8, 0xe7, 0xfe, 0x09, 0x6d, 0x2c, 0x4a, 0x62, 0xba, 0xe1, 0xfe, 0xba, - 0x00, 0x35, 0xeb, 0x96, 0xe8, 0x65, 0xa8, 0x0a, 0x5d, 0xad, 0x34, 0xc1, 0x15, 0xb1, 0x21, 0xf3, - 0xe3, 0xf9, 0xdc, 0x88, 0x76, 0x61, 0x31, 0xa0, 0x31, 0x17, 0x39, 0x54, 0x94, 0xd5, 0xe9, 0xb5, - 0xb9, 0x16, 0x96, 0xdf, 0x7e, 0xd0, 0xbb, 0x1f, 0x7a, 0x14, 0x9b, 0x93, 0x42, 0xa1, 0x81, 0x1f, - 0x74, 0x7c, 0x4e, 0x07, 0xb1, 0xb4, 0x49, 0x11, 0x57, 0x06, 0x7e, 0x70, 0x20, 0xd6, 0x92, 0x48, - 0xce, 0x34, 0xb1, 0xac, 0x89, 0xe4, 0x4c, 0x12, 0x9b, 0xf7, 0xd5, 0xcd, 0x34, 0xc7, 0xf1, 0xd2, - 0x03, 0xb0, 0xd0, 0x3e, 0x38, 0xdc, 0xbf, 0xb7, 0x57, 0x77, 0x50, 0x05, 0x4a, 0xf7, 0x0e, 0xda, - 0x0f, 0xea, 0x05, 0xb4, 0x08, 0xc5, 0xf6, 0xde, 0x83, 0x7a, 0x51, 0x7c, 0xdc, 0xdf, 0x39, 0xaa, - 0x97, 0x44, 0x89, 0xda, 0xc7, 0xef, 0x3f, 0x3c, 0xaa, 0x97, 0x9b, 0x3f, 0x29, 0xc1, 0xda, 0x3e, - 0xe5, 0x47, 0x2c, 0x3c, 0xf1, 0x3d, 0xca, 0x94, 0xfe, 0x76, 0x12, 0xff, 0xab, 0x68, 0x65, 0xf1, - 0x0d, 0xa8, 0x44, 0x1a, 0x29, 0xcd, 0x58, 0xdb, 0x5a, 0x9b, 0xba, 0x3c, 0x4e, 0x20, 0x88, 0x42, - 0x9d, 0xd1, 0x38, 0x1c, 0xb2, 0x2e, 0xed, 0xc4, 0x92, 0x68, 0x62, 0x7a, 0xdb, 0x3a, 0x36, 0x25, - 0xbe, 0x65, 0xe4, 0x89, 0x0f, 0x79, 0x5a, 0xed, 0xc7, 0x2a, 0xc1, 0x57, 0xd9, 0xf8, 0x2e, 0xea, - 0xc3, 0x55, 0x8f, 0x70, 0xd2, 0x99, 0x90, 0xa4, 0xe2, 0xff, 0x76, 0x3e, 0x49, 0x77, 0x08, 0x27, - 0xed, 0x69, 0x59, 0x6b, 0xde, 0xe4, 0x3e, 0x7a, 0x1b, 0x6a, 0x5e, 0xf2, 0x06, 0x09, 0xe7, 0x09, - 0x29, 0x2f, 0x65, 0xbe, 0x50, 0xd8, 0x46, 0xba, 0x0f, 0xe1, 0x5a, 0xd6, 0x7d, 0x32, 0xea, 0xd2, - 0x86, 0x5d, 0x97, 0x32, 0x6d, 0x9c, 0x96, 0x2a, 0xf7, 0x31, 0x5c, 0xcf, 0x56, 0xfe, 0x92, 0x8c, - 0x9b, 0x7f, 0x76, 0xe0, 0xa5, 0x23, 0x46, 0x23, 0xc2, 0xa8, 0xb1, 0xda, 0x6e, 0x18, 0x1c, 0xfb, - 0x3d, 0x77, 0x3b, 0x09, 0x0f, 0x74, 0x13, 0x16, 0xba, 0x72, 0x53, 0xc7, 0x83, 0x9d, 0x3d, 0x76, - 0x4b, 0x80, 0x35, 0xcc, 0xfd, 0xae, 0x63, 0xc5, 0xd3, 0x97, 0x61, 0x35, 0x52, 0x12, 0xbc, 0x4e, - 0x3e, 0x36, 0x2b, 0x06, 0xaf, 0x54, 0x99, 0xf4, 0x46, 0x21, 0xaf, 0x37, 0x9a, 0xdf, 0x2f, 0xc0, - 0xb5, 0x87, 0x51, 0x8f, 0x11, 0x8f, 0x26, 0x5e, 0x11, 0x8f, 0x89, 0xcb, 0xd2, 0xcb, 0xcd, 0x2d, - 0x1b, 0x56, 0x11, 0x2f, 0x8c, 0x17, 0xf1, 0x37, 0xa1, 0xca, 0xc8, 0x69, 0x27, 0x16, 0xec, 0x64, - 0x8d, 0xa8, 0x6d, 0x5d, 0xcd, 0x78, 0xb6, 0x70, 0x85, 0xe9, 0x2f, 0xf7, 0x3b, 0xb6, 0x51, 0xde, - 0x85, 0x95, 0xa1, 0x52, 0xcc, 0xd3, 0x3c, 0xce, 0xb1, 0xc9, 0xb2, 0x81, 0xab, 0x77, 0xf4, 0xc2, - 0x26, 0xf9, 0xbd, 0x03, 0xee, 0x23, 0xd2, 0xf7, 0x3d, 0xa1, 0x9c, 0xb6, 0x89, 0x78, 0x19, 0xb4, - 0xd7, 0x1f, 0xe7, 0x34, 0x4c, 0x1a, 0x12, 0x85, 0x7c, 0x21, 0xb1, 0x6b, 0x5d, 0x7e, 0x42, 0x79, - 0x27, 0xb7, 0xf2, 0xbf, 0x75, 0xa0, 0x61, 0x94, 0x4f, 0xf3, 0xe1, 0xff, 0x42, 0xf5, 0xdf, 0x39, - 0x50, 0x55, 0x8a, 0x0e, 0x19, 0x75, 0x7b, 0xa9, 0xae, 0xaf, 0xc3, 0x1a, 0xa7, 0x8c, 0x91, 0xe3, - 0x90, 0x0d, 0x3a, 0x76, 0xc7, 0x50, 0xc5, 0xf5, 0x84, 0xf0, 0x48, 0x47, 0xdd, 0xff, 0x46, 0xf7, - 0x5f, 0x15, 0x60, 0x09, 0x53, 0xe2, 0x99, 0x78, 0x71, 0xbf, 0x9d, 0xd3, 0xd4, 0xb7, 0x61, 0xb9, - 0x3b, 0x64, 0x4c, 0x74, 0x99, 0x2a, 0xc8, 0xcf, 0xd1, 0x7a, 0x49, 0xa3, 0x55, 0x8c, 0x37, 0x60, - 0x31, 0x62, 0xfe, 0x89, 0x49, 0xb0, 0x25, 0x6c, 0x96, 0xee, 0x0f, 0xec, 0x54, 0xfa, 0x3c, 0x54, - 0x03, 0x7a, 0x9a, 0x2f, 0x8b, 0x2a, 0x01, 0x3d, 0xbd, 0x5c, 0x02, 0xcd, 0xd6, 0xaa, 0xf9, 0x9b, - 0x12, 0xa0, 0xa3, 0x3e, 0x09, 0x8c, 0x99, 0x76, 0x9f, 0x92, 0xa0, 0x47, 0xdd, 0xff, 0x38, 0x39, - 0xad, 0xf5, 0x0e, 0xd4, 0x22, 0xe6, 0x87, 0x2c, 0x9f, 0xad, 0x40, 0x62, 0xd5, 0x65, 0xf6, 0x00, - 0x45, 0x2c, 0x8c, 0xc2, 0x98, 0x7a, 0x9d, 0xd4, 0x16, 0xc5, 0xf9, 0x0c, 0xea, 0xe6, 0xc8, 0xa1, - 0xb1, 0x49, 0x1a, 0x5d, 0xa5, 0x5c, 0xd1, 0x85, 0x3e, 0x0d, 0xcb, 0x4a, 0x63, 0x63, 0x91, 0xb2, - 0xb4, 0xc8, 0x92, 0xdc, 0x3c, 0xd2, 0xce, 0xfa, 0x79, 0xc1, 0x72, 0xd6, 0x6d, 0x58, 0x8e, 0xfa, - 0x24, 0x08, 0xf2, 0x96, 0xbd, 0x25, 0x8d, 0x56, 0x0a, 0xee, 0x8a, 0x5e, 0x43, 0x36, 0x95, 0x71, - 0x87, 0xd1, 0xa8, 0x4f, 0xba, 0x54, 0x7b, 0x6e, 0xf6, 0x38, 0xb7, 0x6a, 0x4e, 0x60, 0x75, 0x00, - 0x6d, 0xc0, 0xaa, 0x51, 0x61, 0xdc, 0x91, 0x2b, 0x7a, 0x5b, 0x2b, 0x7e, 0xe1, 0x26, 0x00, 0xbd, - 0x01, 0xa8, 0x4f, 0x7b, 0xa4, 0x3b, 0x92, 0x4d, 0x7a, 0x27, 0x1e, 0xc5, 0x9c, 0x0e, 0x74, 0xe7, - 0x5b, 0x57, 0x14, 0x51, 0x72, 0xdb, 0x72, 0xbf, 0xf9, 0xa7, 0x22, 0x5c, 0xdd, 0x89, 0xa2, 0xfe, - 0x68, 0x22, 0x6e, 0xfe, 0xfd, 0xe2, 0xe3, 0x66, 0xca, 0x1b, 0xc5, 0xe7, 0xf1, 0xc6, 0x73, 0x87, - 0x4b, 0x86, 0xe5, 0xcb, 0x59, 0x96, 0x77, 0xff, 0x70, 0xf9, 0xfc, 0xb6, 0xd2, 0xb4, 0x30, 0x96, - 0xa6, 0x93, 0x6e, 0x2d, 0x5e, 0xd2, 0xad, 0xa5, 0x19, 0x6e, 0xfd, 0x67, 0x01, 0xae, 0x1e, 0x0c, - 0xa2, 0x90, 0xf1, 0xf1, 0xd6, 0xe3, 0xad, 0x9c, 0x5e, 0x5d, 0x81, 0x82, 0xef, 0xe9, 0xa1, 0xb5, - 0xe0, 0x7b, 0xee, 0x19, 0xd4, 0x15, 0x3b, 0x9a, 0xd4, 0xe1, 0x73, 0x47, 0x9e, 0x5c, 0x01, 0xa1, - 0x50, 0x73, 0xaa, 0xed, 0x2f, 0x6d, 0x6f, 0x7c, 0x00, 0xc8, 0xd7, 0x6a, 0x74, 0x4c, 0x8f, 0x6e, - 0xde, 0x92, 0x9b, 0x96, 0x88, 0x8c, 0xab, 0xb7, 0x26, 0xf5, 0xc7, 0x6b, 0xfe, 0xc4, 0x4e, 0x7c, - 0xf1, 0xc6, 0xe6, 0xaf, 0x0e, 0xac, 0x88, 0x47, 0x2a, 0xed, 0x0b, 0x5e, 0x5c, 0x47, 0xc0, 0xc6, - 0xc6, 0xa5, 0x72, 0xae, 0xd0, 0xd4, 0x66, 0xbe, 0xf0, 0xfd, 0x7e, 0xea, 0xc0, 0x35, 0x33, 0xdb, - 0x88, 0x5e, 0x20, 0x6b, 0x8e, 0x3b, 0xb3, 0xf4, 0xba, 0x25, 0xaa, 0x42, 0x82, 0x9d, 0x3d, 0xc9, - 0xd9, 0xa8, 0x8b, 0x6b, 0xf7, 0x33, 0x07, 0x3e, 0x6e, 0x3a, 0x33, 0x4b, 0xc5, 0x8f, 0x60, 0x96, - 0xf8, 0x48, 0x3a, 0x98, 0xbf, 0x3b, 0xb0, 0x96, 0xa8, 0x95, 0xb4, 0x31, 0xf1, 0xc5, 0xd5, 0x42, - 0x6f, 0x03, 0x74, 0xc3, 0x20, 0xa0, 0x5d, 0x6e, 0x86, 0x83, 0x79, 0x35, 0x37, 0x85, 0xba, 0xdf, - 0xb0, 0xee, 0x73, 0x1d, 0x16, 0xc2, 0x21, 0x8f, 0x86, 0x5c, 0x87, 0xa4, 0x5e, 0x5d, 0xd8, 0x0d, - 0x5b, 0x3f, 0xae, 0x42, 0xc5, 0xcc, 0x71, 0xe8, 0xeb, 0x50, 0xdd, 0xa7, 0x5c, 0xff, 0xc2, 0xf5, - 0x99, 0x73, 0x46, 0x64, 0x15, 0x40, 0x9f, 0xcd, 0x35, 0x48, 0xa3, 0xfe, 0x8c, 0xa1, 0x11, 0x6d, - 0x5a, 0xe7, 0x33, 0x11, 0x89, 0xa4, 0xd7, 0x72, 0x20, 0xb5, 0xb4, 0x6f, 0xcd, 0x9b, 0x58, 0xd0, - 0x0d, 0x8b, 0xd1, 0x6c, 0x58, 0x22, 0xb7, 0x95, 0x17, 0xae, 0x85, 0x0f, 0x67, 0x4f, 0x1c, 0xe8, - 0xf5, 0x0c, 0x5e, 0x93, 0xa0, 0x44, 0xf0, 0x1b, 0xf9, 0xc0, 0x5a, 0xac, 0x9f, 0x3d, 0xb8, 0xa2, - 0x0d, 0x8b, 0x4b, 0x16, 0x20, 0x11, 0xb7, 0x79, 0x3e, 0x50, 0x8b, 0xba, 0x6b, 0x0d, 0x26, 0xe8, - 0x15, 0xeb, 0x58, 0xb2, 0x9b, 0x30, 0x7d, 0x75, 0x06, 0x55, 0x73, 0xfa, 0xda, 0xf8, 0x98, 0x80, - 0x3e, 0x69, 0x0f, 0xc4, 0x16, 0x21, 0xe1, 0xb7, 0x3e, 0x1b, 0xa0, 0x59, 0x76, 0xb3, 0x5a, 0x6a, - 0x64, 0x87, 0xe9, 0x34, 0x39, 0x61, 0xff, 0xb9, 0xf3, 0x60, 0x5a, 0xc8, 0x71, 0x66, 0x03, 0x86, - 0xec, 0xe3, 0x19, 0xf4, 0x44, 0xcc, 0xc6, 0xb9, 0xb8, 0x54, 0x4e, 0xc6, 0xb3, 0x38, 0x26, 0x27, - 0xeb, 0xd9, 0xcc, 0x92, 0x93, 0x8d, 0xd3, 0x72, 0x1e, 0x4f, 0xbe, 0x84, 0xe8, 0x53, 0x13, 0x86, - 0x4e, 0x49, 0x09, 0xf7, 0xe6, 0x3c, 0x88, 0x66, 0xfc, 0x45, 0xf5, 0xfb, 0x3f, 0x1a, 0xfb, 0xf9, - 0x94, 0x87, 0x51, 0xc2, 0xa4, 0x31, 0x4d, 0x50, 0x47, 0xb7, 0xbe, 0x57, 0x84, 0x9a, 0xf5, 0x30, - 0xa0, 0x0f, 0xec, 0xe2, 0xb4, 0x91, 0x51, 0x76, 0xec, 0x37, 0x2e, 0x33, 0xaa, 0x67, 0x00, 0xb5, - 0xaa, 0x67, 0x73, 0xde, 0x23, 0x94, 0x95, 0x8b, 0x53, 0xa8, 0x44, 0xe8, 0x8d, 0x9c, 0x68, 0x2d, - 0xf9, 0x49, 0xc6, 0x53, 0x33, 0x56, 0x7e, 0xa7, 0xa8, 0x99, 0xe5, 0x37, 0x0b, 0xa5, 0x24, 0xbc, - 0xe9, 0x5c, 0xc2, 0x11, 0x4f, 0x16, 0xe4, 0x1f, 0x7b, 0xb7, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, - 0x8a, 0x61, 0xfa, 0xcc, 0xeb, 0x1b, 0x00, 0x00, + // 2010 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0x9f, 0x6e, 0xdb, 0x89, 0xfd, 0xec, 0x49, 0x3a, 0x35, 0x1f, 0x98, 0xde, 0x0f, 0x82, 0x61, + 0x49, 0x96, 0xdd, 0xf1, 0xac, 0x32, 0x30, 0xbb, 0x84, 0xd1, 0x6a, 0xb3, 0x49, 0xc8, 0x44, 0x33, + 0xf1, 0x84, 0xf2, 0xcc, 0x04, 0x09, 0x69, 0xad, 0x1a, 0x77, 0xc5, 0xd3, 0xc4, 0xee, 0xee, 0xad, + 0x2e, 0x67, 0x62, 0x71, 0x44, 0x70, 0x46, 0xa0, 0x85, 0x03, 0x70, 0x81, 0x03, 0xe2, 0xc4, 0x0d, + 0xf1, 0x75, 0xe1, 0xce, 0x81, 0x3b, 0xdc, 0x56, 0x1c, 0xb9, 0xf0, 0x17, 0xa0, 0xaa, 0xae, 0xee, + 0x2e, 0xdb, 0xed, 0xa4, 0x93, 0xec, 0x0a, 0xed, 0xad, 0xeb, 0xbd, 0x5f, 0xbd, 0xf7, 0xea, 0xbd, + 0x5f, 0xbd, 0xaa, 0xb2, 0x61, 0x91, 0x1f, 0x06, 0xfd, 0x61, 0xcf, 0xf5, 0xbe, 0xde, 0x0c, 0x98, + 0xcf, 0x7d, 0x54, 0x49, 0x04, 0x8d, 0x7b, 0x50, 0xdb, 0x1a, 0x79, 0x64, 0xe0, 0x76, 0x9f, 0x92, + 0xfe, 0x90, 0xa2, 0x3a, 0xcc, 0x0f, 0xc2, 0x5e, 0x40, 0xba, 0x47, 0x75, 0x63, 0xd9, 0x58, 0xad, + 0xe1, 0x78, 0x88, 0x10, 0x14, 0xbf, 0x17, 0xfa, 0x5e, 0xdd, 0x94, 0x62, 0xf9, 0xdd, 0xf8, 0xd8, + 0x00, 0xd8, 0x72, 0x49, 0xcf, 0xf3, 0x43, 0xee, 0x76, 0xd1, 0x3a, 0x94, 0x43, 0x7a, 0x4c, 0x99, + 0xcb, 0x47, 0x72, 0xf6, 0xc2, 0xda, 0xab, 0xcd, 0xd4, 0x77, 0x0a, 0x6c, 0xb6, 0x15, 0x0a, 0x27, + 0x78, 0xe1, 0x38, 0x1c, 0x0e, 0x06, 0x84, 0x8d, 0xa4, 0x87, 0x0a, 0x8e, 0x87, 0xe8, 0x26, 0xcc, + 0x39, 0x94, 0x13, 0xb7, 0x5f, 0x2f, 0x48, 0x85, 0x1a, 0xa1, 0xbb, 0x50, 0x21, 0x9c, 0x33, 0xf7, + 0xd9, 0x90, 0xd3, 0x7a, 0x71, 0xd9, 0x58, 0xad, 0xae, 0xd5, 0x35, 0x77, 0x1b, 0xb1, 0x6e, 0x9f, + 0xf0, 0xe7, 0x38, 0x85, 0x36, 0x6e, 0x43, 0x39, 0xf6, 0x8f, 0xaa, 0x30, 0xbf, 0xdb, 0x7a, 0xba, + 0xf1, 0x70, 0x77, 0xcb, 0xba, 0x82, 0x2a, 0x50, 0xda, 0xc6, 0xf8, 0x11, 0xb6, 0x0c, 0x21, 0x3f, + 0xd8, 0xc0, 0xad, 0xdd, 0xd6, 0x8e, 0x65, 0x36, 0xfe, 0x65, 0xc0, 0xd5, 0x31, 0x6b, 0xe8, 0x0e, + 0x94, 0x42, 0x4e, 0x83, 0xb0, 0x6e, 0x2c, 0x17, 0x56, 0xab, 0x6b, 0xaf, 0xcc, 0x72, 0xdb, 0x6c, + 0x73, 0x1a, 0xe0, 0x08, 0x6b, 0x7f, 0x64, 0x40, 0x51, 0x8c, 0xd1, 0x0a, 0x2c, 0x24, 0xd1, 0x74, + 0x3c, 0x32, 0xa0, 0x32, 0x59, 0x95, 0xfb, 0x57, 0xf0, 0xd5, 0x44, 0xde, 0x22, 0x03, 0x8a, 0x9a, + 0x80, 0x68, 0x9f, 0x0e, 0xa8, 0xc7, 0x3b, 0x47, 0x74, 0xd4, 0x09, 0x39, 0x73, 0xbd, 0x5e, 0x94, + 0x9e, 0xfb, 0x57, 0xb0, 0xa5, 0x74, 0x0f, 0xe8, 0xa8, 0x2d, 0x35, 0x68, 0x15, 0x16, 0x75, 0xbc, + 0xeb, 0x71, 0x99, 0xb2, 0x82, 0xb0, 0x9c, 0x82, 0x77, 0x3d, 0xfe, 0x3e, 0x88, 0x4a, 0xf5, 0x69, + 0x97, 0xfb, 0xac, 0x71, 0x47, 0x84, 0xe5, 0x07, 0x76, 0x05, 0xe6, 0x31, 0xfd, 0x70, 0x48, 0x43, + 0x6e, 0x2f, 0x43, 0x19, 0xd3, 0x30, 0xf0, 0xbd, 0x90, 0xa2, 0xeb, 0x50, 0xda, 0x66, 0xcc, 0x67, + 0x51, 0x90, 0x38, 0x1a, 0x34, 0x7e, 0x66, 0x40, 0x19, 0x93, 0x17, 0x6d, 0x4e, 0x38, 0x4d, 0xa8, + 0x61, 0xa4, 0xd4, 0x40, 0xeb, 0x30, 0x7f, 0xd8, 0x27, 0x7c, 0x40, 0x82, 0xba, 0x29, 0x93, 0xb4, + 0xac, 0x25, 0x29, 0x9e, 0xd9, 0xfc, 0x56, 0x04, 0xd9, 0xf6, 0x38, 0x1b, 0xe1, 0x78, 0x82, 0xbd, + 0x0e, 0x35, 0x5d, 0x81, 0x2c, 0x28, 0x1c, 0xd1, 0x91, 0x0a, 0x40, 0x7c, 0x8a, 0xa0, 0x8e, 0x05, + 0x5f, 0x15, 0x57, 0xa2, 0xc1, 0xba, 0xf9, 0x8e, 0xd1, 0xf8, 0xfb, 0x3c, 0xcc, 0xb5, 0xbb, 0xcf, + 0xe9, 0x80, 0x08, 0x4a, 0x1d, 0x53, 0x16, 0xba, 0x2a, 0xb2, 0x02, 0x8e, 0x87, 0xe8, 0x16, 0x94, + 0x9e, 0xf5, 0xfd, 0xee, 0x91, 0x9c, 0x5e, 0x5d, 0xfb, 0x9c, 0x16, 0x5a, 0x34, 0xb7, 0xf9, 0xbe, + 0x50, 0xe3, 0x08, 0x65, 0xff, 0xda, 0x84, 0x92, 0x14, 0x9c, 0x62, 0xf2, 0x9b, 0x00, 0x49, 0xf1, + 0x42, 0xb5, 0xe4, 0x97, 0xa6, 0xed, 0x26, 0xf4, 0xc0, 0x1a, 0x1c, 0xbd, 0x0b, 0x55, 0xe9, 0xa9, + 0xc3, 0x47, 0x01, 0x0d, 0xeb, 0x85, 0x29, 0x56, 0xa9, 0xd9, 0x2d, 0x1a, 0x72, 0xea, 0x44, 0xb1, + 0x81, 0x9c, 0xf1, 0x58, 0x4c, 0x40, 0xcb, 0x50, 0x75, 0x68, 0xd8, 0x65, 0x6e, 0xc0, 0x45, 0x68, + 0x45, 0x99, 0x14, 0x5d, 0x84, 0xde, 0x03, 0x4b, 0x1b, 0x76, 0x8e, 0x5c, 0xcf, 0xa9, 0x97, 0xe4, + 0x16, 0xbd, 0xa1, 0xbb, 0x91, 0x3c, 0x7a, 0xe0, 0x7a, 0x0e, 0x5e, 0xd4, 0xe0, 0x42, 0x80, 0x5e, + 0x05, 0x70, 0x68, 0xc0, 0x68, 0x97, 0x70, 0xea, 0xd4, 0xe7, 0x96, 0x8d, 0xd5, 0x32, 0xd6, 0x24, + 0xf6, 0xef, 0x4c, 0xa8, 0x24, 0xab, 0x13, 0x94, 0x48, 0x99, 0x8d, 0xe5, 0xb7, 0x90, 0x89, 0xf5, + 0xc5, 0x1d, 0x44, 0x7c, 0x4f, 0x46, 0x5e, 0x98, 0x8e, 0xdc, 0x86, 0x32, 0xa3, 0x1f, 0x0e, 0x5d, + 0x46, 0x1d, 0xb9, 0xb0, 0x32, 0x4e, 0xc6, 0x42, 0xe7, 0x4b, 0x14, 0xe9, 0xcb, 0xd5, 0x94, 0x71, + 0x32, 0x16, 0xba, 0xae, 0x3f, 0x08, 0x86, 0x69, 0xb4, 0xc9, 0x18, 0xbd, 0x0c, 0x95, 0x90, 0x7a, + 0xa1, 0xcb, 0xdd, 0x63, 0x5a, 0x9f, 0x97, 0xca, 0x54, 0x90, 0x99, 0xab, 0xf2, 0x25, 0x72, 0x55, + 0x99, 0xca, 0xd5, 0x6f, 0x4d, 0xa8, 0x6a, 0xb5, 0x44, 0x2f, 0x41, 0x45, 0x64, 0x43, 0x6b, 0x06, + 0xb8, 0x2c, 0x04, 0xb2, 0x0b, 0x9c, 0x8f, 0xac, 0x68, 0x13, 0xe6, 0x3d, 0x1a, 0x72, 0xd1, 0x29, + 0x0a, 0x32, 0xe8, 0xd7, 0x4f, 0xe5, 0x91, 0xfc, 0x76, 0xbd, 0xde, 0x9e, 0xef, 0x50, 0x1c, 0xcf, + 0x14, 0x01, 0x0d, 0x5c, 0xaf, 0xe3, 0x72, 0x3a, 0x08, 0x65, 0xd6, 0x0b, 0xb8, 0x3c, 0x70, 0xbd, + 0x5d, 0x31, 0x96, 0x4a, 0x72, 0xa2, 0x94, 0x25, 0xa5, 0x24, 0x27, 0x52, 0xd9, 0xd8, 0x8b, 0x56, + 0xa6, 0x2c, 0x8e, 0x37, 0x58, 0x80, 0xb9, 0xf6, 0x6e, 0x6b, 0xe7, 0xe1, 0xb6, 0x65, 0xa0, 0x32, + 0x14, 0x1f, 0xee, 0xb6, 0x1f, 0x5b, 0x26, 0x9a, 0x87, 0x42, 0x7b, 0xfb, 0xb1, 0x55, 0x10, 0x1f, + 0x7b, 0x1b, 0xfb, 0x56, 0x51, 0x34, 0xe2, 0x1d, 0xfc, 0xe8, 0xc9, 0xbe, 0x55, 0x6a, 0xfc, 0xa3, + 0x08, 0x4b, 0x3b, 0x94, 0xef, 0x33, 0xff, 0xd8, 0x75, 0x28, 0x8b, 0xe2, 0xd7, 0x5b, 0xd5, 0xef, + 0x8b, 0x5a, 0xaf, 0xba, 0x05, 0xe5, 0x40, 0x21, 0x65, 0x1a, 0xab, 0x6b, 0x4b, 0x53, 0x8b, 0xc7, + 0x09, 0x04, 0x51, 0xb0, 0x18, 0x0d, 0xfd, 0x21, 0xeb, 0xd2, 0x4e, 0x28, 0x95, 0xf1, 0xce, 0x5d, + 0xd7, 0xa6, 0x4d, 0xb9, 0x6f, 0xc6, 0xfe, 0xc4, 0x87, 0x9c, 0x1d, 0xc9, 0xc3, 0xa8, 0x8d, 0x2d, + 0xb2, 0x71, 0x29, 0xea, 0xc3, 0x35, 0x87, 0x70, 0xd2, 0x99, 0xf0, 0x14, 0xed, 0xf2, 0x7b, 0xf9, + 0x3c, 0x6d, 0x11, 0x4e, 0xda, 0xd3, 0xbe, 0x96, 0x9c, 0x49, 0x39, 0x7a, 0x1b, 0xaa, 0x4e, 0x72, + 0xd2, 0x8a, 0xe2, 0x09, 0x2f, 0x37, 0x32, 0xcf, 0x61, 0xac, 0x23, 0xd1, 0x5d, 0xb8, 0x1a, 0x67, + 0xa6, 0x33, 0xa0, 0x9c, 0xc8, 0xd2, 0x66, 0x66, 0xb0, 0x16, 0xe3, 0xf6, 0x28, 0x27, 0xf6, 0x13, + 0xb8, 0x9e, 0x95, 0x87, 0x8c, 0xae, 0xbd, 0xa2, 0x77, 0xed, 0x4c, 0xcb, 0x69, 0x23, 0xb7, 0x0f, + 0xe0, 0x66, 0xf6, 0xa2, 0x2f, 0x69, 0xb8, 0xf1, 0x4f, 0x03, 0x6e, 0xec, 0x33, 0x1a, 0x10, 0x46, + 0xe3, 0x6c, 0x6f, 0xfa, 0xde, 0xa1, 0xdb, 0xb3, 0xd7, 0x13, 0x5a, 0xa1, 0xdb, 0x30, 0xd7, 0x95, + 0x42, 0xc5, 0x23, 0x7d, 0xd7, 0xe9, 0x17, 0x26, 0xac, 0x60, 0xf6, 0x0f, 0x0d, 0x8d, 0x87, 0xef, + 0xc1, 0x62, 0x10, 0x79, 0x70, 0x3a, 0xf9, 0xcc, 0x2c, 0xc4, 0xf8, 0x28, 0x94, 0xc9, 0x2a, 0x9a, + 0x79, 0xab, 0xd8, 0xf8, 0xb1, 0x09, 0xd7, 0x9f, 0x04, 0x3d, 0x46, 0x1c, 0x9a, 0x54, 0x45, 0x1c, + 0xb5, 0x36, 0x4b, 0x17, 0x77, 0x6a, 0xbb, 0xd1, 0x8e, 0x38, 0x73, 0xfc, 0x88, 0x7b, 0x0b, 0x2a, + 0x8c, 0xbc, 0xe8, 0x84, 0xc2, 0x9c, 0xec, 0x2d, 0xd5, 0xb5, 0x6b, 0x19, 0x87, 0x3a, 0x2e, 0x33, + 0xf5, 0x65, 0xff, 0x40, 0x4f, 0xca, 0xbb, 0xb0, 0x30, 0x8c, 0x02, 0x73, 0x94, 0x8d, 0x33, 0x72, + 0x72, 0x35, 0x86, 0x47, 0xb7, 0x8c, 0x0b, 0xa7, 0xe4, 0xcf, 0x06, 0xd8, 0x4f, 0x49, 0xdf, 0x75, + 0x44, 0x70, 0x2a, 0x27, 0xe2, 0xdc, 0x54, 0x55, 0x3f, 0xc8, 0x99, 0x98, 0x94, 0x12, 0x66, 0x3e, + 0x4a, 0x6c, 0x6a, 0x8b, 0x9f, 0x08, 0xde, 0xc8, 0x1d, 0xfc, 0x1f, 0x0d, 0xa8, 0xc7, 0xc1, 0xa7, + 0xfb, 0xe1, 0x33, 0x11, 0xfa, 0x9f, 0x0c, 0xa8, 0x44, 0x81, 0x0e, 0x19, 0xb5, 0x7b, 0x69, 0xac, + 0x6f, 0xc0, 0x12, 0xa7, 0x8c, 0x91, 0x43, 0x9f, 0x0d, 0x3a, 0xfa, 0x7d, 0xaa, 0x82, 0xad, 0x44, + 0xf1, 0x54, 0xb1, 0xee, 0xff, 0x13, 0xfb, 0xc7, 0x26, 0xd4, 0x30, 0x25, 0x4e, 0xcc, 0x17, 0xfb, + 0xaf, 0x46, 0xce, 0x5c, 0xdf, 0x83, 0xab, 0xdd, 0x21, 0x63, 0xe2, 0x12, 0x1e, 0xb1, 0xfc, 0x8c, + 0xb0, 0x6b, 0x0a, 0x1d, 0x91, 0xbc, 0x0e, 0xf3, 0x01, 0x73, 0x8f, 0xe3, 0x1d, 0x56, 0xc3, 0xf1, + 0x50, 0xd8, 0x1d, 0x6f, 0xcf, 0xc5, 0x33, 0xec, 0x8e, 0x35, 0xe9, 0x9f, 0xea, 0x3b, 0xf1, 0x6b, + 0x50, 0xf1, 0xe8, 0x8b, 0x7c, 0x9b, 0xb0, 0xec, 0xd1, 0x17, 0x97, 0xdb, 0x7f, 0xb3, 0xd7, 0xd4, + 0xf8, 0x6f, 0x11, 0xd0, 0x7e, 0x9f, 0x78, 0x71, 0x96, 0x37, 0x9f, 0x13, 0xaf, 0x47, 0xed, 0xbf, + 0x98, 0x39, 0x73, 0xfd, 0x0e, 0x54, 0x03, 0xe6, 0xfa, 0x2c, 0x5f, 0xa6, 0x41, 0x62, 0xa3, 0xc5, + 0x6c, 0x03, 0x0a, 0x98, 0x1f, 0xf8, 0x21, 0x75, 0x3a, 0x69, 0x2e, 0x0a, 0xa7, 0x1b, 0xb0, 0xe2, + 0x29, 0xad, 0x38, 0x27, 0x29, 0x39, 0x8b, 0xb9, 0xc8, 0x89, 0xbe, 0x24, 0xaa, 0x28, 0x22, 0x8e, + 0x33, 0x52, 0x92, 0x19, 0xa9, 0x49, 0xe1, 0xfe, 0xac, 0x52, 0xcf, 0x9d, 0xa7, 0xd4, 0xbf, 0x32, + 0xb5, 0x52, 0x0b, 0x53, 0x7d, 0xe2, 0x79, 0x79, 0x7b, 0x6e, 0x4d, 0xa1, 0xa3, 0xe5, 0x6d, 0x8a, + 0x0b, 0x92, 0xbc, 0x6b, 0x87, 0x1d, 0x46, 0x83, 0x3e, 0xe9, 0x52, 0x55, 0xf7, 0xd9, 0x2f, 0xed, + 0xc5, 0x78, 0x06, 0x8e, 0x26, 0xa0, 0x15, 0x58, 0x8c, 0x43, 0x18, 0xa7, 0xc1, 0x82, 0x12, 0xc7, + 0xcb, 0xbe, 0xf0, 0xcd, 0xe5, 0x4d, 0x40, 0x7d, 0xda, 0x23, 0xdd, 0x91, 0x7c, 0x3f, 0x75, 0xc2, + 0x51, 0xc8, 0xe9, 0x40, 0x3d, 0x08, 0xac, 0x48, 0x23, 0xfa, 0x7d, 0x5b, 0xca, 0x1b, 0x3f, 0x29, + 0xc2, 0xb5, 0x8d, 0x20, 0xe8, 0x8f, 0x26, 0x58, 0xf7, 0x87, 0x4f, 0x9f, 0x75, 0x53, 0xd5, 0x28, + 0x9c, 0xa7, 0x1a, 0xe7, 0x26, 0x5b, 0x46, 0xe6, 0x4b, 0x99, 0x99, 0xbf, 0x1c, 0xe1, 0xfe, 0x76, + 0xf9, 0xde, 0xa2, 0xb5, 0x08, 0x73, 0xbc, 0xed, 0x4d, 0x90, 0xa2, 0x70, 0x49, 0x52, 0x14, 0x67, + 0x90, 0xe2, 0x3f, 0x26, 0x5c, 0xdb, 0x1d, 0x04, 0x3e, 0xe3, 0xe3, 0xb7, 0xa6, 0xbb, 0x39, 0x39, + 0xb1, 0x00, 0xa6, 0xeb, 0xa8, 0x5f, 0x23, 0x4c, 0xd7, 0xb1, 0x4f, 0xc0, 0x8a, 0xcc, 0xd1, 0xe4, + 0x08, 0x39, 0xf3, 0x95, 0x97, 0x8b, 0x4e, 0x11, 0x6a, 0x76, 0x4f, 0xb5, 0x7f, 0xa3, 0x57, 0xe3, + 0x03, 0x40, 0xae, 0x0a, 0xa3, 0x13, 0x3f, 0x4b, 0xe2, 0x63, 0xf0, 0xb6, 0xe6, 0x22, 0x63, 0xe9, + 0xcd, 0xc9, 0xf8, 0xf1, 0x92, 0x3b, 0x21, 0x09, 0x2f, 0x7e, 0x27, 0xfb, 0xa5, 0x09, 0x0b, 0xe2, + 0x7c, 0x4d, 0xaf, 0x34, 0xf6, 0x47, 0xc6, 0xa7, 0x74, 0x9b, 0x99, 0xa6, 0x77, 0xe1, 0x3c, 0xf4, + 0x66, 0x63, 0x0f, 0xcc, 0x52, 0x2e, 0x66, 0xab, 0x2a, 0x5d, 0x38, 0x3d, 0xbf, 0x30, 0xe0, 0x7a, + 0xfc, 0x1a, 0x14, 0xb7, 0xa0, 0xac, 0x97, 0xef, 0x89, 0x16, 0xd7, 0x1d, 0xd1, 0x92, 0x12, 0xec, + 0xec, 0xb7, 0xaf, 0x8e, 0xba, 0x44, 0xf1, 0x0c, 0xf8, 0x7c, 0x7c, 0x27, 0xd5, 0x42, 0xfc, 0x04, + 0x5e, 0x51, 0x9f, 0xc8, 0xdd, 0xed, 0xdf, 0x06, 0x2c, 0x25, 0x61, 0x25, 0x17, 0xb8, 0xf0, 0xe2, + 0x61, 0xa1, 0xb7, 0x01, 0xba, 0xbe, 0xe7, 0xd1, 0x2e, 0x8f, 0x9f, 0x45, 0xa7, 0x35, 0xfc, 0x14, + 0x6a, 0x7f, 0x57, 0x5b, 0xcf, 0x4d, 0x98, 0xf3, 0x87, 0x3c, 0x18, 0x72, 0x45, 0x68, 0x35, 0xba, + 0x70, 0x19, 0xbe, 0xfa, 0x1a, 0x40, 0xfa, 0x23, 0x14, 0xaa, 0x40, 0x69, 0xff, 0xe1, 0xc6, 0x6e, + 0xcb, 0xba, 0x82, 0x6a, 0x50, 0xde, 0xdb, 0xc0, 0x0f, 0xb6, 0x1e, 0x1d, 0xb4, 0x2c, 0x63, 0xed, + 0xe7, 0x15, 0x28, 0xc7, 0x0f, 0x5d, 0xf4, 0x1d, 0xa8, 0xec, 0x50, 0xae, 0x7e, 0x20, 0xfd, 0xf2, + 0x19, 0xbf, 0x3d, 0x44, 0x3c, 0x7b, 0x2d, 0xd7, 0x2f, 0x14, 0xa8, 0x3f, 0xe3, 0x55, 0x8d, 0x56, + 0xb5, 0xf9, 0x99, 0x88, 0xc4, 0xd3, 0xeb, 0x39, 0x90, 0xca, 0xdb, 0xf7, 0x4f, 0x7b, 0xd2, 0xa1, + 0x5b, 0x9a, 0xa1, 0xd9, 0xb0, 0xc4, 0x6f, 0x33, 0x2f, 0x5c, 0x39, 0x1f, 0xce, 0x7e, 0x92, 0xa1, + 0x37, 0x32, 0x6c, 0x4d, 0x82, 0x12, 0xc7, 0x6f, 0xe6, 0x03, 0x2b, 0xb7, 0x6e, 0xf6, 0xcb, 0x1e, + 0xad, 0x68, 0x56, 0xb2, 0x00, 0x89, 0xbb, 0xd5, 0xb3, 0x81, 0xca, 0xd5, 0x7d, 0xed, 0xe5, 0x86, + 0x5e, 0xd6, 0xa6, 0x25, 0xd2, 0xc4, 0xe8, 0x2b, 0x33, 0xb4, 0xca, 0xd2, 0xb7, 0xc7, 0xdf, 0x51, + 0xe8, 0x0b, 0xfa, 0x2f, 0x06, 0x9a, 0x22, 0xb1, 0xb7, 0x3c, 0x1b, 0xa0, 0x4c, 0x76, 0xb3, 0x1e, + 0x0d, 0x48, 0xa7, 0xe9, 0xb4, 0x3a, 0x31, 0xff, 0x95, 0xb3, 0x60, 0xca, 0xc9, 0x61, 0xe6, 0x25, + 0x11, 0xe9, 0xd3, 0x33, 0xf4, 0x89, 0x9b, 0x95, 0x33, 0x71, 0xa9, 0x9f, 0x8c, 0xc3, 0x77, 0xcc, + 0x4f, 0xd6, 0xe1, 0x9c, 0xe5, 0x27, 0x1b, 0xa7, 0xfc, 0x1c, 0x4c, 0x9e, 0xb7, 0xe8, 0x8b, 0x13, + 0x89, 0x4e, 0x55, 0x89, 0xf5, 0xc6, 0x69, 0x10, 0x65, 0xf8, 0x1b, 0xd1, 0xdf, 0x47, 0x68, 0xec, + 0x77, 0x69, 0xee, 0x07, 0x89, 0x91, 0xfa, 0xb4, 0x22, 0x9a, 0xba, 0xf6, 0xa3, 0x02, 0x54, 0xb5, + 0xf3, 0x03, 0x7d, 0xa0, 0x37, 0xa7, 0x95, 0x8c, 0xb6, 0xa3, 0x1f, 0x85, 0x99, 0xac, 0x9e, 0x01, + 0x54, 0xa1, 0x9e, 0x9c, 0x72, 0x6c, 0xa1, 0xac, 0xbd, 0x38, 0x85, 0x4a, 0x9c, 0xde, 0xca, 0x89, + 0x56, 0x9e, 0x9f, 0x65, 0x9c, 0x48, 0x63, 0xed, 0x77, 0x4a, 0x9b, 0xd9, 0x7e, 0xb3, 0x50, 0x91, + 0x87, 0xb7, 0x8c, 0x4b, 0x14, 0xe2, 0xd9, 0x9c, 0xfc, 0x5f, 0xf8, 0xce, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0xe3, 0x8e, 0xe1, 0x22, 0x2a, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion6 // ProviderClient is the client API for Provider service. // @@ -2856,10 +2972,10 @@ type ProviderClient interface { } type providerClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewProviderClient(cc *grpc.ClientConn) ProviderClient { +func NewProviderClient(cc grpc.ClientConnInterface) ProviderClient { return &providerClient{cc} } @@ -3320,10 +3436,10 @@ type ProvisionerClient interface { } type provisionerClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewProvisionerClient(cc *grpc.ClientConn) ProvisionerClient { +func NewProvisionerClient(cc grpc.ClientConnInterface) ProvisionerClient { return &provisionerClient{cc} } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.proto b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.proto index 9875d9ba6..4f365697a 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.proto +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.proto @@ -1,12 +1,12 @@ -// Terraform Plugin RPC protocol version 5.1 +// Terraform Plugin RPC protocol version 5.2 // -// This file defines version 5.1 of the RPC protocol. To implement a plugin +// This file defines version 5.2 of the RPC protocol. To implement a plugin // against this protocol, copy this definition into your own codebase and // use protoc to generate stubs for your target language. // -// This file will be updated in-place in the source Terraform repository for -// any minor versions of protocol 5, but later minor versions will always be -// backwards compatible. Breaking changes, if any are required, will come +// This file will not be updated. Any minor versions of protocol 5 to follow +// should copy this file and modify the copy while maintaing backwards +// compatibility. Breaking changes, if any are required, will come // in a subsequent major version with its own separate proto definition. // // Note that only the proto files included in a release tag of Terraform are @@ -58,7 +58,7 @@ message Stop { message Request { } message Response { - string Error = 1; + string Error = 1; } } @@ -70,12 +70,20 @@ message RawState { map flatmap = 2; } +enum StringKind { + PLAIN = 0; + MARKDOWN = 1; +} + // Schema is the configuration schema for a Resource, Provider, or Provisioner. message Schema { message Block { int64 version = 1; repeated Attribute attributes = 2; repeated NestedBlock block_types = 3; + string description = 4; + StringKind description_kind = 5; + bool deprecated = 6; } message Attribute { @@ -86,6 +94,8 @@ message Schema { bool optional = 5; bool computed = 6; bool sensitive = 7; + StringKind description_kind = 8; + bool deprecated = 9; } message NestedBlock { @@ -145,6 +155,7 @@ message GetProviderSchema { map resource_schemas = 2; map data_source_schemas = 3; repeated Diagnostic diagnostics = 4; + Schema provider_meta = 5; } } @@ -220,6 +231,7 @@ message ReadResource { string type_name = 1; DynamicValue current_state = 2; bytes private = 3; + DynamicValue provider_meta = 4; } message Response { DynamicValue new_state = 1; @@ -235,6 +247,7 @@ message PlanResourceChange { DynamicValue proposed_new_state = 3; DynamicValue config = 4; bytes prior_private = 5; + DynamicValue provider_meta = 6; } message Response { @@ -266,6 +279,7 @@ message ApplyResourceChange { DynamicValue planned_state = 3; DynamicValue config = 4; bytes planned_private = 5; + DynamicValue provider_meta = 6; } message Response { DynamicValue new_state = 1; @@ -309,6 +323,7 @@ message ReadDataSource { message Request { string type_name = 1; DynamicValue config = 2; + DynamicValue provider_meta = 3; } message Response { DynamicValue state = 1; diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/version/version.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/version/version.go index 7341b5339..2d56dab69 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/version/version.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/version/version.go @@ -27,10 +27,6 @@ func init() { SemVer = version.Must(version.NewVersion(Version)) } -// Header is the header name used to send the current terraform version -// in http requests. -const Header = "Terraform-Version" - // String returns the complete version string, including prerelease func String() string { if Prerelease != "" { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/meta/meta.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/meta/meta.go new file mode 100644 index 000000000..345d1cab6 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/meta/meta.go @@ -0,0 +1,36 @@ +// The meta package provides a location to set the release version +// and any other relevant metadata for the SDK. +// +// This package should not import any other SDK packages. +package meta + +import ( + "fmt" + + version "github.com/hashicorp/go-version" +) + +// The main version number that is being run at the moment. +var SDKVersion = "1.12.0" + +// A pre-release marker for the version. If this is "" (empty string) +// then it means that it is a final release. Otherwise, this is a pre-release +// such as "dev" (in development), "beta", "rc1", etc. +var SDKPrerelease = "" + +// SemVer is an instance of version.Version. This has the secondary +// benefit of verifying during tests and init time that our version is a +// proper semantic version, which should always be the case. +var SemVer *version.Version + +func init() { + SemVer = version.Must(version.NewVersion(SDKVersion)) +} + +// VersionString returns the complete version string, including prerelease +func SDKVersionString() string { + if SDKPrerelease != "" { + return fmt.Sprintf("%s-%s", SDKVersion, SDKPrerelease) + } + return SDKVersion +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/context_input.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/context_input.go index b92fce120..b99f1afac 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/context_input.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/context_input.go @@ -6,8 +6,8 @@ import ( "log" "sort" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/diff.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/diff.go index e2f54883b..fd5b389b0 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/diff.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/diff.go @@ -303,7 +303,7 @@ func (d *ModuleDiff) String() string { var buf bytes.Buffer names := make([]string, 0, len(d.Resources)) - for name, _ := range d.Resources { + for name := range d.Resources { names = append(names, name) } sort.Strings(names) @@ -335,7 +335,7 @@ func (d *ModuleDiff) String() string { keyLen := 0 rdiffAttrs := rdiff.CopyAttributes() keys := make([]string, 0, len(rdiffAttrs)) - for key, _ := range rdiffAttrs { + for key := range rdiffAttrs { if key == "id" { continue } @@ -1242,7 +1242,7 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) { // Found it! Ignore all of these. The prefix here is stripping // off the "%" so it is just "k." prefix := k[:len(k)-1] - for k2, _ := range d.Attributes { + for k2 := range d.Attributes { if strings.HasPrefix(k2, prefix) { ignoreAttrs[k2] = struct{}{} } @@ -1282,17 +1282,17 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) { // same attributes. To start, build up the check map to be all the keys. checkOld := make(map[string]struct{}) checkNew := make(map[string]struct{}) - for k, _ := range d.Attributes { + for k := range d.Attributes { checkOld[k] = struct{}{} } - for k, _ := range d2.CopyAttributes() { + for k := range d2.CopyAttributes() { checkNew[k] = struct{}{} } // Make an ordered list so we are sure the approximated hashes are left // to process at the end of the loop keys := make([]string, 0, len(d.Attributes)) - for k, _ := range d.Attributes { + for k := range d.Attributes { keys = append(keys, k) } sort.StringSlice(keys).Sort() @@ -1350,7 +1350,7 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) { return false, fmt.Sprintf("regexp failed to compile; err: %#v", err) } - for k2, _ := range checkNew { + for k2 := range checkNew { if re.MatchString(k2) { delete(checkNew, k2) } @@ -1387,12 +1387,12 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) { // This is a computed list, set, or map, so remove any keys with // this prefix from the check list. kprefix := k[:len(k)-matchLen] - for k2, _ := range checkOld { + for k2 := range checkOld { if strings.HasPrefix(k2, kprefix) { delete(checkOld, k2) } } - for k2, _ := range checkNew { + for k2 := range checkNew { if strings.HasPrefix(k2, kprefix) { delete(checkNew, k2) } @@ -1412,7 +1412,7 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) { // Check for leftover attributes if len(checkNew) > 0 { extras := make([]string, 0, len(checkNew)) - for attr, _ := range checkNew { + for attr := range checkNew { extras = append(extras, attr) } return false, diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_apply.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_apply.go index eb0d4fea2..6beeaea98 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_apply.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_apply.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" @@ -70,6 +70,13 @@ func (n *EvalApply) Eval(ctx EvalContext) (interface{}, error) { } } + if !configVal.IsWhollyKnown() { + return nil, fmt.Errorf( + "configuration for %s still contains unknown values during apply (this is a bug in Terraform; please report it!)", + absAddr, + ) + } + log.Printf("[DEBUG] %s: applying the planned %s change", n.Addr.Absolute(ctx.Path()), change.Action) resp := provider.ApplyResourceChange(providers.ApplyResourceChangeRequest{ TypeName: n.Addr.Resource.Type, diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_check_prevent_destroy.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_check_prevent_destroy.go index bcc3c531b..d13a96529 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_check_prevent_destroy.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_check_prevent_destroy.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/internal/plans" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context.go index ac3543504..4fa011e2b 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context.go @@ -1,7 +1,7 @@ package terraform import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/hashicorp/terraform-plugin-sdk/internal/lang" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context_builtin.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context_builtin.go index 7347a80df..bd414a960 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context_builtin.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context_builtin.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/internal/states" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/hashicorp/terraform-plugin-sdk/internal/lang" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context_mock.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context_mock.go index b7b8722de..786316fb3 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context_mock.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_context_mock.go @@ -1,8 +1,8 @@ package terraform import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/hashicorp/terraform-plugin-sdk/internal/lang" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_count.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_count.go index 52205fec0..7d6fa4919 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_count.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_count.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" "github.com/zclconf/go-cty/cty" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_diff.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_diff.go index afab57909..d6f51c950 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_diff.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_diff.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_for_each.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_for_each.go index 4f7c340d2..a63389a91 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_for_each.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_for_each.go @@ -3,7 +3,7 @@ package terraform import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" "github.com/zclconf/go-cty/cty" ) @@ -19,7 +19,7 @@ func evaluateResourceForEachExpression(expr hcl.Expression, ctx EvalContext) (fo // Attach a diag as we do with count, with the same downsides diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, - Summary: "Invalid forEach argument", + Summary: "Invalid for_each argument", Detail: `The "for_each" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first apply only the resources that the for_each depends on.`, Subject: expr.Range().Ptr(), }) @@ -81,6 +81,14 @@ func evaluateResourceForEachExpressionKnown(expr hcl.Expression, ctx EvalContext }) return nil, true, diags } + + // A set may contain unknown values that must be + // discovered by checking with IsWhollyKnown (which iterates through the + // structure), while for maps in cty, keys can never be unknown or null, + // thus the earlier IsKnown check suffices for maps + if !forEachVal.IsWhollyKnown() { + return map[string]cty.Value{}, false, diags + } } return forEachVal.AsValueMap(), true, nil diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_lang.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_lang.go index fe99847b2..5ab6b44f5 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_lang.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_lang.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_local.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_local.go index 28eaf5fd9..031019380 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_local.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_local.go @@ -3,7 +3,7 @@ package terraform import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_output.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_output.go index 6d2db068c..9f71e92f6 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_output.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_output.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_provider.go index 9c29aafd8..7440cff7a 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_provider.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_validate.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_validate.go index e11cac7fa..a4f28bd90 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_validate.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_validate.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_validate_selfref.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_validate_selfref.go index ae883b422..c9cc0e6da 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_validate_selfref.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_validate_selfref.go @@ -3,7 +3,7 @@ package terraform import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_variable.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_variable.go index 0df4a4afc..79f44b3fe 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_variable.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/eval_variable.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" "github.com/zclconf/go-cty/cty" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/evaluate.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/evaluate.go index 81645d7d3..2d3eabd48 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/evaluate.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/evaluate.go @@ -2,14 +2,12 @@ package terraform import ( "fmt" - "log" "os" "path/filepath" - "strconv" "sync" "github.com/agext/levenshtein" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" @@ -507,14 +505,8 @@ func (d *evaluationStateData) GetPathAttr(addr addrs.PathAttr, rng tfdiags.Sourc } } -func (d *evaluationStateData) GetResourceInstance(addr addrs.ResourceInstance, rng tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) { +func (d *evaluationStateData) GetResource(addr addrs.Resource, rng tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) { var diags tfdiags.Diagnostics - - // Although we are giving a ResourceInstance address here, if it has - // a key of addrs.NoKey then it might actually be a request for all of - // the instances of a particular resource. The reference resolver can't - // resolve the ambiguity itself, so we must do it in here. - // First we'll consult the configuration to see if an resource of this // name is declared at all. moduleAddr := d.ModulePath @@ -525,36 +517,21 @@ func (d *evaluationStateData) GetResourceInstance(addr addrs.ResourceInstance, r panic(fmt.Sprintf("resource value read from %s, which has no configuration", moduleAddr)) } - config := moduleConfig.Module.ResourceByAddr(addr.ContainingResource()) + config := moduleConfig.Module.ResourceByAddr(addr) if config == nil { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: `Reference to undeclared resource`, - Detail: fmt.Sprintf(`A resource %q %q has not been declared in %s`, addr.Resource.Type, addr.Resource.Name, moduleDisplayAddr(moduleAddr)), + Detail: fmt.Sprintf(`A resource %q %q has not been declared in %s`, addr.Type, addr.Name, moduleDisplayAddr(moduleAddr)), Subject: rng.ToHCL().Ptr(), }) return cty.DynamicVal, diags } - // First we'll find the state for the resource as a whole, and decide - // from there whether we're going to interpret the given address as a - // resource or a resource instance address. - rs := d.Evaluator.State.Resource(addr.ContainingResource().Absolute(d.ModulePath)) + rs := d.Evaluator.State.Resource(addr.Absolute(d.ModulePath)) if rs == nil { - schema := d.getResourceSchema(addr.ContainingResource(), config.ProviderConfigAddr().Absolute(d.ModulePath)) - - // If it doesn't exist at all then we can't reliably determine whether - // single-instance or whole-resource interpretation was intended, but - // we can decide this partially... - if addr.Key != addrs.NoKey { - // If there's an instance key then the user must be intending - // single-instance interpretation, and so we can return a - // properly-typed unknown value to help with type checking. - return cty.UnknownVal(schema.ImpliedType()), diags - } - - // otherwise we must return DynamicVal so that both interpretations + // we must return DynamicVal so that both interpretations // can proceed without generating errors, and we'll deal with this // in a later step where more information is gathered. // (In practice we should only end up here during the validate walk, @@ -569,69 +546,15 @@ func (d *evaluationStateData) GetResourceInstance(addr addrs.ResourceInstance, r return cty.DynamicVal, diags } - schema := d.getResourceSchema(addr.ContainingResource(), rs.ProviderConfig) - - // If we are able to automatically convert to the "right" type of instance - // key for this each mode then we'll do so, to match with how we generally - // treat values elsewhere in the language. This allows code below to - // assume that any possible conversions have already been dealt with and - // just worry about validation. - key := d.coerceInstanceKey(addr.Key, rs.EachMode) - - multi := false - - switch rs.EachMode { - case states.NoEach: - if key != addrs.NoKey { - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid resource index", - Detail: fmt.Sprintf("Resource %s does not have either \"count\" or \"for_each\" set, so it cannot be indexed.", addr.ContainingResource()), - Subject: rng.ToHCL().Ptr(), - }) - return cty.DynamicVal, diags - } - case states.EachList: - multi = key == addrs.NoKey - if _, ok := addr.Key.(addrs.IntKey); !multi && !ok { - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid resource index", - Detail: fmt.Sprintf("Resource %s must be indexed with a number value.", addr.ContainingResource()), - Subject: rng.ToHCL().Ptr(), - }) - return cty.DynamicVal, diags - } - case states.EachMap: - multi = key == addrs.NoKey - if _, ok := addr.Key.(addrs.StringKey); !multi && !ok { - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid resource index", - Detail: fmt.Sprintf("Resource %s must be indexed with a string value.", addr.ContainingResource()), - Subject: rng.ToHCL().Ptr(), - }) - return cty.DynamicVal, diags - } - } - - if !multi { - log.Printf("[TRACE] GetResourceInstance: %s is a single instance", addr) - is := rs.Instance(key) - if is == nil { - return cty.UnknownVal(schema.ImpliedType()), diags - } - return d.getResourceInstanceSingle(addr, rng, is, config, rs.ProviderConfig) - } - - log.Printf("[TRACE] GetResourceInstance: %s has multiple keyed instances", addr) - return d.getResourceInstancesAll(addr.ContainingResource(), rng, config, rs, rs.ProviderConfig) + return d.getResourceInstancesAll(addr, rng, config, rs, rs.ProviderConfig) } -func (d *evaluationStateData) getResourceInstanceSingle(addr addrs.ResourceInstance, rng tfdiags.SourceRange, is *states.ResourceInstance, config *configs.Resource, providerAddr addrs.AbsProviderConfig) (cty.Value, tfdiags.Diagnostics) { +func (d *evaluationStateData) getResourceInstancesAll(addr addrs.Resource, rng tfdiags.SourceRange, config *configs.Resource, rs *states.Resource, providerAddr addrs.AbsProviderConfig) (cty.Value, tfdiags.Diagnostics) { var diags tfdiags.Diagnostics - schema := d.getResourceSchema(addr.ContainingResource(), providerAddr) + instAddr := addrs.ResourceInstance{Resource: addr, Key: addrs.NoKey} + + schema := d.getResourceSchema(addr, providerAddr) if schema == nil { // This shouldn't happen, since validation before we get here should've // taken care of it, but we'll show a reasonable error message anyway. @@ -644,75 +567,59 @@ func (d *evaluationStateData) getResourceInstanceSingle(addr addrs.ResourceInsta return cty.DynamicVal, diags } - ty := schema.ImpliedType() - if is == nil || is.Current == nil { - // Assume we're dealing with an instance that hasn't been created yet. - return cty.UnknownVal(ty), diags - } + switch rs.EachMode { + case states.NoEach: + ty := schema.ImpliedType() + is := rs.Instances[addrs.NoKey] + if is == nil || is.Current == nil { + // Assume we're dealing with an instance that hasn't been created yet. + return cty.UnknownVal(ty), diags + } - if is.Current.Status == states.ObjectPlanned { - // If there's a pending change for this instance in our plan, we'll prefer - // that. This is important because the state can't represent unknown values - // and so its data is inaccurate when changes are pending. - if change := d.Evaluator.Changes.GetResourceInstanceChange(addr.Absolute(d.ModulePath), states.CurrentGen); change != nil { - val, err := change.After.Decode(ty) - if err != nil { + if is.Current.Status == states.ObjectPlanned { + // If there's a pending change for this instance in our plan, we'll prefer + // that. This is important because the state can't represent unknown values + // and so its data is inaccurate when changes are pending. + if change := d.Evaluator.Changes.GetResourceInstanceChange(instAddr.Absolute(d.ModulePath), states.CurrentGen); change != nil { + val, err := change.After.Decode(ty) + if err != nil { + diags = diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid resource instance data in plan", + Detail: fmt.Sprintf("Instance %s data could not be decoded from the plan: %s.", addr.Absolute(d.ModulePath), err), + Subject: &config.DeclRange, + }) + return cty.UnknownVal(ty), diags + } + return val, diags + } else { + // If the object is in planned status then we should not + // get here, since we should've found a pending value + // in the plan above instead. diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, - Summary: "Invalid resource instance data in plan", - Detail: fmt.Sprintf("Instance %s data could not be decoded from the plan: %s.", addr.Absolute(d.ModulePath), err), + Summary: "Missing pending object in plan", + Detail: fmt.Sprintf("Instance %s is marked as having a change pending but that change is not recorded in the plan. This is a bug in Terraform; please report it.", addr), Subject: &config.DeclRange, }) return cty.UnknownVal(ty), diags } - return val, diags - } else { - // If the object is in planned status then we should not - // get here, since we should've found a pending value - // in the plan above instead. + } + + ios, err := is.Current.Decode(ty) + if err != nil { + // This shouldn't happen, since by the time we get here + // we should've upgraded the state data already. diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, - Summary: "Missing pending object in plan", - Detail: fmt.Sprintf("Instance %s is marked as having a change pending but that change is not recorded in the plan. This is a bug in Terraform; please report it.", addr), + Summary: "Invalid resource instance data in state", + Detail: fmt.Sprintf("Instance %s data could not be decoded from the state: %s.", addr.Absolute(d.ModulePath), err), Subject: &config.DeclRange, }) return cty.UnknownVal(ty), diags } - } - - ios, err := is.Current.Decode(ty) - if err != nil { - // This shouldn't happen, since by the time we get here - // we should've upgraded the state data already. - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid resource instance data in state", - Detail: fmt.Sprintf("Instance %s data could not be decoded from the state: %s.", addr.Absolute(d.ModulePath), err), - Subject: &config.DeclRange, - }) - return cty.UnknownVal(ty), diags - } - - return ios.Value, diags -} -func (d *evaluationStateData) getResourceInstancesAll(addr addrs.Resource, rng tfdiags.SourceRange, config *configs.Resource, rs *states.Resource, providerAddr addrs.AbsProviderConfig) (cty.Value, tfdiags.Diagnostics) { - var diags tfdiags.Diagnostics - - schema := d.getResourceSchema(addr, providerAddr) - if schema == nil { - // This shouldn't happen, since validation before we get here should've - // taken care of it, but we'll show a reasonable error message anyway. - diags = diags.Append(&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: `Missing resource type schema`, - Detail: fmt.Sprintf("No schema is available for %s in %s. This is a bug in Terraform and should be reported.", addr, providerAddr), - Subject: rng.ToHCL().Ptr(), - }) - return cty.DynamicVal, diags - } - - switch rs.EachMode { + return ios.Value, diags case states.EachList: // We need to infer the length of our resulting tuple by searching @@ -866,43 +773,6 @@ func (d *evaluationStateData) getResourceSchema(addr addrs.Resource, providerAdd return schema } -// coerceInstanceKey attempts to convert the given key to the type expected -// for the given EachMode. -// -// If the key is already of the correct type or if it cannot be converted then -// it is returned verbatim. If conversion is required and possible, the -// converted value is returned. Callers should not try to determine if -// conversion was possible, should instead just check if the result is of -// the expected type. -func (d *evaluationStateData) coerceInstanceKey(key addrs.InstanceKey, mode states.EachMode) addrs.InstanceKey { - if key == addrs.NoKey { - // An absent key can't be converted - return key - } - - switch mode { - case states.NoEach: - // No conversions possible at all - return key - case states.EachMap: - if intKey, isInt := key.(addrs.IntKey); isInt { - return addrs.StringKey(strconv.Itoa(int(intKey))) - } - return key - case states.EachList: - if strKey, isStr := key.(addrs.StringKey); isStr { - i, err := strconv.Atoi(string(strKey)) - if err != nil { - return key - } - return addrs.IntKey(i) - } - return key - default: - return key - } -} - func (d *evaluationStateData) GetTerraformAttr(addr addrs.TerraformAttr, rng tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) { var diags tfdiags.Diagnostics switch addr.Name { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/evaluate_valid.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/evaluate_valid.go index 6badb1543..35a8be0c9 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/evaluate_valid.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/evaluate_valid.go @@ -4,7 +4,7 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/graph_builder_apply.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/graph_builder_apply.go index a4041d133..918987610 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/graph_builder_apply.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/graph_builder_apply.go @@ -127,21 +127,6 @@ func (b *ApplyGraphBuilder) Steps() []GraphTransformer { // Attach the state &AttachStateTransformer{State: b.State}, - // Destruction ordering - &DestroyEdgeTransformer{ - Config: b.Config, - State: b.State, - Schemas: b.Schemas, - }, - GraphTransformIf( - func() bool { return !b.Destroy }, - &CBDEdgeTransformer{ - Config: b.Config, - State: b.State, - Schemas: b.Schemas, - }, - ), - // Provisioner-related transformations &MissingProvisionerTransformer{Provisioners: b.Components.ResourceProvisioners()}, &ProvisionerTransformer{}, @@ -171,6 +156,20 @@ func (b *ApplyGraphBuilder) Steps() []GraphTransformer { // Connect references so ordering is correct &ReferenceTransformer{}, + // Destruction ordering + &DestroyEdgeTransformer{ + Config: b.Config, + State: b.State, + Schemas: b.Schemas, + }, + + &CBDEdgeTransformer{ + Config: b.Config, + State: b.State, + Schemas: b.Schemas, + Destroy: b.Destroy, + }, + // Handle destroy time transformations for output and local values. // Reverse the edges from outputs and locals, so that // interpolations don't fail during destroy. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_data_refresh.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_data_refresh.go index 60bcdb74c..56283c0ac 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_data_refresh.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_data_refresh.go @@ -39,6 +39,7 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er } forEachMap, forEachKnown, forEachDiags := evaluateResourceForEachExpressionKnown(n.Config.ForEach, ctx) + diags = diags.Append(forEachDiags) if forEachDiags.HasErrors() { return nil, diags.Err() } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_module_removed.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_module_removed.go index 441d2632a..6e3cb41dc 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_module_removed.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_module_removed.go @@ -14,6 +14,7 @@ type NodeModuleRemoved struct { var ( _ GraphNodeSubPath = (*NodeModuleRemoved)(nil) + _ RemovableIfNotTargeted = (*NodeModuleRemoved)(nil) _ GraphNodeEvalable = (*NodeModuleRemoved)(nil) _ GraphNodeReferencer = (*NodeModuleRemoved)(nil) _ GraphNodeReferenceOutside = (*NodeModuleRemoved)(nil) @@ -63,6 +64,13 @@ func (n *NodeModuleRemoved) References() []*addrs.Reference { } } +// RemovableIfNotTargeted +func (n *NodeModuleRemoved) RemoveIfNotTargeted() bool { + // We need to add this so that this node will be removed if + // it isn't targeted or a dependency of a target. + return true +} + // EvalCheckModuleRemoved is an EvalNode implementation that verifies that // a module has been removed from the state as expected. type EvalCheckModuleRemoved struct { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_module_variable.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_module_variable.go index 03653359c..76311a56d 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_module_variable.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/node_module_variable.go @@ -1,7 +1,7 @@ package terraform import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" "github.com/hashicorp/terraform-plugin-sdk/internal/dag" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/resource_provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/resource_provider.go index 670bcba20..fec45967f 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/resource_provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/resource_provider.go @@ -23,7 +23,7 @@ type ResourceProvider interface { * Functions related to the provider *********************************************************************/ - // ProviderSchema returns the config schema for the main provider + // GetSchema returns the config schema for the main provider // configuration, as would appear in a "provider" block in the // configuration files. // diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/state.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/state.go index e70e8ab24..98b20be7c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/state.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/state.go @@ -20,8 +20,8 @@ import ( multierror "github.com/hashicorp/go-multierror" uuid "github.com/hashicorp/go-uuid" version "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" @@ -112,6 +112,10 @@ type State struct { Modules []*ModuleState `json:"modules"` mu sync.Mutex + + // IsBinaryDrivenTest is a special flag that assists with a binary driver + // heuristic, it should not be set externally + IsBinaryDrivenTest bool } func (s *State) Lock() { s.mu.Lock() } @@ -1110,7 +1114,7 @@ func (m *ModuleState) View(id string) *ModuleState { } r := m.deepcopy() - for k, _ := range r.Resources { + for k := range r.Resources { if id == k || strings.HasPrefix(k, id+".") { continue } @@ -1197,7 +1201,7 @@ func (m *ModuleState) String() string { } names := make([]string, 0, len(m.Resources)) - for name, _ := range m.Resources { + for name := range m.Resources { names = append(names, name) } @@ -1234,7 +1238,7 @@ func (m *ModuleState) String() string { attributes = rs.Primary.Attributes } attrKeys := make([]string, 0, len(attributes)) - for ak, _ := range attributes { + for ak := range attributes { if ak == "id" { continue } @@ -1269,7 +1273,7 @@ func (m *ModuleState) String() string { buf.WriteString("\nOutputs:\n\n") ks := make([]string, 0, len(m.Outputs)) - for k, _ := range m.Outputs { + for k := range m.Outputs { ks = append(ks, k) } @@ -1284,7 +1288,7 @@ func (m *ModuleState) String() string { buf.WriteString(fmt.Sprintf("%s = %s\n", k, vTyped)) case map[string]interface{}: var mapKeys []string - for key, _ := range vTyped { + for key := range vTyped { mapKeys = append(mapKeys, key) } sort.Strings(mapKeys) @@ -1820,7 +1824,7 @@ func (s *InstanceState) String() string { attributes := s.Attributes attrKeys := make([]string, 0, len(attributes)) - for ak, _ := range attributes { + for ak := range attributes { if ak == "id" { continue } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_config_flat.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_config_flat.go deleted file mode 100644 index 4dbdcb742..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_config_flat.go +++ /dev/null @@ -1,71 +0,0 @@ -package terraform - -import ( - "github.com/hashicorp/terraform-plugin-sdk/internal/configs" - "github.com/hashicorp/terraform-plugin-sdk/internal/dag" -) - -// FlatConfigTransformer is a GraphTransformer that adds the configuration -// to the graph. The module used to configure this transformer must be -// the root module. -// -// This transform adds the nodes but doesn't connect any of the references. -// The ReferenceTransformer should be used for that. -// -// NOTE: In relation to ConfigTransformer: this is a newer generation config -// transformer. It puts the _entire_ config into the graph (there is no -// "flattening" step as before). -type FlatConfigTransformer struct { - Concrete ConcreteResourceNodeFunc // What to turn resources into - - Config *configs.Config -} - -func (t *FlatConfigTransformer) Transform(g *Graph) error { - // We have nothing to do if there is no configuration. - if t.Config == nil { - return nil - } - - return t.transform(g, t.Config) -} - -func (t *FlatConfigTransformer) transform(g *Graph, config *configs.Config) error { - // If we have no configuration then there's nothing to do. - if config == nil { - return nil - } - - // Transform all the children. - for _, c := range config.Children { - if err := t.transform(g, c); err != nil { - return err - } - } - - module := config.Module - // For now we assume that each module call produces only one module - // instance with no key, since we don't yet support "count" and "for_each" - // on modules. - // FIXME: As part of supporting "count" and "for_each" on modules, rework - // this so that we'll "expand" the module call first and then create graph - // nodes for each module instance separately. - instPath := config.Path.UnkeyedInstanceShim() - - for _, r := range module.ManagedResources { - addr := r.Addr().Absolute(instPath) - abstract := &NodeAbstractResource{ - Addr: addr, - Config: r, - } - // Grab the address for this resource - var node dag.Vertex = abstract - if f := t.Concrete; f != nil { - node = f(abstract) - } - - g.Add(node) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_destroy_cbd.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_destroy_cbd.go index 44c606407..98e088eee 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_destroy_cbd.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_destroy_cbd.go @@ -134,9 +134,16 @@ type CBDEdgeTransformer struct { // obtain schema information from providers and provisioners so we can // properly resolve implicit dependencies. Schemas *Schemas + + // If the operation is a simple destroy, no transformation is done. + Destroy bool } func (t *CBDEdgeTransformer) Transform(g *Graph) error { + if t.Destroy { + return nil + } + // Go through and reverse any destroy edges destroyMap := make(map[string][]dag.Vertex) for _, v := range g.Vertices() { @@ -169,6 +176,7 @@ func (t *CBDEdgeTransformer) Transform(g *Graph) error { applyNode := de.Source() destroyNode := de.Target() g.Connect(&DestroyEdge{S: destroyNode, T: applyNode}) + break } // If the address has an index, we strip that. Our depMap creation @@ -201,12 +209,7 @@ func (t *CBDEdgeTransformer) Transform(g *Graph) error { // They key here is that B happens before A is destroyed. This is to // facilitate the primary purpose for CBD: making sure that downstreams // are properly updated to avoid downtime before the resource is destroyed. - // - // We can't trust that the resource being destroyed or anything that - // depends on it is actually in our current graph so we make a new - // graph in order to determine those dependencies and add them in. - log.Printf("[TRACE] CBDEdgeTransformer: building graph to find dependencies...") - depMap, err := t.depMap(destroyMap) + depMap, err := t.depMap(g, destroyMap) if err != nil { return err } @@ -248,26 +251,10 @@ func (t *CBDEdgeTransformer) Transform(g *Graph) error { return nil } -func (t *CBDEdgeTransformer) depMap(destroyMap map[string][]dag.Vertex) (map[string][]dag.Vertex, error) { - // Build the graph of our config, this ensures that all resources - // are present in the graph. - g, diags := (&BasicGraphBuilder{ - Steps: []GraphTransformer{ - &FlatConfigTransformer{Config: t.Config}, - &AttachResourceConfigTransformer{Config: t.Config}, - &AttachStateTransformer{State: t.State}, - &AttachSchemaTransformer{Schemas: t.Schemas}, - &ReferenceTransformer{}, - }, - Name: "CBDEdgeTransformer", - }).Build(nil) - if diags.HasErrors() { - return nil, diags.Err() - } - - // Using this graph, build the list of destroy nodes that each resource - // address should depend on. For example, when we find B, we map the - // address of B to A_d in the "depMap" variable below. +func (t *CBDEdgeTransformer) depMap(g *Graph, destroyMap map[string][]dag.Vertex) (map[string][]dag.Vertex, error) { + // Build the list of destroy nodes that each resource address should depend + // on. For example, when we find B, we map the address of B to A_d in the + // "depMap" variable below. depMap := make(map[string][]dag.Vertex) for _, v := range g.Vertices() { // We're looking for resources. @@ -289,8 +276,10 @@ func (t *CBDEdgeTransformer) depMap(destroyMap map[string][]dag.Vertex) (map[str } // Get the nodes that depend on this on. In the example above: - // finding B in A => B. - for _, v := range g.UpEdges(v).List() { + // finding B in A => B. Since dependencies can span modules, walk all + // descendents of the resource. + des, _ := g.Descendents(v) + for _, v := range des.List() { // We're looking for resources. rn, ok := v.(GraphNodeResource) if !ok { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_destroy_edge.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_destroy_edge.go index ab4ba156d..1d211570f 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_destroy_edge.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_destroy_edge.go @@ -277,5 +277,47 @@ func (t *DestroyEdgeTransformer) Transform(g *Graph) error { } } + return t.pruneResources(g) +} + +// If there are only destroy instances for a particular resource, there's no +// reason for the resource node to prepare the state. Remove Resource nodes so +// that they don't fail by trying to evaluate a resource that is only being +// destroyed along with its dependencies. +func (t *DestroyEdgeTransformer) pruneResources(g *Graph) error { + for _, v := range g.Vertices() { + n, ok := v.(*NodeApplyableResource) + if !ok { + continue + } + + // if there are only destroy dependencies, we don't need this node + des, err := g.Descendents(n) + if err != nil { + return err + } + + descendents := des.List() + nonDestroyInstanceFound := false + for _, v := range descendents { + if _, ok := v.(*NodeApplyableResourceInstance); ok { + nonDestroyInstanceFound = true + break + } + } + + if nonDestroyInstanceFound { + continue + } + + // connect all the through-edges, then delete the node + for _, d := range g.DownEdges(n).List() { + for _, u := range g.UpEdges(n).List() { + g.Connect(dag.BasicEdge(u, d)) + } + } + log.Printf("DestroyEdgeTransformer: pruning unused resource node %s", dag.VertexName(n)) + g.Remove(n) + } return nil } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_diff.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_diff.go index 773aad7c4..b7a237fce 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_diff.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_diff.go @@ -174,14 +174,6 @@ func (t *DiffTransformer) Transform(g *Graph) error { log.Printf("[TRACE] DiffTransformer: %s deposed object %s will be represented for destruction by %s", addr, dk, dag.VertexName(node)) } g.Add(node) - rsrcAddr := addr.ContainingResource().String() - for _, rsrcNode := range resourceNodes[rsrcAddr] { - // We connect this edge "forwards" (even though destroy dependencies - // are often inverted) because evaluating the resource node - // after the destroy node could cause an unnecessary husk of - // a resource state to be re-added. - g.Connect(dag.BasicEdge(node, rsrcNode)) - } } } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_import_provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_import_provider.go index aa00e020d..2ce23ddbe 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_import_provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_import_provider.go @@ -3,7 +3,7 @@ package terraform import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_module_variable.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_module_variable.go index 1b6531fe1..caa4b6a63 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_module_variable.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_module_variable.go @@ -3,11 +3,11 @@ package terraform import ( "fmt" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" "github.com/zclconf/go-cty/cty" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" ) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_provider.go index 77af1fbb2..9c8966fac 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_provider.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" "github.com/hashicorp/terraform-plugin-sdk/internal/dag" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_reference.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_reference.go index 8ae1fa75e..54f9829c7 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_reference.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/transform_reference.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/addrs" "github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema" "github.com/hashicorp/terraform-plugin-sdk/internal/dag" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/variables.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/variables.go index 0b0c1d28d..4ae9c92cf 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/variables.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/variables.go @@ -3,7 +3,7 @@ package terraform import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/version_required.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/version_required.go index d2ee48160..4cc3bbba6 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/version_required.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/terraform/version_required.go @@ -3,7 +3,7 @@ package terraform import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags" "github.com/hashicorp/terraform-plugin-sdk/internal/configs" diff --git a/vendor/github.com/hashicorp/hil/LICENSE b/vendor/github.com/hashicorp/terraform-plugin-test/LICENSE similarity index 100% rename from vendor/github.com/hashicorp/hil/LICENSE rename to vendor/github.com/hashicorp/terraform-plugin-test/LICENSE diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/README.md b/vendor/github.com/hashicorp/terraform-plugin-test/README.md new file mode 100644 index 000000000..48abe71e9 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/README.md @@ -0,0 +1,4 @@ +# Terraform Plugin Test Helper Library + +This is an **experimental** library for testing Terraform plugins in their +natural habitat as child processes of a real `terraform` executable. diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/config.go b/vendor/github.com/hashicorp/terraform-plugin-test/config.go new file mode 100644 index 000000000..a40460e9b --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/config.go @@ -0,0 +1,60 @@ +package tftest + +import ( + "fmt" + "os" + "path/filepath" +) + +// Config is used to configure the test helper. In most normal test programs +// the configuration is discovered automatically by an Init* function using +// DiscoverConfig, but this is exposed so that more complex scenarios can be +// implemented by direct configuration. +type Config struct { + PluginName string + SourceDir string + TerraformExec string + CurrentPluginExec string + PreviousPluginExec string +} + +// DiscoverConfig uses environment variables and other means to automatically +// discover a reasonable test helper configuration. +func DiscoverConfig(pluginName string, sourceDir string) (*Config, error) { + var tfExec string + var err error + tfVersion := os.Getenv("TF_ACC_TERRAFORM_VERSION") + if tfVersion == "" { + tfExec = FindTerraform() + if tfExec == "" { + return nil, fmt.Errorf("unable to find 'terraform' executable for testing; either place it in PATH or set TF_ACC_TERRAFORM_PATH explicitly to a direct executable path") + } + } else { + tfExec, err = InstallTerraform(tfVersion) + if err != nil { + return nil, fmt.Errorf("could not install Terraform version %s: %s", tfVersion, err) + } + } + + prevExec := os.Getenv("TF_ACC_PREVIOUS_EXEC") + if prevExec != "" { + if info, err := os.Stat(prevExec); err != nil { + return nil, fmt.Errorf("TF_ACC_PREVIOUS_EXEC of %s cannot be used: %s", prevExec, err) + } else if info.IsDir() { + return nil, fmt.Errorf("TF_ACC_PREVIOUS_EXEC of %s is directory, not file", prevExec) + } + } + + absPluginExecPath, err := filepath.Abs(os.Args[0]) + if err != nil { + return nil, fmt.Errorf("could not resolve plugin exec path %s: %s", os.Args[0], err) + } + + return &Config{ + PluginName: pluginName, + SourceDir: sourceDir, + TerraformExec: tfExec, + CurrentPluginExec: absPluginExecPath, + PreviousPluginExec: os.Getenv("TF_ACC_PREVIOUS_EXEC"), + }, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/doc.go b/vendor/github.com/hashicorp/terraform-plugin-test/doc.go new file mode 100644 index 000000000..3b120c679 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/doc.go @@ -0,0 +1,7 @@ +// Package tftest contains utilities to help with writing tests for +// Terraform plugins. +// +// This is not a package for testing configurations or modules written in the +// Terraform language. It is for testing the plugins that allow Terraform to +// manage various cloud services and other APIs. +package tftest diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/go.mod b/vendor/github.com/hashicorp/terraform-plugin-test/go.mod new file mode 100644 index 000000000..1c3c29a15 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/go.mod @@ -0,0 +1,8 @@ +module github.com/hashicorp/terraform-plugin-test + +go 1.12 + +require ( + github.com/hashicorp/go-getter v1.4.0 + github.com/hashicorp/terraform-json v0.4.0 +) diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/go.sum b/vendor/github.com/hashicorp/terraform-plugin-test/go.sum new file mode 100644 index 000000000..9d69283aa --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/go.sum @@ -0,0 +1,170 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/aws/aws-sdk-go v1.15.78 h1:LaXy6lWR0YK7LKyuU0QWy2ws/LWTPfYV/UgfiBu4tvY= +github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +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/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw= +github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/terraform-json v0.4.0 h1:KNh29iNxozP5adfUFBJ4/fWd0Cu3taGgjHB38JYqOF4= +github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +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/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +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/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= +github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= +github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +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= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/guard.go b/vendor/github.com/hashicorp/terraform-plugin-test/guard.go new file mode 100644 index 000000000..a8fe56303 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/guard.go @@ -0,0 +1,110 @@ +package tftest + +import ( + "fmt" + "os" + "testing" +) + +// AcceptanceTest is a test guard that will produce a log and call SkipNow on +// the given TestControl if the environment variable TF_ACC isn't set to +// indicate that the caller wants to run acceptance tests. +// +// Call this immediately at the start of each acceptance test function to +// signal that it may cost money and thus requires this opt-in enviromment +// variable. +// +// For the purpose of this function, an "acceptance test" is any est that +// reaches out to services that are not directly controlled by the test program +// itself, particularly if those requests may lead to service charges. For any +// system where it is possible and realistic to run a local instance of the +// service for testing (e.g. in a daemon launched by the test program itself), +// prefer to do this and _don't_ call AcceptanceTest, thus allowing tests to be +// run more easily and without external cost by contributors. +func AcceptanceTest(t TestControl) { + t.Helper() + if os.Getenv("TF_ACC") != "" { + t.Log("TF_ACC is not set") + t.SkipNow() + } +} + +// LongTest is a test guard that will produce a log and call SkipNow on the +// given TestControl if the test harness is currently running in "short mode". +// +// What is considered a "long test" will always be pretty subjective, but test +// implementers should think of this in terms of what seems like it'd be +// inconvenient to run repeatedly for quick feedback while testing a new feature +// under development. +// +// When testing resource types that always take several minutes to complete +// operations, consider having a single general test that covers the basic +// functionality and then mark any other more specific tests as long tests so +// that developers can quickly smoke-test a particular feature when needed +// but can still run the full set of tests for a feature when needed. +func LongTest(t TestControl) { + t.Helper() + if testing.Short() { + t.Log("skipping long test because of short mode") + t.SkipNow() + } +} + +// RequirePreviousVersion is a test guard that will produce a log and call +// SkipNow on the given TestControl if the receiving Helper does not have a +// previous plugin version to test against. +// +// Call this immediately at the start of any "upgrade test" that expects to +// be able to run some operations with a previous version of the plugin before +// "upgrading" to the current version under test to continue with other +// operations. +func (h *Helper) RequirePreviousVersion(t TestControl) { + t.Helper() + if !h.HasPreviousVersion() { + t.Log("no previous plugin version available") + t.SkipNow() + } +} + +// TestControl is an interface requiring a subset of *testing.T which is used +// by the test guards and helpers in this package. Most callers can simply +// pass their *testing.T value here, but the interface allows other +// implementations to potentially be provided instead, for example to allow +// meta-testing (testing of the test utilities themselves). +// +// This interface also describes the subset of normal test functionality the +// guards and helpers can perform: they can only create log lines, fail tests, +// and skip tests. All other test control is the responsibility of the main +// test code. +type TestControl interface { + Helper() + Log(args ...interface{}) + FailNow() + SkipNow() +} + +// testingT wraps a TestControl to recover some of the convenience behaviors +// that would normally come from a real *testing.T, so we can keep TestControl +// small while still having these conveniences. This is an abstraction +// inversion, but accepted because it makes the public API more convenient +// without any considerable disadvantage. +type testingT struct { + TestControl +} + +func (t testingT) Logf(f string, args ...interface{}) { + t.Helper() + t.Log(fmt.Sprintf(f, args...)) +} + +func (t testingT) Fatalf(f string, args ...interface{}) { + t.Helper() + t.Log(fmt.Sprintf(f, args...)) + t.FailNow() +} + +func (t testingT) Skipf(f string, args ...interface{}) { + t.Helper() + t.Log(fmt.Sprintf(f, args...)) + t.SkipNow() +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/helper.go b/vendor/github.com/hashicorp/terraform-plugin-test/helper.go new file mode 100644 index 000000000..8a519aaf0 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/helper.go @@ -0,0 +1,290 @@ +package tftest + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "runtime" + "strings" + + getter "github.com/hashicorp/go-getter" +) + +const subprocessCurrentSigil = "4acd63807899403ca4859f5bb948d2c6" +const subprocessPreviousSigil = "2279afb8cf71423996be1fd65d32f13b" + +// AutoInitProviderHelper is the main entrypoint for testing provider plugins +// using this package. It is intended to be called during TestMain to prepare +// for provider testing. +// +// AutoInitProviderHelper will discover the location of a current Terraform CLI +// executable to test against, detect whether a prior version of the plugin is +// available for upgrade tests, and then will return an object containing the +// results of that initialization which can then be stored in a global variable +// for use in other tests. +func AutoInitProviderHelper(name string, sourceDir string) *Helper { + helper, err := AutoInitHelper("terraform-provider-"+name, sourceDir) + if err != nil { + fmt.Fprintf(os.Stderr, "cannot run Terraform provider tests: %s\n", err) + os.Exit(1) + } + return helper +} + +// Helper is intended as a per-package singleton created in TestMain which +// other tests in a package can use to create Terraform execution contexts +type Helper struct { + baseDir string + + // sourceDir is the dir containing the provider source code, needed + // for tests that use fixture files. + sourceDir string + pluginName string + terraformExec string + thisPluginDir, prevPluginDir string +} + +// AutoInitHelper uses the auto-discovery behavior of DiscoverConfig to prepare +// a configuration and then calls InitHelper with it. This is a convenient +// way to get the standard init behavior based on environment variables, and +// callers should use this unless they have an unusual requirement that calls +// for constructing a config in a different way. +func AutoInitHelper(pluginName string, sourceDir string) (*Helper, error) { + config, err := DiscoverConfig(pluginName, sourceDir) + if err != nil { + return nil, err + } + + return InitHelper(config) +} + +// InitHelper prepares a testing helper with the given configuration. +// +// For most callers it is sufficient to call AutoInitHelper instead, which +// will construct a configuration automatically based on certain environment +// variables. +// +// If this function returns an error then it may have left some temporary files +// behind in the system's temporary directory. There is currently no way to +// automatically clean those up. +func InitHelper(config *Config) (*Helper, error) { + tempDir := os.Getenv("TF_ACC_TEMP_DIR") + baseDir, err := ioutil.TempDir(tempDir, "tftest-"+config.PluginName) + if err != nil { + return nil, fmt.Errorf("failed to create temporary directory for test helper: %s", err) + } + + var thisPluginDir, prevPluginDir string + if config.CurrentPluginExec != "" { + thisPluginDir, err = ioutil.TempDir(baseDir, "plugins-current") + if err != nil { + return nil, fmt.Errorf("failed to create temporary directory for -plugin-dir: %s", err) + } + currentExecPath := filepath.Join(thisPluginDir, config.PluginName) + err = symlinkFile(config.CurrentPluginExec, currentExecPath) + if err != nil { + return nil, fmt.Errorf("failed to create symlink at %s to %s: %s", currentExecPath, config.CurrentPluginExec, err) + } + + err = symlinkAuxiliaryProviders(thisPluginDir) + if err != nil { + return nil, fmt.Errorf("failed to symlink auxiliary providers: %s", err) + } + } else { + return nil, fmt.Errorf("CurrentPluginExec is not set") + } + if config.PreviousPluginExec != "" { + prevPluginDir, err = ioutil.TempDir(baseDir, "plugins-previous") + if err != nil { + return nil, fmt.Errorf("failed to create temporary directory for previous -plugin-dir: %s", err) + } + prevExecPath := filepath.Join(prevPluginDir, config.PluginName) + err = symlinkFile(config.PreviousPluginExec, prevExecPath) + if err != nil { + return nil, fmt.Errorf("failed to create symlink at %s to %s: %s", prevExecPath, config.PreviousPluginExec, err) + } + + err = symlinkAuxiliaryProviders(prevPluginDir) + if err != nil { + return nil, fmt.Errorf("failed to symlink auxiliary providers: %s", err) + } + } + + return &Helper{ + baseDir: baseDir, + sourceDir: config.SourceDir, + pluginName: config.PluginName, + terraformExec: config.TerraformExec, + thisPluginDir: thisPluginDir, + prevPluginDir: prevPluginDir, + }, nil +} + +// symlinkAuxiliaryProviders discovers auxiliary provider binaries, used in +// multi-provider tests, and symlinks them to the plugin directory. +// +// Auxiliary provider binaries should be included in the provider source code +// directory, under the path terraform.d/plugins/$GOOS_$GOARCH/provider-name. +// +// The environment variable TF_ACC_PROVIDER_ROOT_DIR must be set to the path of +// the provider source code directory root in order to use this feature. +func symlinkAuxiliaryProviders(pluginDir string) error { + providerRootDir := os.Getenv("TF_ACC_PROVIDER_ROOT_DIR") + if providerRootDir == "" { + // common case; assume intentional and do not log + return nil + } + + _, err := os.Stat(filepath.Join(providerRootDir, "terraform.d", "plugins")) + if os.IsNotExist(err) { + fmt.Printf("No terraform.d/plugins directory found: continuing. Unset TF_ACC_PROVIDER_ROOT_DIR or supply provider binaries in terraform.d/plugins/$GOOS_$GOARCH to disable this message.") + return nil + } else if err != nil { + return fmt.Errorf("Unexpected error: %s", err) + } + + auxiliaryProviderDir := filepath.Join(providerRootDir, "terraform.d", "plugins", runtime.GOOS+"_"+runtime.GOARCH) + + // If we can't os.Stat() terraform.d/plugins/$GOOS_$GOARCH, however, + // assume the omission was unintentional, and error. + _, err = os.Stat(auxiliaryProviderDir) + if os.IsNotExist(err) { + return fmt.Errorf("error finding auxiliary provider dir %s: %s", auxiliaryProviderDir, err) + } else if err != nil { + return fmt.Errorf("Unexpected error: %s", err) + } + + // now find all the providers in that dir and symlink them to the plugin dir + providers, err := ioutil.ReadDir(auxiliaryProviderDir) + if err != nil { + return fmt.Errorf("error reading auxiliary providers: %s", err) + } + + zipDecompressor := new(getter.ZipDecompressor) + + for _, provider := range providers { + filename := provider.Name() + filenameExt := filepath.Ext(filename) + name := strings.TrimSuffix(filename, filenameExt) + path := filepath.Join(auxiliaryProviderDir, name) + symlinkPath := filepath.Join(pluginDir, name) + + // exit early if we have already symlinked this provider + _, err := os.Stat(symlinkPath) + if err == nil { + continue + } + + // if filename ends in .zip, assume it is a zip and extract it + // otherwise assume it is a provider binary + if filenameExt == ".zip" { + _, err = os.Stat(path) + if os.IsNotExist(err) { + zipDecompressor.Decompress(path, filepath.Join(auxiliaryProviderDir, filename), false) + } else if err != nil { + return fmt.Errorf("Unexpected error: %s", err) + } + } + + err = symlinkFile(path, symlinkPath) + if err != nil { + return fmt.Errorf("error symlinking auxiliary provider %s: %s", name, err) + } + } + + return nil +} + +// GetPluginName returns the configured plugin name. +func (h *Helper) GetPluginName() string { + return h.pluginName +} + +// Close cleans up temporary files and directories created to support this +// helper, returning an error if any of the cleanup fails. +// +// Call this before returning from TestMain to minimize the amount of detritus +// left behind in the filesystem after the tests complete. +func (h *Helper) Close() error { + return os.RemoveAll(h.baseDir) +} + +// NewWorkingDir creates a new working directory for use in the implementation +// of a single test, returning a WorkingDir object representing that directory. +// +// If the working directory object is not itself closed by the time the test +// program exits, the Close method on the helper itself will attempt to +// delete it. +func (h *Helper) NewWorkingDir() (*WorkingDir, error) { + dir, err := ioutil.TempDir(h.baseDir, "work") + if err != nil { + return nil, err + } + + // symlink the provider source files into the base directory + err = symlinkDirectoriesOnly(h.sourceDir, dir) + if err != nil { + return nil, err + } + + // symlink the provider binaries into the base directory + err = symlinkDir(h.thisPluginDir, dir) + if err != nil { + return nil, err + } + + return &WorkingDir{ + h: h, + baseArgs: []string{"-no-color"}, + baseDir: dir, + }, nil +} + +// RequireNewWorkingDir is a variant of NewWorkingDir that takes a TestControl +// object and will immediately fail the running test if the creation of the +// working directory fails. +func (h *Helper) RequireNewWorkingDir(t TestControl) *WorkingDir { + t.Helper() + + wd, err := h.NewWorkingDir() + if err != nil { + t := testingT{t} + t.Fatalf("failed to create new working directory: %s", err) + return nil + } + return wd +} + +// HasPreviousVersion returns true if and only if the receiving helper has a +// previous plugin version available for use in tests. +func (h *Helper) HasPreviousVersion() bool { + return h.prevPluginDir != "" +} + +// TerraformExecPath returns the location of the Terraform CLI executable that +// should be used when running tests. +func (h *Helper) TerraformExecPath() string { + return h.terraformExec +} + +// PluginDir returns the directory that should be used as the -plugin-dir when +// running "terraform init" in order to make Terraform detect the current +// version of the plugin. +func (h *Helper) PluginDir() string { + return h.thisPluginDir +} + +// PreviousPluginDir returns the directory that should be used as the -plugin-dir +// when running "terraform init" in order to make Terraform detect the previous +// version of the plugin, if available. +// +// If no previous version is available, this method will panic. Use +// RequirePreviousVersion or HasPreviousVersion to ensure a previous version is +// available before calling this. +func (h *Helper) PreviousPluginDir() string { + if h.prevPluginDir != "" { + panic("PreviousPluginDir not available") + } + return h.prevPluginDir +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/plugin.go b/vendor/github.com/hashicorp/terraform-plugin-test/plugin.go new file mode 100644 index 000000000..4764c6b4c --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/plugin.go @@ -0,0 +1,15 @@ +package tftest + +import ( + "os" +) + +// RunningAsPlugin returns true if it detects the usual Terraform plugin +// detection environment variables, suggesting that the current process is +// being launched as a plugin server. +func RunningAsPlugin() bool { + const cookieVar = "TF_PLUGIN_MAGIC_COOKIE" + const cookieVal = "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2" + + return os.Getenv(cookieVar) == cookieVal +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/terraform.go b/vendor/github.com/hashicorp/terraform-plugin-test/terraform.go new file mode 100644 index 000000000..d2f118e15 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/terraform.go @@ -0,0 +1,163 @@ +package tftest + +import ( + "bytes" + "encoding/json" + "fmt" + getter "github.com/hashicorp/go-getter" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" +) + +const releaseHost = "https://releases.hashicorp.com" + +// FindTerraform attempts to find a Terraform CLI executable for plugin testing. +// +// As a first preference it will look for the environment variable +// TF_ACC_TERRAFORM_PATH and return its value. If that variable is not set, it will +// look in PATH for a program named "terraform" and, if one is found, return +// its absolute path. +// +// If no Terraform executable can be found, the result is the empty string. In +// that case, the test program will usually fail outright. +func FindTerraform() string { + if p := os.Getenv("TF_ACC_TERRAFORM_PATH"); p != "" { + return p + } + p, err := exec.LookPath("terraform") + if err != nil { + return "" + } + return p +} + +func tfURL(version, osName, archName string) string { + return fmt.Sprintf( + "%s/terraform/%s/terraform_%s_%s_%s.zip", + releaseHost, version, version, osName, archName, + ) +} + +// InstallTerraform downloads and decompresses a Terraform CLI executable with +// the specified version, downloaded from the HashiCorp releases page over HTTP. +// +// The version string must match an existing Terraform release semver version, +// e.g. 0.12.5. +// +// The terraform executable is installed to a temporary folder. +// +// FIXME: Temporary folder should be cleaned up after tests have finished. +func InstallTerraform(tfVersion string) (string, error) { + osName := runtime.GOOS + archName := runtime.GOARCH + + var tfDir string + var err error + + tempDir := os.Getenv("TF_ACC_TEMP_DIR") + tfDir, err = ioutil.TempDir(tempDir, "tftest-terraform") + if err != nil { + return "", fmt.Errorf("failed to create temp dir: %s", err) + } + + url := tfURL(tfVersion, osName, archName) + + client := getter.Client{ + Src: url, + Dst: tfDir, + + Mode: getter.ClientModeDir, + } + + err = client.Get() + if err != nil { + return "", fmt.Errorf("failed to download terraform from %s: %s", url, err) + } + + return filepath.Join(tfDir, "terraform"), nil +} + +// getTerraformEnv returns the appropriate Env for the Terraform command. +func getTerraformEnv() []string { + var env []string + for _, e := range os.Environ() { + env = append(env, e) + } + + env = append(env, "TF_DISABLE_PLUGIN_TLS=1") + env = append(env, "TF_SKIP_PROVIDER_VERIFY=1") + + // FIXME: Ideally in testing.Verbose mode we'd turn on Terraform DEBUG + // logging, perhaps redirected to a separate fd other than stderr to avoid + // polluting it, and then propagate the log lines out into t.Log so that + // they are visible to the person running the test. Currently though, + // Terraform CLI is able to send logs only to either an on-disk file or + // to stderr. + env = append(env, "TF_LOG=") // so logging can't pollute our stderr output + env = append(env, "TF_INPUT=0") + + if p := os.Getenv("TF_ACC_LOG_PATH"); p != "" { + env = append(env, "TF_LOG=TRACE") + env = append(env, "TF_LOG_PATH="+p) + } + return env +} + +// RunTerraform runs the configured Terraform CLI executable with the given +// arguments, returning an error if it produces a non-successful exit status. +func (wd *WorkingDir) runTerraform(args ...string) error { + allArgs := []string{"terraform"} + allArgs = append(allArgs, args...) + + env := getTerraformEnv() + + var errBuf strings.Builder + + cmd := &exec.Cmd{ + Path: wd.h.TerraformExecPath(), + Args: allArgs, + Dir: wd.baseDir, + Stderr: &errBuf, + Env: env, + } + err := cmd.Run() + if tErr, ok := err.(*exec.ExitError); ok { + err = fmt.Errorf("terraform failed: %s\n\nstderr:\n%s", tErr.ProcessState.String(), errBuf.String()) + } + return err +} + +// runTerraformJSON runs the configured Terraform CLI executable with the given +// arguments and tries to decode its stdout into the given target value (which +// must be a non-nil pointer) as JSON. +func (wd *WorkingDir) runTerraformJSON(target interface{}, args ...string) error { + allArgs := []string{"terraform"} + allArgs = append(allArgs, args...) + + env := getTerraformEnv() + + var outBuf bytes.Buffer + var errBuf strings.Builder + + cmd := &exec.Cmd{ + Path: wd.h.TerraformExecPath(), + Args: allArgs, + Dir: wd.baseDir, + Stderr: &errBuf, + Stdout: &outBuf, + Env: env, + } + err := cmd.Run() + if err != nil { + if tErr, ok := err.(*exec.ExitError); ok { + err = fmt.Errorf("terraform failed: %s\n\nstderr:\n%s", tErr.ProcessState.String(), errBuf.String()) + } + return err + } + + return json.Unmarshal(outBuf.Bytes(), target) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/util.go b/vendor/github.com/hashicorp/terraform-plugin-test/util.go new file mode 100644 index 000000000..57bc84f2d --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/util.go @@ -0,0 +1,95 @@ +package tftest + +import ( + "os" + "path/filepath" +) + +func symlinkFile(src string, dest string) (err error) { + err = os.Symlink(src, dest) + if err == nil { + srcInfo, err := os.Stat(src) + if err != nil { + err = os.Chmod(dest, srcInfo.Mode()) + } + } + + return +} + +// symlinkDir is a simplistic function for recursively symlinking all files in a directory to a new path. +// It is intended only for limited internal use and does not cover all edge cases. +func symlinkDir(srcDir string, destDir string) (err error) { + srcInfo, err := os.Stat(srcDir) + if err != nil { + return err + } + + err = os.MkdirAll(destDir, srcInfo.Mode()) + if err != nil { + return err + } + + directory, _ := os.Open(srcDir) + defer directory.Close() + objects, err := directory.Readdir(-1) + + for _, obj := range objects { + srcPath := filepath.Join(srcDir, obj.Name()) + destPath := filepath.Join(destDir, obj.Name()) + + if obj.IsDir() { + err = symlinkDir(srcPath, destPath) + if err != nil { + return err + } + } else { + err = symlinkFile(srcPath, destPath) + if err != nil { + return err + } + } + + } + return +} + +// symlinkDirectoriesOnly finds only the first-level child directories in srcDir +// and symlinks them into destDir. +// Unlike symlinkDir, this is done non-recursively in order to limit the number +// of file descriptors used. +func symlinkDirectoriesOnly(srcDir string, destDir string) (err error) { + srcInfo, err := os.Stat(srcDir) + if err != nil { + return err + } + + err = os.MkdirAll(destDir, srcInfo.Mode()) + if err != nil { + return err + } + + directory, err := os.Open(srcDir) + if err != nil { + return err + } + defer directory.Close() + objects, err := directory.Readdir(-1) + if err != nil { + return err + } + + for _, obj := range objects { + srcPath := filepath.Join(srcDir, obj.Name()) + destPath := filepath.Join(destDir, obj.Name()) + + if obj.IsDir() { + err = symlinkFile(srcPath, destPath) + if err != nil { + return err + } + } + + } + return +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-test/working_dir.go b/vendor/github.com/hashicorp/terraform-plugin-test/working_dir.go new file mode 100644 index 000000000..7f64706f1 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-test/working_dir.go @@ -0,0 +1,377 @@ +package tftest + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + + tfjson "github.com/hashicorp/terraform-json" +) + +// WorkingDir represents a distinct working directory that can be used for +// running tests. Each test should construct its own WorkingDir by calling +// NewWorkingDir or RequireNewWorkingDir on its package's singleton +// tftest.Helper. +type WorkingDir struct { + h *Helper + + // baseDir is the root of the working directory tree + baseDir string + + // baseArgs is arguments that should be appended to all commands + baseArgs []string + + // configDir contains the singular config file generated for each test + configDir string +} + +// Close deletes the directories and files created to represent the receiving +// working directory. After this method is called, the working directory object +// is invalid and may no longer be used. +func (wd *WorkingDir) Close() error { + return os.RemoveAll(wd.baseDir) +} + +// SetConfig sets a new configuration for the working directory. +// +// This must be called at least once before any call to Init, Plan, Apply, or +// Destroy to establish the configuration. Any previously-set configuration is +// discarded and any saved plan is cleared. +func (wd *WorkingDir) SetConfig(cfg string) error { + // Each call to SetConfig creates a new directory under our baseDir. + // We create them within so that our final cleanup step will delete them + // automatically without any additional tracking. + configDir, err := ioutil.TempDir(wd.baseDir, "config") + if err != nil { + return err + } + configFilename := filepath.Join(configDir, "terraform_plugin_test.tf") + err = ioutil.WriteFile(configFilename, []byte(cfg), 0700) + if err != nil { + return err + } + + wd.configDir = configDir + + // Changing configuration invalidates any saved plan. + err = wd.ClearPlan() + if err != nil { + return err + } + return nil +} + +// RequireSetConfig is a variant of SetConfig that will fail the test via the +// given TestControl if the configuration cannot be set. +func (wd *WorkingDir) RequireSetConfig(t TestControl, cfg string) { + t.Helper() + if err := wd.SetConfig(cfg); err != nil { + t := testingT{t} + t.Fatalf("failed to set config: %s", err) + } +} + +// ClearState deletes any Terraform state present in the working directory. +// +// Any remote objects tracked by the state are not destroyed first, so this +// will leave them dangling in the remote system. +func (wd *WorkingDir) ClearState() error { + err := os.Remove(filepath.Join(wd.baseDir, "terraform.tfstate")) + if os.IsNotExist(err) { + return nil + } + return err +} + +// RequireClearState is a variant of ClearState that will fail the test via the +// given TestControl if the state cannot be cleared. +func (wd *WorkingDir) RequireClearState(t TestControl) { + t.Helper() + if err := wd.ClearState(); err != nil { + t := testingT{t} + t.Fatalf("failed to clear state: %s", err) + } +} + +// ClearPlan deletes any saved plan present in the working directory. +func (wd *WorkingDir) ClearPlan() error { + err := os.Remove(wd.planFilename()) + if os.IsNotExist(err) { + return nil + } + return err +} + +// RequireClearPlan is a variant of ClearPlan that will fail the test via the +// given TestControl if the plan cannot be cleared. +func (wd *WorkingDir) RequireClearPlan(t TestControl) { + t.Helper() + if err := wd.ClearPlan(); err != nil { + t := testingT{t} + t.Fatalf("failed to clear plan: %s", err) + } +} + +func (wd *WorkingDir) init(pluginDir string) error { + args := []string{"init"} + args = append(args, wd.baseArgs...) + return wd.runTerraform(args...) +} + +// Init runs "terraform init" for the given working directory, forcing Terraform +// to use the current version of the plugin under test. +func (wd *WorkingDir) Init() error { + if wd.configDir == "" { + return fmt.Errorf("must call SetConfig before Init") + } + return wd.init(wd.h.PluginDir()) +} + +// RequireInit is a variant of Init that will fail the test via the given +// TestControl if init fails. +func (wd *WorkingDir) RequireInit(t TestControl) { + t.Helper() + if err := wd.Init(); err != nil { + t := testingT{t} + t.Fatalf("init failed: %s", err) + } +} + +// InitPrevious runs "terraform init" for the given working directory, forcing +// Terraform to use the previous version of the plugin under test. +// +// This method will panic if no previous plugin version is available. Use +// HasPreviousVersion or RequirePreviousVersion on the test helper singleton +// to check this first. +func (wd *WorkingDir) InitPrevious() error { + if wd.configDir == "" { + return fmt.Errorf("must call SetConfig before InitPrevious") + } + return wd.init(wd.h.PreviousPluginDir()) +} + +// RequireInitPrevious is a variant of InitPrevious that will fail the test +// via the given TestControl if init fails. +func (wd *WorkingDir) RequireInitPrevious(t TestControl) { + t.Helper() + if err := wd.InitPrevious(); err != nil { + t := testingT{t} + t.Fatalf("init failed: %s", err) + } +} + +func (wd *WorkingDir) planFilename() string { + return filepath.Join(wd.baseDir, "tfplan") +} + +// CreatePlan runs "terraform plan" to create a saved plan file, which if successful +// will then be used for the next call to Apply. +func (wd *WorkingDir) CreatePlan() error { + args := []string{"plan", "-refresh=false"} + args = append(args, wd.baseArgs...) + args = append(args, "-out=tfplan", wd.configDir) + return wd.runTerraform(args...) +} + +// RequireCreatePlan is a variant of CreatePlan that will fail the test via +// the given TestControl if plan creation fails. +func (wd *WorkingDir) RequireCreatePlan(t TestControl) { + t.Helper() + if err := wd.CreatePlan(); err != nil { + t := testingT{t} + t.Fatalf("failed to create plan: %s", err) + } +} + +// Apply runs "terraform apply". If CreatePlan has previously completed +// successfully and the saved plan has not been cleared in the meantime then +// this will apply the saved plan. Otherwise, it will implicitly create a new +// plan and apply it. +func (wd *WorkingDir) Apply() error { + args := []string{"apply", "-refresh=false"} + args = append(args, wd.baseArgs...) + + if wd.HasSavedPlan() { + args = append(args, "tfplan") + } else { + args = append(args, "-auto-approve") + args = append(args, wd.configDir) + } + + return wd.runTerraform(args...) +} + +// RequireApply is a variant of Apply that will fail the test via +// the given TestControl if the apply operation fails. +func (wd *WorkingDir) RequireApply(t TestControl) { + t.Helper() + if err := wd.Apply(); err != nil { + t := testingT{t} + t.Fatalf("failed to apply: %s", err) + } +} + +// Destroy runs "terraform destroy". It does not consider or modify any saved +// plan, and is primarily for cleaning up at the end of a test run. +// +// If destroy fails then remote objects might still exist, and continue to +// exist after a particular test is concluded. +func (wd *WorkingDir) Destroy() error { + args := []string{"destroy", "-refresh=false"} + args = append(args, wd.baseArgs...) + + args = append(args, "-auto-approve", wd.configDir) + return wd.runTerraform(args...) +} + +// RequireDestroy is a variant of Destroy that will fail the test via +// the given TestControl if the destroy operation fails. +// +// If destroy fails then remote objects might still exist, and continue to +// exist after a particular test is concluded. +func (wd *WorkingDir) RequireDestroy(t TestControl) { + t.Helper() + if err := wd.Destroy(); err != nil { + t := testingT{t} + t.Logf("WARNING: destroy failed, so remote objects may still exist and be subject to billing") + t.Fatalf("failed to destroy: %s", err) + } +} + +// HasSavedPlan returns true if there is a saved plan in the working directory. If +// so, a subsequent call to Apply will apply that saved plan. +func (wd *WorkingDir) HasSavedPlan() bool { + _, err := os.Stat(wd.planFilename()) + return err == nil +} + +// SavedPlan returns an object describing the current saved plan file, if any. +// +// If no plan is saved or if the plan file cannot be read, SavedPlan returns +// an error. +func (wd *WorkingDir) SavedPlan() (*tfjson.Plan, error) { + if !wd.HasSavedPlan() { + return nil, fmt.Errorf("there is no current saved plan") + } + + var ret tfjson.Plan + + args := []string{"show"} + args = append(args, wd.baseArgs...) + args = append(args, "-json", wd.planFilename()) + + err := wd.runTerraformJSON(&ret, args...) + if err != nil { + return nil, err + } + + return &ret, nil +} + +// RequireSavedPlan is a variant of SavedPlan that will fail the test via +// the given TestControl if the plan cannot be read. +func (wd *WorkingDir) RequireSavedPlan(t TestControl) *tfjson.Plan { + t.Helper() + ret, err := wd.SavedPlan() + if err != nil { + t := testingT{t} + t.Fatalf("failed to read saved plan: %s", err) + } + return ret +} + +// State returns an object describing the current state. +// +// If the state cannot be read, State returns an error. +func (wd *WorkingDir) State() (*tfjson.State, error) { + var ret tfjson.State + + args := []string{"show"} + args = append(args, wd.baseArgs...) + args = append(args, "-json") + + err := wd.runTerraformJSON(&ret, args...) + if err != nil { + return nil, err + } + + return &ret, nil +} + +// RequireState is a variant of State that will fail the test via +// the given TestControl if the state cannot be read. +func (wd *WorkingDir) RequireState(t TestControl) *tfjson.State { + t.Helper() + ret, err := wd.State() + if err != nil { + t := testingT{t} + t.Fatalf("failed to read state plan: %s", err) + } + return ret +} + +// Import runs terraform import +func (wd *WorkingDir) Import(resource, id string) error { + args := []string{"import"} + args = append(args, wd.baseArgs...) + args = append(args, "-config="+wd.configDir, resource, id) + return wd.runTerraform(args...) +} + +// RequireImport is a variant of Import that will fail the test via +// the given TestControl if the import is non successful. +func (wd *WorkingDir) RequireImport(t TestControl, resource, id string) { + t.Helper() + if err := wd.Import(resource, id); err != nil { + t := testingT{t} + t.Fatalf("failed to import: %s", err) + } +} + +// Refresh runs terraform refresh +func (wd *WorkingDir) Refresh() error { + args := []string{"refresh"} + args = append(args, wd.baseArgs...) + args = append(args, "-state="+filepath.Join(wd.baseDir, "terraform.tfstate")) + args = append(args, wd.configDir) + return wd.runTerraform(args...) +} + +// RequireRefresh is a variant of Refresh that will fail the test via +// the given TestControl if the refresh is non successful. +func (wd *WorkingDir) RequireRefresh(t TestControl) { + t.Helper() + if err := wd.Refresh(); err != nil { + t := testingT{t} + t.Fatalf("failed to refresh: %s", err) + } +} + +// Schemas returns an object describing the provider schemas. +// +// If the schemas cannot be read, Schemas returns an error. +func (wd *WorkingDir) Schemas() (*tfjson.ProviderSchemas, error) { + args := []string{"providers", wd.configDir, "schema"} + + var ret tfjson.ProviderSchemas + err := wd.runTerraformJSON(&ret, args...) + if err != nil { + return nil, err + } + + return &ret, nil +} + +// RequireSchemas is a variant of Schemas that will fail the test via +// the given TestControl if the schemas cannot be read. +func (wd *WorkingDir) RequireSchemas(t TestControl) *tfjson.ProviderSchemas { + t.Helper() + + ret, err := wd.Schemas() + if err != nil { + t := testingT{t} + t.Fatalf("failed to read schemas: %s", err) + } + return ret +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/cache.go b/vendor/github.com/hashicorp/terraform-svchost/auth/cache.go similarity index 63% rename from vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/cache.go rename to vendor/github.com/hashicorp/terraform-svchost/auth/cache.go index 99e2c0306..0dae567db 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/cache.go +++ b/vendor/github.com/hashicorp/terraform-svchost/auth/cache.go @@ -1,7 +1,7 @@ package auth import ( - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" + "github.com/hashicorp/terraform-svchost" ) // CachingCredentialsSource creates a new credentials source that wraps another @@ -43,3 +43,19 @@ func (s *cachingCredentialsSource) ForHost(host svchost.Hostname) (HostCredentia s.cache[host] = result return result, nil } + +func (s *cachingCredentialsSource) StoreForHost(host svchost.Hostname, credentials HostCredentialsWritable) error { + // We'll delete the cache entry even if the store fails, since that just + // means that the next read will go to the real store and get a chance to + // see which object (old or new) is actually present. + delete(s.cache, host) + return s.source.StoreForHost(host, credentials) +} + +func (s *cachingCredentialsSource) ForgetForHost(host svchost.Hostname) error { + // We'll delete the cache entry even if the store fails, since that just + // means that the next read will go to the real store and get a chance to + // see if the object is still present. + delete(s.cache, host) + return s.source.ForgetForHost(host) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/credentials.go b/vendor/github.com/hashicorp/terraform-svchost/auth/credentials.go similarity index 52% rename from vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/credentials.go rename to vendor/github.com/hashicorp/terraform-svchost/auth/credentials.go index 00042a0a5..36441cd11 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/credentials.go +++ b/vendor/github.com/hashicorp/terraform-svchost/auth/credentials.go @@ -3,9 +3,12 @@ package auth import ( + "fmt" "net/http" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" + "github.com/zclconf/go-cty/cty" + + "github.com/hashicorp/terraform-svchost" ) // Credentials is a list of CredentialsSource objects that can be tried in @@ -14,6 +17,9 @@ import ( // A Credentials is itself a CredentialsSource, wrapping its members. // In principle one CredentialsSource can be nested inside another, though // there is no good reason to do so. +// +// The write operations on a Credentials are tried only on the first object, +// under the assumption that it is the primary store. type Credentials []CredentialsSource // NoCredentials is an empty CredentialsSource that always returns nil @@ -33,6 +39,19 @@ type CredentialsSource interface { // If an error is returned, progress through a list of CredentialsSources // is halted and the error is returned to the user. ForHost(host svchost.Hostname) (HostCredentials, error) + + // StoreForHost takes a HostCredentialsWritable and saves it as the + // credentials for the given host. + // + // If credentials are already stored for the given host, it will try to + // replace those credentials but may produce an error if such replacement + // is not possible. + StoreForHost(host svchost.Hostname, credentials HostCredentialsWritable) error + + // ForgetForHost discards any stored credentials for the given host. It + // does nothing and returns successfully if no credentials are saved + // for that host. + ForgetForHost(host svchost.Hostname) error } // HostCredentials represents a single set of credentials for a particular @@ -47,6 +66,22 @@ type HostCredentials interface { Token() string } +// HostCredentialsWritable is an extension of HostCredentials for credentials +// objects that can be serialized as a JSON-compatible object value for +// storage. +type HostCredentialsWritable interface { + HostCredentials + + // ToStore returns a cty.Value, always of an object type, + // representing data that can be serialized to represent this object + // in persistent storage. + // + // The resulting value may uses only cty values that can be accepted + // by the cty JSON encoder, though the caller may elect to instead store + // it in some other format that has a JSON-compatible type system. + ToStore() cty.Value +} + // ForHost iterates over the contained CredentialsSource objects and // tries to obtain credentials for the given host from each one in turn. // @@ -61,3 +96,23 @@ func (c Credentials) ForHost(host svchost.Hostname) (HostCredentials, error) { } return nil, nil } + +// StoreForHost passes the given arguments to the same operation on the +// first CredentialsSource in the receiver. +func (c Credentials) StoreForHost(host svchost.Hostname, credentials HostCredentialsWritable) error { + if len(c) == 0 { + return fmt.Errorf("no credentials store is available") + } + + return c[0].StoreForHost(host, credentials) +} + +// ForgetForHost passes the given arguments to the same operation on the +// first CredentialsSource in the receiver. +func (c Credentials) ForgetForHost(host svchost.Hostname) error { + if len(c) == 0 { + return fmt.Errorf("no credentials store is available") + } + + return c[0].ForgetForHost(host) +} diff --git a/vendor/github.com/hashicorp/terraform-svchost/auth/from_map.go b/vendor/github.com/hashicorp/terraform-svchost/auth/from_map.go new file mode 100644 index 000000000..7198c6744 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/auth/from_map.go @@ -0,0 +1,48 @@ +package auth + +import ( + "github.com/zclconf/go-cty/cty" +) + +// HostCredentialsFromMap converts a map of key-value pairs from a credentials +// definition provided by the user (e.g. in a config file, or via a credentials +// helper) into a HostCredentials object if possible, or returns nil if +// no credentials could be extracted from the map. +// +// This function ignores map keys it is unfamiliar with, to allow for future +// expansion of the credentials map format for new credential types. +func HostCredentialsFromMap(m map[string]interface{}) HostCredentials { + if m == nil { + return nil + } + if token, ok := m["token"].(string); ok { + return HostCredentialsToken(token) + } + return nil +} + +// HostCredentialsFromObject converts a cty.Value of an object type into a +// HostCredentials object if possible, or returns nil if no credentials could +// be extracted from the map. +// +// This function ignores object attributes it is unfamiliar with, to allow for +// future expansion of the credentials object structure for new credential types. +// +// If the given value is not of an object type, this function will panic. +func HostCredentialsFromObject(obj cty.Value) HostCredentials { + if !obj.Type().HasAttribute("token") { + return nil + } + + tokenV := obj.GetAttr("token") + if tokenV.IsNull() || !tokenV.IsKnown() { + return nil + } + if !cty.String.Equals(tokenV.Type()) { + // Weird, but maybe some future Terraform version accepts an object + // here for some reason, so we'll be resilient. + return nil + } + + return HostCredentialsToken(tokenV.AsString()) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/helper_program.go b/vendor/github.com/hashicorp/terraform-svchost/auth/helper_program.go similarity index 54% rename from vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/helper_program.go rename to vendor/github.com/hashicorp/terraform-svchost/auth/helper_program.go index 93f52604a..76505f209 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/helper_program.go +++ b/vendor/github.com/hashicorp/terraform-svchost/auth/helper_program.go @@ -7,7 +7,9 @@ import ( "os/exec" "path/filepath" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" + ctyjson "github.com/zclconf/go-cty/cty/json" + + "github.com/hashicorp/terraform-svchost" ) type helperProgramCredentialsSource struct { @@ -78,3 +80,70 @@ func (s *helperProgramCredentialsSource) ForHost(host svchost.Hostname) (HostCre return HostCredentialsFromMap(m), nil } + +func (s *helperProgramCredentialsSource) StoreForHost(host svchost.Hostname, credentials HostCredentialsWritable) error { + args := make([]string, len(s.args), len(s.args)+2) + copy(args, s.args) + args = append(args, "store") + args = append(args, string(host)) + + toStore := credentials.ToStore() + toStoreRaw, err := ctyjson.Marshal(toStore, toStore.Type()) + if err != nil { + return fmt.Errorf("can't serialize credentials to store: %s", err) + } + + inReader := bytes.NewReader(toStoreRaw) + errBuf := bytes.Buffer{} + + cmd := exec.Cmd{ + Path: s.executable, + Args: args, + Stdin: inReader, + Stderr: &errBuf, + Stdout: nil, + } + err = cmd.Run() + if _, isExitErr := err.(*exec.ExitError); isExitErr { + errText := errBuf.String() + if errText == "" { + // Shouldn't happen for a well-behaved helper program + return fmt.Errorf("error in %s, but it produced no error message", s.executable) + } + return fmt.Errorf("error in %s: %s", s.executable, errText) + } else if err != nil { + return fmt.Errorf("failed to run %s: %s", s.executable, err) + } + + return nil +} + +func (s *helperProgramCredentialsSource) ForgetForHost(host svchost.Hostname) error { + args := make([]string, len(s.args), len(s.args)+2) + copy(args, s.args) + args = append(args, "forget") + args = append(args, string(host)) + + errBuf := bytes.Buffer{} + + cmd := exec.Cmd{ + Path: s.executable, + Args: args, + Stdin: nil, + Stderr: &errBuf, + Stdout: nil, + } + err := cmd.Run() + if _, isExitErr := err.(*exec.ExitError); isExitErr { + errText := errBuf.String() + if errText == "" { + // Shouldn't happen for a well-behaved helper program + return fmt.Errorf("error in %s, but it produced no error message", s.executable) + } + return fmt.Errorf("error in %s: %s", s.executable, errText) + } else if err != nil { + return fmt.Errorf("failed to run %s: %s", s.executable, err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/static.go b/vendor/github.com/hashicorp/terraform-svchost/auth/static.go similarity index 63% rename from vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/static.go rename to vendor/github.com/hashicorp/terraform-svchost/auth/static.go index b5108a4a2..f8b0b076e 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth/static.go +++ b/vendor/github.com/hashicorp/terraform-svchost/auth/static.go @@ -1,7 +1,9 @@ package auth import ( - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" + "fmt" + + "github.com/hashicorp/terraform-svchost" ) // StaticCredentialsSource is a credentials source that retrieves credentials @@ -26,3 +28,11 @@ func (s staticCredentialsSource) ForHost(host svchost.Hostname) (HostCredentials return nil, nil } + +func (s staticCredentialsSource) StoreForHost(host svchost.Hostname, credentials HostCredentialsWritable) error { + return fmt.Errorf("can't store new credentials in a static credentials source") +} + +func (s staticCredentialsSource) ForgetForHost(host svchost.Hostname) error { + return fmt.Errorf("can't discard credentials from a static credentials source") +} diff --git a/vendor/github.com/hashicorp/terraform-svchost/auth/token_credentials.go b/vendor/github.com/hashicorp/terraform-svchost/auth/token_credentials.go new file mode 100644 index 000000000..1d36553ae --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/auth/token_credentials.go @@ -0,0 +1,43 @@ +package auth + +import ( + "net/http" + + "github.com/zclconf/go-cty/cty" +) + +// HostCredentialsToken is a HostCredentials implementation that represents a +// single "bearer token", to be sent to the server via an Authorization header +// with the auth type set to "Bearer". +// +// To save a token as the credentials for a host, convert the token string to +// this type and use the result as a HostCredentialsWritable implementation. +type HostCredentialsToken string + +// Interface implementation assertions. Compilation will fail here if +// HostCredentialsToken does not fully implement these interfaces. +var _ HostCredentials = HostCredentialsToken("") +var _ HostCredentialsWritable = HostCredentialsToken("") + +// PrepareRequest alters the given HTTP request by setting its Authorization +// header to the string "Bearer " followed by the encapsulated authentication +// token. +func (tc HostCredentialsToken) PrepareRequest(req *http.Request) { + if req.Header == nil { + req.Header = http.Header{} + } + req.Header.Set("Authorization", "Bearer "+string(tc)) +} + +// Token returns the authentication token. +func (tc HostCredentialsToken) Token() string { + return string(tc) +} + +// ToStore returns a credentials object with a single attribute "token" whose +// value is the token string. +func (tc HostCredentialsToken) ToStore() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "token": cty.StringVal(string(tc)), + }) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco/disco.go b/vendor/github.com/hashicorp/terraform-svchost/disco/disco.go similarity index 91% rename from vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco/disco.go rename to vendor/github.com/hashicorp/terraform-svchost/disco/disco.go index c770338be..978313633 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco/disco.go +++ b/vendor/github.com/hashicorp/terraform-svchost/disco/disco.go @@ -17,10 +17,8 @@ import ( "net/url" "time" - cleanhttp "github.com/hashicorp/go-cleanhttp" - "github.com/hashicorp/terraform-plugin-sdk/internal/httpclient" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost" - "github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth" + "github.com/hashicorp/terraform-svchost" + "github.com/hashicorp/terraform-svchost/auth" ) const ( @@ -38,7 +36,7 @@ const ( ) // httpTransport is overridden during tests, to skip TLS verification. -var httpTransport = cleanhttp.DefaultPooledTransport() +var httpTransport = defaultHttpTransport() // Disco is the main type in this package, which allows discovery on given // hostnames and caches the results by hostname to avoid repeated requests @@ -66,6 +64,13 @@ func NewWithCredentialsSource(credsSrc auth.CredentialsSource) *Disco { } } +func (d *Disco) SetUserAgent(uaString string) { + d.Transport = &userAgentRoundTripper{ + innerRt: d.Transport, + userAgent: uaString, + } +} + // SetCredentialsSource provides a credentials source that will be used to // add credentials to outgoing discovery requests, where available. // @@ -75,6 +80,18 @@ func (d *Disco) SetCredentialsSource(src auth.CredentialsSource) { d.credsSrc = src } +// CredentialsSource returns the credentials source associated with the receiver, +// or an empty credentials source if none is associated. +func (d *Disco) CredentialsSource() auth.CredentialsSource { + if d.credsSrc == nil { + // We'll return an empty one just to save the caller from having to + // protect against the nil case, since this interface already allows + // for the possibility of there being no credentials at all. + return auth.StaticCredentialsSource(nil) + } + return d.credsSrc +} + // CredentialsForHost returns a non-nil HostCredentials if the embedded source has // credentials available for the host, and a nil HostCredentials if it does not. func (d *Disco) CredentialsForHost(hostname svchost.Hostname) (auth.HostCredentials, error) { @@ -173,7 +190,6 @@ func (d *Disco) discover(hostname svchost.Hostname) (*Host, error) { URL: discoURL, } req.Header.Set("Accept", "application/json") - req.Header.Set("User-Agent", httpclient.UserAgentString()) creds, err := d.CredentialsForHost(hostname) if err != nil { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco/host.go b/vendor/github.com/hashicorp/terraform-svchost/disco/host.go similarity index 59% rename from vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco/host.go rename to vendor/github.com/hashicorp/terraform-svchost/disco/host.go index 0d6ef0383..2d0fc9f12 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco/host.go +++ b/vendor/github.com/hashicorp/terraform-svchost/disco/host.go @@ -12,7 +12,6 @@ import ( "time" "github.com/hashicorp/go-version" - "github.com/hashicorp/terraform-plugin-sdk/internal/httpclient" ) const versionServiceID = "versions.v1" @@ -111,27 +110,177 @@ func (h *Host) ServiceURL(id string) (*url.URL, error) { return nil, &ErrServiceNotProvided{hostname: h.hostname, service: svc} } - u, err := url.Parse(urlStr) + u, err := h.parseURL(urlStr) if err != nil { return nil, fmt.Errorf("Failed to parse service URL: %v", err) } + return u, nil +} + +// ServiceOAuthClient returns the OAuth client configuration associated with the +// given service identifier, which should be of the form "servicename.vN". +// +// This is an alternative to ServiceURL for unusual services that require +// a full OAuth2 client definition rather than just a URL. Use this only +// for services whose specification calls for this sort of definition. +func (h *Host) ServiceOAuthClient(id string) (*OAuthClient, error) { + svc, ver, err := parseServiceID(id) + if err != nil { + return nil, err + } + + // No services supported for an empty Host. + if h == nil || h.services == nil { + return nil, &ErrServiceNotProvided{service: svc} + } + + if _, ok := h.services[id]; !ok { + // See if we have a matching service as that would indicate + // the service is supported, but not the requested version. + for serviceID := range h.services { + if strings.HasPrefix(serviceID, svc+".") { + return nil, &ErrVersionNotSupported{ + hostname: h.hostname, + service: svc, + version: ver.Original(), + } + } + } + + // No discovered services match the requested service. + return nil, &ErrServiceNotProvided{hostname: h.hostname, service: svc} + } + + var raw map[string]interface{} + switch v := h.services[id].(type) { + case map[string]interface{}: + raw = v // Great! + case []map[string]interface{}: + // An absolutely infuriating legacy HCL ambiguity. + raw = v[0] + default: + // Debug message because raw Go types don't belong in our UI. + log.Printf("[DEBUG] The definition for %s has Go type %T", id, h.services[id]) + return nil, fmt.Errorf("Service %s must be declared with an object value in the service discovery document", id) + } + + var grantTypes OAuthGrantTypeSet + if rawGTs, ok := raw["grant_types"]; ok { + if gts, ok := rawGTs.([]interface{}); ok { + var kws []string + for _, gtI := range gts { + gt, ok := gtI.(string) + if !ok { + // We'll ignore this so that we can potentially introduce + // other types into this array later if we need to. + continue + } + kws = append(kws, gt) + } + grantTypes = NewOAuthGrantTypeSet(kws...) + } else { + return nil, fmt.Errorf("Service %s is defined with invalid grant_types property: must be an array of grant type strings", id) + } + } else { + grantTypes = NewOAuthGrantTypeSet("authz_code") + } + + ret := &OAuthClient{ + SupportedGrantTypes: grantTypes, + } + if clientIDStr, ok := raw["client"].(string); ok { + ret.ID = clientIDStr + } else { + return nil, fmt.Errorf("Service %s definition is missing required property \"client\"", id) + } + if urlStr, ok := raw["authz"].(string); ok { + u, err := h.parseURL(urlStr) + if err != nil { + return nil, fmt.Errorf("Failed to parse authorization URL: %v", err) + } + ret.AuthorizationURL = u + } else { + if grantTypes.RequiresAuthorizationEndpoint() { + return nil, fmt.Errorf("Service %s definition is missing required property \"authz\"", id) + } + } + if urlStr, ok := raw["token"].(string); ok { + u, err := h.parseURL(urlStr) + if err != nil { + return nil, fmt.Errorf("Failed to parse token URL: %v", err) + } + ret.TokenURL = u + } else { + if grantTypes.RequiresTokenEndpoint() { + return nil, fmt.Errorf("Service %s definition is missing required property \"token\"", id) + } + } + if portsRaw, ok := raw["ports"].([]interface{}); ok { + if len(portsRaw) != 2 { + return nil, fmt.Errorf("Invalid \"ports\" definition for service %s: must be a two-element array", id) + } + invalidPortsErr := fmt.Errorf("Invalid \"ports\" definition for service %s: both ports must be whole numbers between 1024 and 65535", id) + ports := make([]uint16, 2) + for i := range ports { + switch v := portsRaw[i].(type) { + case float64: + // JSON unmarshaling always produces float64. HCL 2 might, if + // an invalid fractional number were given. + if float64(uint16(v)) != v || v < 1024 { + return nil, invalidPortsErr + } + ports[i] = uint16(v) + case int: + // Legacy HCL produces int. HCL 2 will too, if the given number + // is a whole number. + if v < 1024 || v > 65535 { + return nil, invalidPortsErr + } + ports[i] = uint16(v) + default: + // Debug message because raw Go types don't belong in our UI. + log.Printf("[DEBUG] Port value %d has Go type %T", i, portsRaw[i]) + return nil, invalidPortsErr + } + } + if ports[1] < ports[0] { + return nil, fmt.Errorf("Invalid \"ports\" definition for service %s: minimum port cannot be greater than maximum port", id) + } + ret.MinPort = ports[0] + ret.MaxPort = ports[1] + } else { + // Default is to accept any port in the range, for a client that is + // able to call back to any localhost port. + ret.MinPort = 1024 + ret.MaxPort = 65535 + } + + return ret, nil +} + +func (h *Host) parseURL(urlStr string) (*url.URL, error) { + u, err := url.Parse(urlStr) + if err != nil { + return nil, err + } + // Make relative URLs absolute using our discovery URL. if !u.IsAbs() { u = h.discoURL.ResolveReference(u) } if u.Scheme != "https" && u.Scheme != "http" { - return nil, fmt.Errorf("Service URL is using an unsupported scheme: %s", u.Scheme) + return nil, fmt.Errorf("unsupported scheme %s", u.Scheme) } if u.User != nil { - return nil, fmt.Errorf("Embedded username/password information is not permitted") + return nil, fmt.Errorf("embedded username/password information is not permitted") } // Fragment part is irrelevant, since we're not a browser. u.Fragment = "" - return h.discoURL.ResolveReference(u), nil + return u, nil } // VersionConstraints returns the contraints for a given service identifier @@ -222,7 +371,6 @@ func (h *Host) VersionConstraints(id, product string) (*Constraints, error) { return nil, fmt.Errorf("Failed to create version constraints request: %v", err) } req.Header.Set("Accept", "application/json") - req.Header.Set("User-Agent", httpclient.UserAgentString()) log.Printf("[DEBUG] Retrieve version constraints for service %s and product %s", id, product) diff --git a/vendor/github.com/hashicorp/terraform-svchost/disco/http_transport.go b/vendor/github.com/hashicorp/terraform-svchost/disco/http_transport.go new file mode 100644 index 000000000..7e4a38567 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/disco/http_transport.go @@ -0,0 +1,30 @@ +package disco + +import ( + "net/http" + + "github.com/hashicorp/go-cleanhttp" +) + +const DefaultUserAgent = "terraform-svchost/1.0" + +func defaultHttpTransport() http.RoundTripper { + t := cleanhttp.DefaultPooledTransport() + return &userAgentRoundTripper{ + innerRt: t, + userAgent: DefaultUserAgent, + } +} + +type userAgentRoundTripper struct { + innerRt http.RoundTripper + userAgent string +} + +func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + if _, ok := req.Header["User-Agent"]; !ok { + req.Header.Set("User-Agent", rt.userAgent) + } + + return rt.innerRt.RoundTrip(req) +} diff --git a/vendor/github.com/hashicorp/terraform-svchost/disco/oauth_client.go b/vendor/github.com/hashicorp/terraform-svchost/disco/oauth_client.go new file mode 100644 index 000000000..9308bbf72 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/disco/oauth_client.go @@ -0,0 +1,178 @@ +package disco + +import ( + "fmt" + "net/url" + "strings" + + "golang.org/x/oauth2" +) + +// OAuthClient represents an OAuth client configuration, which is used for +// unusual services that require an entire OAuth client configuration as part +// of their service discovery, rather than just a URL. +type OAuthClient struct { + // ID is the identifier for the client, to be used as "client_id" in + // OAuth requests. + ID string + + // Authorization URL is the URL of the authorization endpoint that must + // be used for this OAuth client, as defined in the OAuth2 specifications. + // + // Not all grant types use the authorization endpoint, so it may be omitted + // if none of the grant types in SupportedGrantTypes require it. + AuthorizationURL *url.URL + + // Token URL is the URL of the token endpoint that must be used for this + // OAuth client, as defined in the OAuth2 specifications. + // + // Not all grant types use the token endpoint, so it may be omitted + // if none of the grant types in SupportedGrantTypes require it. + TokenURL *url.URL + + // MinPort and MaxPort define a range of TCP ports on localhost that this + // client is able to use as redirect_uri in an authorization request. + // Terraform will select a port from this range for the temporary HTTP + // server it creates to receive the authorization response, giving + // a URL like http://localhost:NNN/ where NNN is the selected port number. + // + // Terraform will reject any port numbers in this range less than 1024, + // to respect the common convention (enforced on some operating systems) + // that lower port numbers are reserved for "privileged" services. + MinPort, MaxPort uint16 + + // SupportedGrantTypes is a set of the grant types that the client may + // choose from. This includes an entry for each distinct type advertised + // by the server, even if a particular keyword is not supported by the + // current version of Terraform. + SupportedGrantTypes OAuthGrantTypeSet +} + +// Endpoint returns an oauth2.Endpoint value ready to be used with the oauth2 +// library, representing the URLs from the receiver. +func (c *OAuthClient) Endpoint() oauth2.Endpoint { + ep := oauth2.Endpoint{ + // We don't actually auth because we're not a server-based OAuth client, + // so this instead just means that we include client_id as an argument + // in our requests. + AuthStyle: oauth2.AuthStyleInParams, + } + + if c.AuthorizationURL != nil { + ep.AuthURL = c.AuthorizationURL.String() + } + if c.TokenURL != nil { + ep.TokenURL = c.TokenURL.String() + } + + return ep +} + +// OAuthGrantType is an enumeration of grant type strings that a host can +// advertise support for. +// +// Values of this type don't necessarily match with a known constant of the +// type, because they may represent grant type keywords defined in a later +// version of Terraform which this version doesn't yet know about. +type OAuthGrantType string + +const ( + // OAuthAuthzCodeGrant represents an authorization code grant, as + // defined in IETF RFC 6749 section 4.1. + OAuthAuthzCodeGrant = OAuthGrantType("authz_code") + + // OAuthOwnerPasswordGrant represents a resource owner password + // credentials grant, as defined in IETF RFC 6749 section 4.3. + OAuthOwnerPasswordGrant = OAuthGrantType("password") +) + +// UsesAuthorizationEndpoint returns true if the receiving grant type makes +// use of the authorization endpoint from the client configuration, and thus +// if the authorization endpoint ought to be required. +func (t OAuthGrantType) UsesAuthorizationEndpoint() bool { + switch t { + case OAuthAuthzCodeGrant: + return true + case OAuthOwnerPasswordGrant: + return false + default: + // We'll default to false so that we don't impose any requirements + // on any grant type keywords that might be defined for future + // versions of Terraform. + return false + } +} + +// UsesTokenEndpoint returns true if the receiving grant type makes +// use of the token endpoint from the client configuration, and thus +// if the authorization endpoint ought to be required. +func (t OAuthGrantType) UsesTokenEndpoint() bool { + switch t { + case OAuthAuthzCodeGrant: + return true + case OAuthOwnerPasswordGrant: + return true + default: + // We'll default to false so that we don't impose any requirements + // on any grant type keywords that might be defined for future + // versions of Terraform. + return false + } +} + +// OAuthGrantTypeSet represents a set of OAuthGrantType values. +type OAuthGrantTypeSet map[OAuthGrantType]struct{} + +// NewOAuthGrantTypeSet constructs a new grant type set from the given list +// of grant type keyword strings. Any duplicates in the list are ignored. +func NewOAuthGrantTypeSet(keywords ...string) OAuthGrantTypeSet { + ret := make(OAuthGrantTypeSet, len(keywords)) + for _, kw := range keywords { + ret[OAuthGrantType(kw)] = struct{}{} + } + return ret +} + +// Has returns true if the given grant type is in the receiving set. +func (s OAuthGrantTypeSet) Has(t OAuthGrantType) bool { + _, ok := s[t] + return ok +} + +// RequiresAuthorizationEndpoint returns true if any of the grant types in +// the set are known to require an authorization endpoint. +func (s OAuthGrantTypeSet) RequiresAuthorizationEndpoint() bool { + for t := range s { + if t.UsesAuthorizationEndpoint() { + return true + } + } + return false +} + +// RequiresTokenEndpoint returns true if any of the grant types in +// the set are known to require a token endpoint. +func (s OAuthGrantTypeSet) RequiresTokenEndpoint() bool { + for t := range s { + if t.UsesTokenEndpoint() { + return true + } + } + return false +} + +// GoString implements fmt.GoStringer. +func (s OAuthGrantTypeSet) GoString() string { + var buf strings.Builder + i := 0 + buf.WriteString("disco.NewOAuthGrantTypeSet(") + for t := range s { + if i > 0 { + buf.WriteString(", ") + } + fmt.Fprintf(&buf, "%q", string(t)) + i++ + } + buf.WriteString(")") + return buf.String() +} diff --git a/vendor/github.com/hashicorp/terraform-svchost/go.mod b/vendor/github.com/hashicorp/terraform-svchost/go.mod new file mode 100644 index 000000000..8f29e4ac5 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/go.mod @@ -0,0 +1,12 @@ +module github.com/hashicorp/terraform-svchost + +go 1.12 + +require ( + github.com/google/go-cmp v0.3.1 + github.com/hashicorp/go-cleanhttp v0.5.1 + github.com/hashicorp/go-version v1.2.0 + github.com/zclconf/go-cty v1.1.0 + golang.org/x/net v0.0.0-20191009170851-d66e71096ffb + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 +) diff --git a/vendor/github.com/hashicorp/terraform-svchost/go.sum b/vendor/github.com/hashicorp/terraform-svchost/go.sum new file mode 100644 index 000000000..9ad1712f8 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/go.sum @@ -0,0 +1,36 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +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/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb h1:TR699M2v0qoKTOHxeLgp6zPqaQNs74f01a/ob9W0qko= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/label_iter.go b/vendor/github.com/hashicorp/terraform-svchost/label_iter.go similarity index 78% rename from vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/label_iter.go rename to vendor/github.com/hashicorp/terraform-svchost/label_iter.go index 6e0e47b73..af8ccbab2 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/label_iter.go +++ b/vendor/github.com/hashicorp/terraform-svchost/label_iter.go @@ -17,10 +17,23 @@ type labelIter struct { i int } +func (l *labelIter) reset() { + l.curStart = 0 + l.curEnd = 0 + l.i = 0 +} + func (l *labelIter) done() bool { return l.curStart >= len(l.orig) } +func (l *labelIter) result() string { + if l.slice != nil { + return strings.Join(l.slice, ".") + } + return l.orig +} + func (l *labelIter) label() string { if l.slice != nil { return l.slice[l.i] @@ -47,3 +60,10 @@ func (l *labelIter) next() { } } } + +func (l *labelIter) set(s string) { + if l.slice == nil { + l.slice = strings.Split(l.orig, ".") + } + l.slice[l.i] = s +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/svchost.go b/vendor/github.com/hashicorp/terraform-svchost/svchost.go similarity index 100% rename from vendor/github.com/hashicorp/terraform-plugin-sdk/internal/svchost/svchost.go rename to vendor/github.com/hashicorp/terraform-svchost/svchost.go diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/vendor/github.com/mattn/go-colorable/colorable_windows.go index e17a5474e..404e10ca0 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_windows.go +++ b/vendor/github.com/mattn/go-colorable/colorable_windows.go @@ -29,6 +29,15 @@ const ( backgroundMask = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity) ) +const ( + genericRead = 0x80000000 + genericWrite = 0x40000000 +) + +const ( + consoleTextmodeBuffer = 0x1 +) + type wchar uint16 type short int16 type dword uint32 @@ -69,14 +78,17 @@ var ( procGetConsoleCursorInfo = kernel32.NewProc("GetConsoleCursorInfo") procSetConsoleCursorInfo = kernel32.NewProc("SetConsoleCursorInfo") procSetConsoleTitle = kernel32.NewProc("SetConsoleTitleW") + procCreateConsoleScreenBuffer = kernel32.NewProc("CreateConsoleScreenBuffer") ) // Writer provide colorable Writer to the console type Writer struct { - out io.Writer - handle syscall.Handle - oldattr word - oldpos coord + out io.Writer + handle syscall.Handle + althandle syscall.Handle + oldattr word + oldpos coord + rest bytes.Buffer } // NewColorable return new instance of Writer which handle escape sequence from File. @@ -407,7 +419,18 @@ func (w *Writer) Write(data []byte) (n int, err error) { var csbi consoleScreenBufferInfo procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - er := bytes.NewReader(data) + handle := w.handle + + var er *bytes.Reader + if w.rest.Len() > 0 { + var rest bytes.Buffer + w.rest.WriteTo(&rest) + w.rest.Reset() + rest.Write(data) + er = bytes.NewReader(rest.Bytes()) + } else { + er = bytes.NewReader(data) + } var bw [1]byte loop: for { @@ -425,29 +448,55 @@ loop: break loop } - if c2 == ']' { - if err := doTitleSequence(er); err != nil { + switch c2 { + case '>': + continue + case ']': + w.rest.WriteByte(c1) + w.rest.WriteByte(c2) + er.WriteTo(&w.rest) + if bytes.IndexByte(w.rest.Bytes(), 0x07) == -1 { break loop } + er = bytes.NewReader(w.rest.Bytes()[2:]) + err := doTitleSequence(er) + if err != nil { + break loop + } + w.rest.Reset() continue - } - if c2 != 0x5b { + // https://github.com/mattn/go-colorable/issues/27 + case '7': + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) + w.oldpos = csbi.cursorPosition + continue + case '8': + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&w.oldpos))) + continue + case 0x5b: + // execute part after switch + default: continue } + w.rest.WriteByte(c1) + w.rest.WriteByte(c2) + er.WriteTo(&w.rest) + var buf bytes.Buffer var m byte - for { - c, err := er.ReadByte() - if err != nil { - break loop - } + for i, c := range w.rest.Bytes()[2:] { if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { m = c + er = bytes.NewReader(w.rest.Bytes()[2+i+1:]) + w.rest.Reset() break } buf.Write([]byte(string(c))) } + if m == 0 { + break loop + } switch m { case 'A': @@ -455,61 +504,64 @@ loop: if err != nil { continue } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) csbi.cursorPosition.y -= short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'B': n, err = strconv.Atoi(buf.String()) if err != nil { continue } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) csbi.cursorPosition.y += short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'C': n, err = strconv.Atoi(buf.String()) if err != nil { continue } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) csbi.cursorPosition.x += short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'D': n, err = strconv.Atoi(buf.String()) if err != nil { continue } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) csbi.cursorPosition.x -= short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) + if csbi.cursorPosition.x < 0 { + csbi.cursorPosition.x = 0 + } + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'E': n, err = strconv.Atoi(buf.String()) if err != nil { continue } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) csbi.cursorPosition.x = 0 csbi.cursorPosition.y += short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'F': n, err = strconv.Atoi(buf.String()) if err != nil { continue } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) csbi.cursorPosition.x = 0 csbi.cursorPosition.y -= short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'G': n, err = strconv.Atoi(buf.String()) if err != nil { continue } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) csbi.cursorPosition.x = short(n - 1) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'H', 'f': - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) if buf.Len() > 0 { token := strings.Split(buf.String(), ";") switch len(token) { @@ -534,7 +586,7 @@ loop: } else { csbi.cursorPosition.y = 0 } - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'J': n := 0 if buf.Len() > 0 { @@ -545,20 +597,20 @@ loop: } var count, written dword var cursor coord - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) switch n { case 0: cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y} - count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x) + count = dword(csbi.size.x) - dword(csbi.cursorPosition.x) + dword(csbi.size.y-csbi.cursorPosition.y)*dword(csbi.size.x) case 1: cursor = coord{x: csbi.window.left, y: csbi.window.top} - count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.window.top-csbi.cursorPosition.y)*csbi.size.x) + count = dword(csbi.size.x) - dword(csbi.cursorPosition.x) + dword(csbi.window.top-csbi.cursorPosition.y)*dword(csbi.size.x) case 2: cursor = coord{x: csbi.window.left, y: csbi.window.top} - count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x) + count = dword(csbi.size.x) - dword(csbi.cursorPosition.x) + dword(csbi.size.y-csbi.cursorPosition.y)*dword(csbi.size.x) } - procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) - procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) + procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) + procFillConsoleOutputAttribute.Call(uintptr(handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) case 'K': n := 0 if buf.Len() > 0 { @@ -567,28 +619,28 @@ loop: continue } } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) var cursor coord var count, written dword switch n { case 0: - cursor = coord{x: csbi.cursorPosition.x + 1, y: csbi.cursorPosition.y} - count = dword(csbi.size.x - csbi.cursorPosition.x - 1) + cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y} + count = dword(csbi.size.x - csbi.cursorPosition.x) case 1: - cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y} + cursor = coord{x: csbi.window.left, y: csbi.cursorPosition.y} count = dword(csbi.size.x - csbi.cursorPosition.x) case 2: - cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y} + cursor = coord{x: csbi.window.left, y: csbi.cursorPosition.y} count = dword(csbi.size.x) } - procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) - procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) + procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) + procFillConsoleOutputAttribute.Call(uintptr(handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) case 'm': - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) attr := csbi.attributes cs := buf.String() if cs == "" { - procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(w.oldattr)) + procSetConsoleTextAttribute.Call(uintptr(handle), uintptr(w.oldattr)) continue } token := strings.Split(cs, ";") @@ -627,6 +679,21 @@ loop: attr |= n256foreAttr[n256] i += 2 } + } else if len(token) == 5 && token[i+1] == "2" { + var r, g, b int + r, _ = strconv.Atoi(token[i+2]) + g, _ = strconv.Atoi(token[i+3]) + b, _ = strconv.Atoi(token[i+4]) + i += 4 + if r > 127 { + attr |= foregroundRed + } + if g > 127 { + attr |= foregroundGreen + } + if b > 127 { + attr |= foregroundBlue + } } else { attr = attr & (w.oldattr & backgroundMask) } @@ -654,6 +721,21 @@ loop: attr |= n256backAttr[n256] i += 2 } + } else if len(token) == 5 && token[i+1] == "2" { + var r, g, b int + r, _ = strconv.Atoi(token[i+2]) + g, _ = strconv.Atoi(token[i+3]) + b, _ = strconv.Atoi(token[i+4]) + i += 4 + if r > 127 { + attr |= backgroundRed + } + if g > 127 { + attr |= backgroundGreen + } + if b > 127 { + attr |= backgroundBlue + } } else { attr = attr & (w.oldattr & foregroundMask) } @@ -685,38 +767,52 @@ loop: attr |= backgroundBlue } } - procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(attr)) + procSetConsoleTextAttribute.Call(uintptr(handle), uintptr(attr)) } } case 'h': var ci consoleCursorInfo cs := buf.String() if cs == "5>" { - procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) + procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci))) ci.visible = 0 - procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) + procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci))) } else if cs == "?25" { - procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) + procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci))) ci.visible = 1 - procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) + procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci))) + } else if cs == "?1049" { + if w.althandle == 0 { + h, _, _ := procCreateConsoleScreenBuffer.Call(uintptr(genericRead|genericWrite), 0, 0, uintptr(consoleTextmodeBuffer), 0, 0) + w.althandle = syscall.Handle(h) + if w.althandle != 0 { + handle = w.althandle + } + } } case 'l': var ci consoleCursorInfo cs := buf.String() if cs == "5>" { - procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) + procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci))) ci.visible = 1 - procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) + procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci))) } else if cs == "?25" { - procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) + procGetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci))) ci.visible = 0 - procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) + procSetConsoleCursorInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&ci))) + } else if cs == "?1049" { + if w.althandle != 0 { + syscall.CloseHandle(w.althandle) + w.althandle = 0 + handle = w.handle + } } case 's': - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) w.oldpos = csbi.cursorPosition case 'u': - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&w.oldpos))) + procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&w.oldpos))) } } diff --git a/vendor/github.com/mattn/go-colorable/go.mod b/vendor/github.com/mattn/go-colorable/go.mod new file mode 100644 index 000000000..9d9f42485 --- /dev/null +++ b/vendor/github.com/mattn/go-colorable/go.mod @@ -0,0 +1,3 @@ +module github.com/mattn/go-colorable + +require github.com/mattn/go-isatty v0.0.5 diff --git a/vendor/github.com/mattn/go-colorable/go.sum b/vendor/github.com/mattn/go-colorable/go.sum new file mode 100644 index 000000000..2c12960ec --- /dev/null +++ b/vendor/github.com/mattn/go-colorable/go.sum @@ -0,0 +1,4 @@ +github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/mattn/go-isatty/go.mod b/vendor/github.com/mattn/go-isatty/go.mod new file mode 100644 index 000000000..f310320c3 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/go.mod @@ -0,0 +1,3 @@ +module github.com/mattn/go-isatty + +require golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 diff --git a/vendor/github.com/mattn/go-isatty/go.sum b/vendor/github.com/mattn/go-isatty/go.sum new file mode 100644 index 000000000..426c8973c --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/mattn/go-isatty/isatty_appengine.go b/vendor/github.com/mattn/go-isatty/isatty_appengine.go deleted file mode 100644 index 9584a9884..000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_appengine.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build appengine - -package isatty - -// IsTerminal returns true if the file descriptor is terminal which -// is always false on on appengine classic which is a sandboxed PaaS. -func IsTerminal(fd uintptr) bool { - return false -} - -// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 -// terminal. This is also always false on this environment. -func IsCygwinTerminal(fd uintptr) bool { - return false -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_bsd.go b/vendor/github.com/mattn/go-isatty/isatty_bsd.go index 42f2514d1..07e93039d 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_bsd.go +++ b/vendor/github.com/mattn/go-isatty/isatty_bsd.go @@ -16,3 +16,9 @@ func IsTerminal(fd uintptr) bool { _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) return err == 0 } + +// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 +// terminal. This is also always false on this environment. +func IsCygwinTerminal(fd uintptr) bool { + return false +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_linux.go b/vendor/github.com/mattn/go-isatty/isatty_linux.go index 7384cf991..e004038ee 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_linux.go +++ b/vendor/github.com/mattn/go-isatty/isatty_linux.go @@ -1,18 +1,18 @@ // +build linux -// +build !appengine,!ppc64,!ppc64le +// +build !appengine package isatty -import ( - "syscall" - "unsafe" -) - -const ioctlReadTermios = syscall.TCGETS +import "golang.org/x/sys/unix" // IsTerminal return true if the file descriptor is terminal. func IsTerminal(fd uintptr) bool { - var termios syscall.Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 + _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) + return err == nil +} + +// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 +// terminal. This is also always false on this environment. +func IsCygwinTerminal(fd uintptr) bool { + return false } diff --git a/vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go b/vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go deleted file mode 100644 index 44e5d2130..000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build linux -// +build ppc64 ppc64le - -package isatty - -import ( - "unsafe" - - syscall "golang.org/x/sys/unix" -) - -const ioctlReadTermios = syscall.TCGETS - -// IsTerminal return true if the file descriptor is terminal. -func IsTerminal(fd uintptr) bool { - var termios syscall.Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go index 9d8b4a599..f02849c56 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_others.go +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -1,9 +1,14 @@ -// +build !windows -// +build !appengine +// +build appengine js package isatty -// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 +// IsTerminal returns true if the file descriptor is terminal which +// is always false on js and appengine classic which is a sandboxed PaaS. +func IsTerminal(fd uintptr) bool { + return false +} + +// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 // terminal. This is also always false on this environment. func IsCygwinTerminal(fd uintptr) bool { return false diff --git a/vendor/github.com/mattn/go-isatty/isatty_solaris.go b/vendor/github.com/mattn/go-isatty/isatty_solaris.go index 1f0c6bf53..bdd5c79a0 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_solaris.go +++ b/vendor/github.com/mattn/go-isatty/isatty_solaris.go @@ -14,3 +14,9 @@ func IsTerminal(fd uintptr) bool { err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) return err == nil } + +// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 +// terminal. This is also always false on this environment. +func IsCygwinTerminal(fd uintptr) bool { + return false +} diff --git a/vendor/github.com/vmihailenco/msgpack/.travis.yml b/vendor/github.com/vmihailenco/msgpack/.travis.yml index 7054dcdd8..0c2f74ed4 100644 --- a/vendor/github.com/vmihailenco/msgpack/.travis.yml +++ b/vendor/github.com/vmihailenco/msgpack/.travis.yml @@ -6,6 +6,7 @@ go: - 1.8.x - 1.9.x - 1.10.x + - 1.11.x - tip matrix: diff --git a/vendor/github.com/vmihailenco/msgpack/CHANGELOG.md b/vendor/github.com/vmihailenco/msgpack/CHANGELOG.md index 569e171fe..9a4f38a93 100644 --- a/vendor/github.com/vmihailenco/msgpack/CHANGELOG.md +++ b/vendor/github.com/vmihailenco/msgpack/CHANGELOG.md @@ -1,3 +1,9 @@ +## 3.4 + +- Encode, Decode, Marshal, and Unmarshal are changed to accept single argument. EncodeMulti and DecodeMulti are added as replacement. +- Added EncodeInt8/16/32/64 and EncodeUint8/16/32/64. +- Encoder changed to preserve type of numbers instead of chosing most compact encoding. The old behavior can be achieved with Encoder.UseCompactEncoding. + ## v3.3 - `msgpack:",inline"` tag is restored to force inlining structs. diff --git a/vendor/github.com/vmihailenco/msgpack/decode.go b/vendor/github.com/vmihailenco/msgpack/decode.go index 7ad2cf6cf..741410040 100644 --- a/vendor/github.com/vmihailenco/msgpack/decode.go +++ b/vendor/github.com/vmihailenco/msgpack/decode.go @@ -32,8 +32,8 @@ func makeBuffer() []byte { // Unmarshal decodes the MessagePack-encoded data and stores the result // in the value pointed to by v. -func Unmarshal(data []byte, v ...interface{}) error { - return NewDecoder(bytes.NewReader(data)).Decode(v...) +func Unmarshal(data []byte, v interface{}) error { + return NewDecoder(bytes.NewReader(data)).Decode(v) } type Decoder struct { @@ -57,8 +57,6 @@ type Decoder struct { // by passing a reader that implements io.ByteScanner interface. func NewDecoder(r io.Reader) *Decoder { d := &Decoder{ - decodeMapFunc: decodeMap, - buf: makeBuffer(), } d.resetReader(r) @@ -93,18 +91,9 @@ func (d *Decoder) resetReader(r io.Reader) { d.s = reader } -func (d *Decoder) Decode(v ...interface{}) error { - for _, vv := range v { - if err := d.decode(vv); err != nil { - return err - } - } - return nil -} - -func (d *Decoder) decode(dst interface{}) error { +func (d *Decoder) Decode(v interface{}) error { var err error - switch v := dst.(type) { + switch v := v.(type) { case *string: if v != nil { *v, err = d.DecodeString() @@ -198,21 +187,30 @@ func (d *Decoder) decode(dst interface{}) error { } } - v := reflect.ValueOf(dst) - if !v.IsValid() { + vv := reflect.ValueOf(v) + if !vv.IsValid() { return errors.New("msgpack: Decode(nil)") } - if v.Kind() != reflect.Ptr { - return fmt.Errorf("msgpack: Decode(nonsettable %T)", dst) + if vv.Kind() != reflect.Ptr { + return fmt.Errorf("msgpack: Decode(nonsettable %T)", v) } - v = v.Elem() - if !v.IsValid() { - return fmt.Errorf("msgpack: Decode(nonsettable %T)", dst) + vv = vv.Elem() + if !vv.IsValid() { + return fmt.Errorf("msgpack: Decode(nonsettable %T)", v) } - return d.DecodeValue(v) + return d.DecodeValue(vv) } -func (d *Decoder) decodeInterface() (interface{}, error) { +func (d *Decoder) DecodeMulti(v ...interface{}) error { + for _, vv := range v { + if err := d.Decode(vv); err != nil { + return err + } + } + return nil +} + +func (d *Decoder) decodeInterfaceCond() (interface{}, error) { if d.useLoose { return d.DecodeInterfaceLoose() } @@ -289,7 +287,10 @@ func (d *Decoder) DecodeInterface() (interface{}, error) { return int8(c), nil } if codes.IsFixedMap(c) { - _ = d.s.UnreadByte() + err = d.s.UnreadByte() + if err != nil { + return nil, err + } return d.DecodeMap() } if codes.IsFixedArray(c) { @@ -331,7 +332,10 @@ func (d *Decoder) DecodeInterface() (interface{}, error) { case codes.Array16, codes.Array32: return d.decodeSlice(c) case codes.Map16, codes.Map32: - d.s.UnreadByte() + err = d.s.UnreadByte() + if err != nil { + return nil, err + } return d.DecodeMap() case codes.FixExt1, codes.FixExt2, codes.FixExt4, codes.FixExt8, codes.FixExt16, codes.Ext8, codes.Ext16, codes.Ext32: @@ -355,7 +359,10 @@ func (d *Decoder) DecodeInterfaceLoose() (interface{}, error) { return int64(c), nil } if codes.IsFixedMap(c) { - d.s.UnreadByte() + err = d.s.UnreadByte() + if err != nil { + return nil, err + } return d.DecodeMap() } if codes.IsFixedArray(c) { @@ -383,7 +390,10 @@ func (d *Decoder) DecodeInterfaceLoose() (interface{}, error) { case codes.Array16, codes.Array32: return d.decodeSlice(c) case codes.Map16, codes.Map32: - d.s.UnreadByte() + err = d.s.UnreadByte() + if err != nil { + return nil, err + } return d.DecodeMap() case codes.FixExt1, codes.FixExt2, codes.FixExt4, codes.FixExt8, codes.FixExt16, codes.Ext8, codes.Ext16, codes.Ext32: diff --git a/vendor/github.com/vmihailenco/msgpack/decode_map.go b/vendor/github.com/vmihailenco/msgpack/decode_map.go index b08e8568d..b542a7541 100644 --- a/vendor/github.com/vmihailenco/msgpack/decode_map.go +++ b/vendor/github.com/vmihailenco/msgpack/decode_map.go @@ -19,13 +19,13 @@ var mapStringInterfaceType = mapStringInterfacePtrType.Elem() var errInvalidCode = errors.New("invalid code") func decodeMapValue(d *Decoder, v reflect.Value) error { - n, err := d.DecodeMapLen() + size, err := d.DecodeMapLen() if err != nil { return err } typ := v.Type() - if n == -1 { + if size == -1 { v.Set(reflect.Zero(typ)) return nil } @@ -33,10 +33,19 @@ func decodeMapValue(d *Decoder, v reflect.Value) error { if v.IsNil() { v.Set(reflect.MakeMap(typ)) } + if size == 0 { + return nil + } + + return decodeMapValueSize(d, v, size) +} + +func decodeMapValueSize(d *Decoder, v reflect.Value, size int) error { + typ := v.Type() keyType := typ.Key() valueType := typ.Elem() - for i := 0; i < n; i++ { + for i := 0; i < size; i++ { mk := reflect.New(keyType).Elem() if err := d.DecodeValue(mk); err != nil { return err @@ -53,30 +62,7 @@ func decodeMapValue(d *Decoder, v reflect.Value) error { return nil } -func decodeMap(d *Decoder) (interface{}, error) { - n, err := d.DecodeMapLen() - if err != nil { - return nil, err - } - if n == -1 { - return nil, nil - } - - m := make(map[string]interface{}, min(n, mapElemsAllocLimit)) - for i := 0; i < n; i++ { - mk, err := d.DecodeString() - if err != nil { - return nil, err - } - mv, err := d.decodeInterface() - if err != nil { - return nil, err - } - m[mk] = mv - } - return m, nil -} - +// DecodeMapLen decodes map length. Length is -1 when map is nil. func (d *Decoder) DecodeMapLen() (int, error) { c, err := d.readCode() if err != nil { @@ -97,9 +83,9 @@ func (d *Decoder) DecodeMapLen() (int, error) { } func (d *Decoder) mapLen(c codes.Code) (int, error) { - n, err := d._mapLen(c) + size, err := d._mapLen(c) err = expandInvalidCodeMapLenError(c, err) - return n, err + return size, err } func (d *Decoder) _mapLen(c codes.Code) (int, error) { @@ -110,12 +96,12 @@ func (d *Decoder) _mapLen(c codes.Code) (int, error) { return int(c & codes.FixedMapMask), nil } if c == codes.Map16 { - n, err := d.uint16() - return int(n), err + size, err := d.uint16() + return int(size), err } if c == codes.Map32 { - n, err := d.uint32() - return int(n), err + size, err := d.uint32() + return int(size), err } return 0, errInvalidCode } @@ -133,22 +119,22 @@ func decodeMapStringStringValue(d *Decoder, v reflect.Value) error { } func (d *Decoder) decodeMapStringStringPtr(ptr *map[string]string) error { - n, err := d.DecodeMapLen() + size, err := d.DecodeMapLen() if err != nil { return err } - if n == -1 { + if size == -1 { *ptr = nil return nil } m := *ptr if m == nil { - *ptr = make(map[string]string, min(n, mapElemsAllocLimit)) + *ptr = make(map[string]string, min(size, mapElemsAllocLimit)) m = *ptr } - for i := 0; i < n; i++ { + for i := 0; i < size; i++ { mk, err := d.DecodeString() if err != nil { return err @@ -189,7 +175,7 @@ func (d *Decoder) decodeMapStringInterfacePtr(ptr *map[string]interface{}) error if err != nil { return err } - mv, err := d.decodeInterface() + mv, err := d.decodeInterfaceCond() if err != nil { return err } @@ -200,7 +186,70 @@ func (d *Decoder) decodeMapStringInterfacePtr(ptr *map[string]interface{}) error } func (d *Decoder) DecodeMap() (interface{}, error) { - return d.decodeMapFunc(d) + if d.decodeMapFunc != nil { + return d.decodeMapFunc(d) + } + + size, err := d.DecodeMapLen() + if err != nil { + return nil, err + } + if size == -1 { + return nil, nil + } + if size == 0 { + return make(map[string]interface{}), nil + } + + code, err := d.PeekCode() + if err != nil { + return nil, err + } + + if codes.IsString(code) { + return d.decodeMapStringInterfaceSize(size) + } + + key, err := d.decodeInterfaceCond() + if err != nil { + return nil, err + } + + value, err := d.decodeInterfaceCond() + if err != nil { + return nil, err + } + + keyType := reflect.TypeOf(key) + valueType := reflect.TypeOf(value) + mapType := reflect.MapOf(keyType, valueType) + mapValue := reflect.MakeMap(mapType) + + mapValue.SetMapIndex(reflect.ValueOf(key), reflect.ValueOf(value)) + size-- + + err = decodeMapValueSize(d, mapValue, size) + if err != nil { + return nil, err + } + + return mapValue.Interface(), nil +} + +func (d *Decoder) decodeMapStringInterfaceSize(size int) (map[string]interface{}, error) { + m := make(map[string]interface{}, min(size, mapElemsAllocLimit)) + for i := 0; i < size; i++ { + mk, err := d.DecodeString() + if err != nil { + return nil, err + } + mv, err := d.decodeInterfaceCond() + if err != nil { + return nil, err + } + m[mk] = mv + } + return m, nil } func (d *Decoder) skipMap(c codes.Code) error { diff --git a/vendor/github.com/vmihailenco/msgpack/decode_query.go b/vendor/github.com/vmihailenco/msgpack/decode_query.go index 97c663ad4..d680be80c 100644 --- a/vendor/github.com/vmihailenco/msgpack/decode_query.go +++ b/vendor/github.com/vmihailenco/msgpack/decode_query.go @@ -43,7 +43,7 @@ func (d *Decoder) Query(query string) ([]interface{}, error) { func (d *Decoder) query(q *queryResult) error { q.nextKey() if q.key == "" { - v, err := d.decodeInterface() + v, err := d.decodeInterfaceCond() if err != nil { return err } diff --git a/vendor/github.com/vmihailenco/msgpack/decode_slice.go b/vendor/github.com/vmihailenco/msgpack/decode_slice.go index fef87aad7..778d80b93 100644 --- a/vendor/github.com/vmihailenco/msgpack/decode_slice.go +++ b/vendor/github.com/vmihailenco/msgpack/decode_slice.go @@ -11,6 +11,7 @@ const sliceElemsAllocLimit = 1e4 var sliceStringPtrType = reflect.TypeOf((*[]string)(nil)) +// DecodeArrayLen decodes array length. Length is -1 when array is nil. func (d *Decoder) DecodeArrayLen() (int, error) { c, err := d.readCode() if err != nil { @@ -166,7 +167,7 @@ func (d *Decoder) decodeSlice(c codes.Code) ([]interface{}, error) { s := make([]interface{}, 0, min(n, sliceElemsAllocLimit)) for i := 0; i < n; i++ { - v, err := d.decodeInterface() + v, err := d.decodeInterfaceCond() if err != nil { return nil, err } diff --git a/vendor/github.com/vmihailenco/msgpack/decode_value.go b/vendor/github.com/vmihailenco/msgpack/decode_value.go index 10022b478..7b858b5fc 100644 --- a/vendor/github.com/vmihailenco/msgpack/decode_value.go +++ b/vendor/github.com/vmihailenco/msgpack/decode_value.go @@ -4,8 +4,6 @@ import ( "errors" "fmt" "reflect" - - "github.com/vmihailenco/msgpack/codes" ) var interfaceType = reflect.TypeOf((*interface{})(nil)).Elem() @@ -53,7 +51,8 @@ func mustSet(v reflect.Value) error { func getDecoder(typ reflect.Type) decoderFunc { kind := typ.Kind() - if decoder, ok := typDecMap[typ]; ok { + decoder, ok := typDecMap[typ] + if ok { return decoder } @@ -112,7 +111,9 @@ func ptrDecoderFunc(typ reflect.Type) decoderFunc { if err := mustSet(v); err != nil { return err } - v.Set(reflect.Zero(v.Type())) + if !v.IsNil() { + v.Set(reflect.Zero(v.Type())) + } return d.DecodeNil() } if v.IsNil() { @@ -133,36 +134,7 @@ func decodeCustomValueAddr(d *Decoder, v reflect.Value) error { } func decodeCustomValue(d *Decoder, v reflect.Value) error { - c, err := d.PeekCode() - if err != nil { - return err - } - - if codes.IsExt(c) { - c, err = d.readCode() - if err != nil { - return err - } - - extLen, err := d.parseExtLen(c) - if err != nil { - return err - } - - _, err = d.readCode() - if err != nil { - return err - } - - c, err = d.PeekCode() - if err != nil { - return err - } - - d.extLen = extLen - } - - if c == codes.Nil { + if d.hasNilCode() { return d.decodeNilValue(v) } @@ -182,37 +154,7 @@ func unmarshalValueAddr(d *Decoder, v reflect.Value) error { } func unmarshalValue(d *Decoder, v reflect.Value) error { - c, err := d.PeekCode() - if err != nil { - return err - } - - extLen := d.extLen - d.extLen = 0 - - if extLen == 0 && codes.IsExt(c) { - c, err = d.readCode() - if err != nil { - return err - } - - extLen, err = d.parseExtLen(c) - if err != nil { - return err - } - - _, err = d.readCode() - if err != nil { - return err - } - - c, err = d.PeekCode() - if err != nil { - return err - } - } - - if c == codes.Nil { + if d.hasNilCode() { return d.decodeNilValue(v) } @@ -220,8 +162,8 @@ func unmarshalValue(d *Decoder, v reflect.Value) error { v.Set(reflect.New(v.Type().Elem())) } - if extLen != 0 { - b, err := d.readN(extLen) + if d.extLen != 0 { + b, err := d.readN(d.extLen) if err != nil { return err } @@ -234,7 +176,7 @@ func unmarshalValue(d *Decoder, v reflect.Value) error { } unmarshaler := v.Interface().(Unmarshaler) - err = unmarshaler.UnmarshalMsgpack(d.rec) + err := unmarshaler.UnmarshalMsgpack(d.rec) d.rec = nil return err } @@ -268,7 +210,7 @@ func decodeInterfaceValue(d *Decoder, v reflect.Value) error { } func (d *Decoder) interfaceValue(v reflect.Value) error { - vv, err := d.decodeInterface() + vv, err := d.decodeInterfaceCond() if err != nil { return err } diff --git a/vendor/github.com/vmihailenco/msgpack/encode.go b/vendor/github.com/vmihailenco/msgpack/encode.go index 2da9a6a52..c2bb23cde 100644 --- a/vendor/github.com/vmihailenco/msgpack/encode.go +++ b/vendor/github.com/vmihailenco/msgpack/encode.go @@ -43,9 +43,9 @@ func (w *byteWriter) WriteString(s string) (int, error) { } // Marshal returns the MessagePack encoding of v. -func Marshal(v ...interface{}) ([]byte, error) { +func Marshal(v interface{}) ([]byte, error) { var buf bytes.Buffer - err := NewEncoder(&buf).Encode(v...) + err := NewEncoder(&buf).Encode(v) return buf.Bytes(), err } @@ -56,6 +56,7 @@ type Encoder struct { sortMapKeys bool structAsArray bool useJSONTag bool + useCompact bool } // NewEncoder returns a new encoder that writes to w. @@ -74,34 +75,32 @@ func NewEncoder(w io.Writer) *Encoder { // Supported map types are: // - map[string]string // - map[string]interface{} -func (e *Encoder) SortMapKeys(v bool) *Encoder { - e.sortMapKeys = v +func (e *Encoder) SortMapKeys(flag bool) *Encoder { + e.sortMapKeys = flag return e } // StructAsArray causes the Encoder to encode Go structs as MessagePack arrays. -func (e *Encoder) StructAsArray(v bool) *Encoder { - e.structAsArray = v +func (e *Encoder) StructAsArray(flag bool) *Encoder { + e.structAsArray = flag return e } // UseJSONTag causes the Encoder to use json struct tag as fallback option // if there is no msgpack tag. -func (e *Encoder) UseJSONTag(v bool) *Encoder { - e.useJSONTag = v +func (e *Encoder) UseJSONTag(flag bool) *Encoder { + e.useJSONTag = flag return e } -func (e *Encoder) Encode(v ...interface{}) error { - for _, vv := range v { - if err := e.encode(vv); err != nil { - return err - } - } - return nil +// UseCompactEncoding causes the Encoder to chose the most compact encoding. +// For example, it allows to encode Go int64 as msgpack int8 saving 7 bytes. +func (e *Encoder) UseCompactEncoding(flag bool) *Encoder { + e.useCompact = flag + return e } -func (e *Encoder) encode(v interface{}) error { +func (e *Encoder) Encode(v interface{}) error { switch v := v.(type) { case nil: return e.EncodeNil() @@ -110,13 +109,13 @@ func (e *Encoder) encode(v interface{}) error { case []byte: return e.EncodeBytes(v) case int: - return e.EncodeInt(int64(v)) + return e.encodeInt64Cond(int64(v)) case int64: - return e.EncodeInt(v) + return e.encodeInt64Cond(v) case uint: - return e.EncodeUint(uint64(v)) + return e.encodeUint64Cond(uint64(v)) case uint64: - return e.EncodeUint(v) + return e.encodeUint64Cond(v) case bool: return e.EncodeBool(v) case float32: @@ -124,16 +123,25 @@ func (e *Encoder) encode(v interface{}) error { case float64: return e.EncodeFloat64(v) case time.Duration: - return e.EncodeInt(int64(v)) + return e.encodeInt64Cond(int64(v)) case time.Time: return e.EncodeTime(v) } return e.EncodeValue(reflect.ValueOf(v)) } +func (e *Encoder) EncodeMulti(v ...interface{}) error { + for _, vv := range v { + if err := e.Encode(vv); err != nil { + return err + } + } + return nil +} + func (e *Encoder) EncodeValue(v reflect.Value) error { - encode := getEncoder(v.Type()) - return encode(e, v) + fn := getEncoder(v.Type()) + return fn(e, v) } func (e *Encoder) EncodeNil() error { diff --git a/vendor/github.com/vmihailenco/msgpack/encode_map.go b/vendor/github.com/vmihailenco/msgpack/encode_map.go index f1e9f5091..a87c4075f 100644 --- a/vendor/github.com/vmihailenco/msgpack/encode_map.go +++ b/vendor/github.com/vmihailenco/msgpack/encode_map.go @@ -125,7 +125,7 @@ func (e *Encoder) EncodeMapLen(l int) error { return e.writeCode(codes.FixedMapLow | codes.Code(l)) } if l < 65536 { - return e.write2(codes.Map16, uint64(l)) + return e.write2(codes.Map16, uint16(l)) } return e.write4(codes.Map32, uint32(l)) } diff --git a/vendor/github.com/vmihailenco/msgpack/encode_number.go b/vendor/github.com/vmihailenco/msgpack/encode_number.go index e3615850a..dd7db6fdd 100644 --- a/vendor/github.com/vmihailenco/msgpack/encode_number.go +++ b/vendor/github.com/vmihailenco/msgpack/encode_number.go @@ -7,41 +7,139 @@ import ( "github.com/vmihailenco/msgpack/codes" ) -// EncodeUint encodes an uint64 in 1, 2, 3, 5, or 9 bytes. -func (e *Encoder) EncodeUint(v uint64) error { - if v <= math.MaxInt8 { - return e.w.WriteByte(byte(v)) +// EncodeUint8 encodes an uint8 in 2 bytes preserving type of the number. +func (e *Encoder) EncodeUint8(n uint8) error { + return e.write1(codes.Uint8, n) +} + +func (e *Encoder) encodeUint8Cond(n uint8) error { + if e.useCompact { + return e.EncodeUint(uint64(n)) + } + return e.EncodeUint8(n) +} + +// EncodeUint16 encodes an uint16 in 3 bytes preserving type of the number. +func (e *Encoder) EncodeUint16(n uint16) error { + return e.write2(codes.Uint16, n) +} + +func (e *Encoder) encodeUint16Cond(n uint16) error { + if e.useCompact { + return e.EncodeUint(uint64(n)) + } + return e.EncodeUint16(n) +} + +// EncodeUint32 encodes an uint16 in 5 bytes preserving type of the number. +func (e *Encoder) EncodeUint32(n uint32) error { + return e.write4(codes.Uint32, n) +} + +func (e *Encoder) encodeUint32Cond(n uint32) error { + if e.useCompact { + return e.EncodeUint(uint64(n)) + } + return e.EncodeUint32(n) +} + +// EncodeUint64 encodes an uint16 in 9 bytes preserving type of the number. +func (e *Encoder) EncodeUint64(n uint64) error { + return e.write8(codes.Uint64, n) +} + +func (e *Encoder) encodeUint64Cond(n uint64) error { + if e.useCompact { + return e.EncodeUint(n) + } + return e.EncodeUint64(n) +} + +// EncodeInt8 encodes an int8 in 2 bytes preserving type of the number. +func (e *Encoder) EncodeInt8(n int8) error { + return e.write1(codes.Int8, uint8(n)) +} + +func (e *Encoder) encodeInt8Cond(n int8) error { + if e.useCompact { + return e.EncodeInt(int64(n)) + } + return e.EncodeInt8(n) +} + +// EncodeInt16 encodes an int16 in 3 bytes preserving type of the number. +func (e *Encoder) EncodeInt16(n int16) error { + return e.write2(codes.Int16, uint16(n)) +} + +func (e *Encoder) encodeInt16Cond(n int16) error { + if e.useCompact { + return e.EncodeInt(int64(n)) + } + return e.EncodeInt16(n) +} + +// EncodeInt32 encodes an int32 in 5 bytes preserving type of the number. +func (e *Encoder) EncodeInt32(n int32) error { + return e.write4(codes.Int32, uint32(n)) +} + +func (e *Encoder) encodeInt32Cond(n int32) error { + if e.useCompact { + return e.EncodeInt(int64(n)) + } + return e.EncodeInt32(n) +} + +// EncodeInt64 encodes an int64 in 9 bytes preserving type of the number. +func (e *Encoder) EncodeInt64(n int64) error { + return e.write8(codes.Int64, uint64(n)) +} + +func (e *Encoder) encodeInt64Cond(n int64) error { + if e.useCompact { + return e.EncodeInt(n) + } + return e.EncodeInt64(n) +} + +// EncodeUnsignedNumber encodes an uint64 in 1, 2, 3, 5, or 9 bytes. +// Type of the number is lost during encoding. +func (e *Encoder) EncodeUint(n uint64) error { + if n <= math.MaxInt8 { + return e.w.WriteByte(byte(n)) } - if v <= math.MaxUint8 { - return e.write1(codes.Uint8, v) + if n <= math.MaxUint8 { + return e.EncodeUint8(uint8(n)) } - if v <= math.MaxUint16 { - return e.write2(codes.Uint16, v) + if n <= math.MaxUint16 { + return e.EncodeUint16(uint16(n)) } - if v <= math.MaxUint32 { - return e.write4(codes.Uint32, uint32(v)) + if n <= math.MaxUint32 { + return e.EncodeUint32(uint32(n)) } - return e.write8(codes.Uint64, v) + return e.EncodeUint64(uint64(n)) } -// EncodeInt encodes an int64 in 1, 2, 3, 5, or 9 bytes. -func (e *Encoder) EncodeInt(v int64) error { - if v >= 0 { - return e.EncodeUint(uint64(v)) +// EncodeNumber encodes an int64 in 1, 2, 3, 5, or 9 bytes. +// Type of number is lost during encoding. +func (e *Encoder) EncodeInt(n int64) error { + if n >= 0 { + return e.EncodeUint(uint64(n)) } - if v >= int64(int8(codes.NegFixedNumLow)) { - return e.w.WriteByte(byte(v)) + if n >= int64(int8(codes.NegFixedNumLow)) { + return e.w.WriteByte(byte(n)) } - if v >= math.MinInt8 { - return e.write1(codes.Int8, uint64(v)) + if n >= math.MinInt8 { + return e.EncodeInt8(int8(n)) } - if v >= math.MinInt16 { - return e.write2(codes.Int16, uint64(v)) + if n >= math.MinInt16 { + return e.EncodeInt16(int16(n)) } - if v >= math.MinInt32 { - return e.write4(codes.Int32, uint32(v)) + if n >= math.MinInt32 { + return e.EncodeInt32(int32(n)) } - return e.write8(codes.Int64, uint64(v)) + return e.EncodeInt64(int64(n)) } func (e *Encoder) EncodeFloat32(n float32) error { @@ -52,14 +150,14 @@ func (e *Encoder) EncodeFloat64(n float64) error { return e.write8(codes.Double, math.Float64bits(n)) } -func (e *Encoder) write1(code codes.Code, n uint64) error { +func (e *Encoder) write1(code codes.Code, n uint8) error { e.buf = e.buf[:2] e.buf[0] = byte(code) e.buf[1] = byte(n) return e.write(e.buf) } -func (e *Encoder) write2(code codes.Code, n uint64) error { +func (e *Encoder) write2(code codes.Code, n uint16) error { e.buf = e.buf[:3] e.buf[0] = byte(code) e.buf[1] = byte(n >> 8) @@ -91,12 +189,36 @@ func (e *Encoder) write8(code codes.Code, n uint64) error { return e.write(e.buf) } -func encodeInt64Value(e *Encoder, v reflect.Value) error { - return e.EncodeInt(v.Int()) +func encodeUint8CondValue(e *Encoder, v reflect.Value) error { + return e.encodeUint8Cond(uint8(v.Uint())) +} + +func encodeUint16CondValue(e *Encoder, v reflect.Value) error { + return e.encodeUint16Cond(uint16(v.Uint())) +} + +func encodeUint32CondValue(e *Encoder, v reflect.Value) error { + return e.encodeUint32Cond(uint32(v.Uint())) +} + +func encodeUint64CondValue(e *Encoder, v reflect.Value) error { + return e.encodeUint64Cond(v.Uint()) +} + +func encodeInt8CondValue(e *Encoder, v reflect.Value) error { + return e.encodeInt8Cond(int8(v.Int())) +} + +func encodeInt16CondValue(e *Encoder, v reflect.Value) error { + return e.encodeInt16Cond(int16(v.Int())) +} + +func encodeInt32CondValue(e *Encoder, v reflect.Value) error { + return e.encodeInt32Cond(int32(v.Int())) } -func encodeUint64Value(e *Encoder, v reflect.Value) error { - return e.EncodeUint(v.Uint()) +func encodeInt64CondValue(e *Encoder, v reflect.Value) error { + return e.encodeInt64Cond(v.Int()) } func encodeFloat32Value(e *Encoder, v reflect.Value) error { diff --git a/vendor/github.com/vmihailenco/msgpack/encode_slice.go b/vendor/github.com/vmihailenco/msgpack/encode_slice.go index 8f01e9534..5ddbd6311 100644 --- a/vendor/github.com/vmihailenco/msgpack/encode_slice.go +++ b/vendor/github.com/vmihailenco/msgpack/encode_slice.go @@ -40,10 +40,10 @@ func grow(b []byte, n int) []byte { func (e *Encoder) EncodeBytesLen(l int) error { if l < 256 { - return e.write1(codes.Bin8, uint64(l)) + return e.write1(codes.Bin8, uint8(l)) } if l < 65536 { - return e.write2(codes.Bin16, uint64(l)) + return e.write2(codes.Bin16, uint16(l)) } return e.write4(codes.Bin32, uint32(l)) } @@ -53,10 +53,10 @@ func (e *Encoder) encodeStrLen(l int) error { return e.writeCode(codes.FixedStrLow | codes.Code(l)) } if l < 256 { - return e.write1(codes.Str8, uint64(l)) + return e.write1(codes.Str8, uint8(l)) } if l < 65536 { - return e.write2(codes.Str16, uint64(l)) + return e.write2(codes.Str16, uint16(l)) } return e.write4(codes.Str32, uint32(l)) } @@ -83,7 +83,7 @@ func (e *Encoder) EncodeArrayLen(l int) error { return e.writeCode(codes.FixedArrayLow | codes.Code(l)) } if l < 65536 { - return e.write2(codes.Array16, uint64(l)) + return e.write2(codes.Array16, uint16(l)) } return e.write4(codes.Array32, uint32(l)) } diff --git a/vendor/github.com/vmihailenco/msgpack/encode_value.go b/vendor/github.com/vmihailenco/msgpack/encode_value.go index 2f5a3509a..b46ab02a1 100644 --- a/vendor/github.com/vmihailenco/msgpack/encode_value.go +++ b/vendor/github.com/vmihailenco/msgpack/encode_value.go @@ -10,16 +10,16 @@ var valueEncoders []encoderFunc func init() { valueEncoders = []encoderFunc{ reflect.Bool: encodeBoolValue, - reflect.Int: encodeInt64Value, - reflect.Int8: encodeInt64Value, - reflect.Int16: encodeInt64Value, - reflect.Int32: encodeInt64Value, - reflect.Int64: encodeInt64Value, - reflect.Uint: encodeUint64Value, - reflect.Uint8: encodeUint64Value, - reflect.Uint16: encodeUint64Value, - reflect.Uint32: encodeUint64Value, - reflect.Uint64: encodeUint64Value, + reflect.Int: encodeInt64CondValue, + reflect.Int8: encodeInt8CondValue, + reflect.Int16: encodeInt16CondValue, + reflect.Int32: encodeInt32CondValue, + reflect.Int64: encodeInt64CondValue, + reflect.Uint: encodeUint64CondValue, + reflect.Uint8: encodeUint8CondValue, + reflect.Uint16: encodeUint16CondValue, + reflect.Uint32: encodeUint32CondValue, + reflect.Uint64: encodeUint64CondValue, reflect.Float32: encodeFloat32Value, reflect.Float64: encodeFloat64Value, reflect.Complex64: encodeUnsupportedValue, diff --git a/vendor/github.com/vmihailenco/msgpack/ext.go b/vendor/github.com/vmihailenco/msgpack/ext.go index 420f01be0..7970be852 100644 --- a/vendor/github.com/vmihailenco/msgpack/ext.go +++ b/vendor/github.com/vmihailenco/msgpack/ext.go @@ -34,7 +34,7 @@ func RegisterExt(id int8, value interface{}) { panic(fmt.Errorf("msgpack: ext with id=%d is already registered", id)) } - registerExt(id, ptr, getEncoder(ptr), nil) + registerExt(id, ptr, getEncoder(ptr), getDecoder(ptr)) registerExt(id, typ, getEncoder(typ), getDecoder(typ)) } @@ -46,7 +46,7 @@ func registerExt(id int8, typ reflect.Type, enc encoderFunc, dec decoderFunc) { typEncMap[typ] = makeExtEncoder(id, enc) } if dec != nil { - typDecMap[typ] = dec + typDecMap[typ] = makeExtDecoder(id, dec) } } @@ -75,13 +75,39 @@ func makeExtEncoder(typeId int8, enc encoderFunc) encoderFunc { return err } - if err := e.EncodeExtHeader(typeId, buf.Len()); err != nil { + err = e.EncodeExtHeader(typeId, buf.Len()) + if err != nil { return err } return e.write(buf.Bytes()) } } +func makeExtDecoder(typeId int8, dec decoderFunc) decoderFunc { + return func(d *Decoder, v reflect.Value) error { + c, err := d.PeekCode() + if err != nil { + return err + } + + if !codes.IsExt(c) { + return dec(d, v) + } + + id, extLen, err := d.DecodeExtHeader() + if err != nil { + return err + } + + if id != typeId { + return fmt.Errorf("msgpack: got ext type=%d, wanted %d", int8(c), typeId) + } + + d.extLen = extLen + return dec(d, v) + } +} + func (e *Encoder) encodeExtLen(l int) error { switch l { case 1: @@ -96,10 +122,10 @@ func (e *Encoder) encodeExtLen(l int) error { return e.writeCode(codes.FixExt16) } if l < 256 { - return e.write1(codes.Ext8, uint64(l)) + return e.write1(codes.Ext8, uint8(l)) } if l < 65536 { - return e.write2(codes.Ext16, uint64(l)) + return e.write2(codes.Ext16, uint16(l)) } return e.write4(codes.Ext32, uint32(l)) } diff --git a/vendor/github.com/vmihailenco/msgpack/types.go b/vendor/github.com/vmihailenco/msgpack/types.go index 4013010e7..6a1bf7f91 100644 --- a/vendor/github.com/vmihailenco/msgpack/types.go +++ b/vendor/github.com/vmihailenco/msgpack/types.go @@ -179,12 +179,15 @@ func getFields(typ reflect.Type, useJSONTag bool) *fields { field.name = f.Name } - if f.Anonymous { - if opt.Contains("inline") { + if f.Anonymous && !opt.Contains("noinline") { + inline := opt.Contains("inline") + if inline { inlineFields(fs, f.Type, field, useJSONTag) - continue + } else { + inline = autoinlineFields(fs, f.Type, field, useJSONTag) } - if autoinlineFields(fs, f.Type, field, useJSONTag) { + if inline { + fs.Table[field.name] = field continue } } @@ -242,7 +245,7 @@ func autoinlineFields(fs *fields, typ reflect.Type, f *field, useJSONTag bool) b inlinedFields := getFields(typ, useJSONTag).List for _, field := range inlinedFields { if _, ok := fs.Table[field.name]; ok { - // Don't inline shadowed fields. + // Don't auto inline if there are shadowed fields. return false } } diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/BatchClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/BatchClient.go new file mode 100644 index 000000000..bc2df44c5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/BatchClient.go @@ -0,0 +1,30 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Batch + * Used by client-side stubs. + */ + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type BatchClient interface { + + // Enables you to make multiple API requests using a single request. The batch API takes in an array of logical HTTP requests represented as JSON arrays. Each request has a method (GET, PUT, POST, or DELETE), a relative_url (the portion of the URL after https:///api/), optional headers array (corresponding to HTTP headers) and an optional body (for POST and PUT requests). The batch API returns an array of logical HTTP responses represented as JSON arrays. Each response has a status code, an optional headers array and an optional body (which is a JSON-encoded string). + // + // @param batchRequestParam (required) + // @param atomicParam transactional atomicity for the batch of requests embedded in the batch list (optional, default to false) + // @return com.vmware.nsx_global_policy.model.BatchResponse + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(batchRequestParam model.BatchRequest, atomicParam *bool) (model.BatchResponse, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/BatchTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/BatchTypes.go new file mode 100644 index 000000000..e74333901 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/BatchTypes.go @@ -0,0 +1,81 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Batch. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package nsx_global_policy + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func batchCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["batch_request"] = bindings.NewReferenceType(model.BatchRequestBindingType) + fields["atomic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["batch_request"] = "BatchRequest" + fieldNameMap["atomic"] = "Atomic" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func batchCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BatchResponseBindingType) +} + +func batchCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["batch_request"] = bindings.NewReferenceType(model.BatchRequestBindingType) + fields["atomic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["batch_request"] = "BatchRequest" + fieldNameMap["atomic"] = "Atomic" + paramsTypeMap["batch_request"] = bindings.NewReferenceType(model.BatchRequestBindingType) + paramsTypeMap["atomic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["atomic"] = "atomic" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "batch_request", + "POST", + "/global-manager/api/v1/batch", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ClusterClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ClusterClient.go new file mode 100644 index 000000000..28c4547bc --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ClusterClient.go @@ -0,0 +1,34 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Cluster + * Used by client-side stubs. + */ + +package nsx_global_policy + + +type ClusterClient interface { + + // Request one-time backup. The backup will be uploaded using the same server configuration as for automatic backup. + // + // @param frameTypeParam Frame type (optional, default to LOCAL_LOCAL_MANAGER) + // @param siteIdParam Site ID (optional, default to localhost) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Backuptoremote(frameTypeParam *string, siteIdParam *string) error + + // Request one-time inventory summary. The backup will be uploaded using the same server configuration as for an automatic backup. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Summarizeinventorytoremote() error +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ClusterTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ClusterTypes.go new file mode 100644 index 000000000..2a336c969 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ClusterTypes.go @@ -0,0 +1,132 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Cluster. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package nsx_global_policy + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``frameType`` of method Cluster#backuptoremote. +const Cluster_BACKUPTOREMOTE_FRAME_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" +// Possible value for ``frameType`` of method Cluster#backuptoremote. +const Cluster_BACKUPTOREMOTE_FRAME_TYPE_LOCAL_MANAGER = "LOCAL_MANAGER" +// Possible value for ``frameType`` of method Cluster#backuptoremote. +const Cluster_BACKUPTOREMOTE_FRAME_TYPE_LOCAL_LOCAL_MANAGER = "LOCAL_LOCAL_MANAGER" +// Possible value for ``frameType`` of method Cluster#backuptoremote. +const Cluster_BACKUPTOREMOTE_FRAME_TYPE_NSX_INTELLIGENCE = "NSX_INTELLIGENCE" + + + + +func clusterBackuptoremoteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["frame_type"] = "FrameType" + fieldNameMap["site_id"] = "SiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterBackuptoremoteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterBackuptoremoteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["frame_type"] = "FrameType" + fieldNameMap["site_id"] = "SiteId" + paramsTypeMap["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["site_id"] = "site_id" + queryParams["frame_type"] = "frame_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=backup_to_remote", + "", + "POST", + "/global-manager/api/v1/cluster", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterSummarizeinventorytoremoteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterSummarizeinventorytoremoteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterSummarizeinventorytoremoteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=summarize_inventory_to_remote", + "", + "POST", + "/global-manager/api/v1/cluster", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultBatchClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultBatchClient.go new file mode 100644 index 000000000..53e2b182a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultBatchClient.go @@ -0,0 +1,178 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Batch + * Functions that implement the generated BatchClient interface + */ + + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultBatchClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultBatchClient(connector client.Connector) *DefaultBatchClient { + interfaceName := "com.vmware.nsx_global_policy.batch" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + bIface := DefaultBatchClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + bIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + bIface.methodNameToDefMap["create"] = bIface.createMethodDefinition() + return &bIface +} + +func (bIface *DefaultBatchClient) Create(batchRequestParam model.BatchRequest, atomicParam *bool) (model.BatchResponse, error) { + typeConverter := bIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(bIface.interfaceIdentifier, "create") + sv := bindings.NewStructValueBuilder(batchCreateInputType(), typeConverter) + sv.AddStructField("BatchRequest", batchRequestParam) + sv.AddStructField("Atomic", atomicParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BatchResponse + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := batchCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := bIface.connector.NewExecutionContext() + methodResult := bIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.BatchResponse + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), batchCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BatchResponse), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (bIface *DefaultBatchClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := bIface.connector.GetApiProvider().Invoke(bIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (bIface *DefaultBatchClient) createMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(bIface.interfaceName) + typeConverter := bIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(batchCreateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(batchCreateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBatchClient.create method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBatchClient.create method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "create") + errorDefinitions := make([]data.ErrorDefinition, 0) + bIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBatchClient.create method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBatchClient.create method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBatchClient.create method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBatchClient.create method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBatchClient.create method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultClusterClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultClusterClient.go new file mode 100644 index 000000000..93e2872ea --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultClusterClient.go @@ -0,0 +1,261 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Cluster + * Functions that implement the generated ClusterClient interface + */ + + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultClusterClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultClusterClient(connector client.Connector) *DefaultClusterClient { + interfaceName := "com.vmware.nsx_global_policy.cluster" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "backuptoremote"), + core.NewMethodIdentifier(interfaceIdentifier, "summarizeinventorytoremote"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + cIface := DefaultClusterClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + cIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + cIface.methodNameToDefMap["backuptoremote"] = cIface.backuptoremoteMethodDefinition() + cIface.methodNameToDefMap["summarizeinventorytoremote"] = cIface.summarizeinventorytoremoteMethodDefinition() + return &cIface +} + +func (cIface *DefaultClusterClient) Backuptoremote(frameTypeParam *string, siteIdParam *string) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "backuptoremote") + sv := bindings.NewStructValueBuilder(clusterBackuptoremoteInputType(), typeConverter) + sv.AddStructField("FrameType", frameTypeParam) + sv.AddStructField("SiteId", siteIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterBackuptoremoteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultClusterClient) Summarizeinventorytoremote() error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "summarizeinventorytoremote") + sv := bindings.NewStructValueBuilder(clusterSummarizeinventorytoremoteInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterSummarizeinventorytoremoteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + + +func (cIface *DefaultClusterClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := cIface.connector.GetApiProvider().Invoke(cIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (cIface *DefaultClusterClient) backuptoremoteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(clusterBackuptoremoteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(clusterBackuptoremoteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.backuptoremote method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.backuptoremote method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "backuptoremote") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.backuptoremote method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.backuptoremote method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.backuptoremote method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.backuptoremote method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.backuptoremote method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultClusterClient) summarizeinventorytoremoteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(clusterSummarizeinventorytoremoteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(clusterSummarizeinventorytoremoteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.summarizeinventorytoremote method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.summarizeinventorytoremote method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "summarizeinventorytoremote") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.summarizeinventorytoremote method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.summarizeinventorytoremote method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.summarizeinventorytoremote method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.summarizeinventorytoremote method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultClusterClient.summarizeinventorytoremote method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultErrorResolverClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultErrorResolverClient.go new file mode 100644 index 000000000..5e2dc3df0 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultErrorResolverClient.go @@ -0,0 +1,364 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: ErrorResolver + * Functions that implement the generated ErrorResolverClient interface + */ + + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultErrorResolverClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultErrorResolverClient(connector client.Connector) *DefaultErrorResolverClient { + interfaceName := "com.vmware.nsx_global_policy.error_resolver" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "resolveerror"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + eIface := DefaultErrorResolverClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + eIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + eIface.methodNameToDefMap["get"] = eIface.getMethodDefinition() + eIface.methodNameToDefMap["list"] = eIface.listMethodDefinition() + eIface.methodNameToDefMap["resolveerror"] = eIface.resolveerrorMethodDefinition() + return &eIface +} + +func (eIface *DefaultErrorResolverClient) Get(errorIdParam string) (model.ErrorResolverInfo, error) { + typeConverter := eIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(eIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(errorResolverGetInputType(), typeConverter) + sv.AddStructField("ErrorId", errorIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ErrorResolverInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := errorResolverGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := eIface.connector.NewExecutionContext() + methodResult := eIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.ErrorResolverInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), errorResolverGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ErrorResolverInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *DefaultErrorResolverClient) List() (model.ErrorResolverInfoList, error) { + typeConverter := eIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(eIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(errorResolverListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ErrorResolverInfoList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := errorResolverListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := eIface.connector.NewExecutionContext() + methodResult := eIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.ErrorResolverInfoList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), errorResolverListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ErrorResolverInfoList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *DefaultErrorResolverClient) Resolveerror(errorResolverMetadataListParam model.ErrorResolverMetadataList) error { + typeConverter := eIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(eIface.interfaceIdentifier, "resolveerror") + sv := bindings.NewStructValueBuilder(errorResolverResolveerrorInputType(), typeConverter) + sv.AddStructField("ErrorResolverMetadataList", errorResolverMetadataListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := errorResolverResolveerrorRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := eIface.connector.NewExecutionContext() + methodResult := eIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + + +func (eIface *DefaultErrorResolverClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := eIface.connector.GetApiProvider().Invoke(eIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (eIface *DefaultErrorResolverClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(eIface.interfaceName) + typeConverter := eIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(errorResolverGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(errorResolverGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + eIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (eIface *DefaultErrorResolverClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(eIface.interfaceName) + typeConverter := eIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(errorResolverListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(errorResolverListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + eIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (eIface *DefaultErrorResolverClient) resolveerrorMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(eIface.interfaceName) + typeConverter := eIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(errorResolverResolveerrorInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(errorResolverResolveerrorOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.resolveerror method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.resolveerror method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "resolveerror") + errorDefinitions := make([]data.ErrorDefinition, 0) + eIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.resolveerror method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.resolveerror method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.resolveerror method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.resolveerror method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + eIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultErrorResolverClient.resolveerror method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultGlobalInfraClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultGlobalInfraClient.go new file mode 100644 index 000000000..0e04dc48c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultGlobalInfraClient.go @@ -0,0 +1,366 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GlobalInfra + * Functions that implement the generated GlobalInfraClient interface + */ + + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGlobalInfraClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGlobalInfraClient(connector client.Connector) *DefaultGlobalInfraClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGlobalInfraClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["get"] = gIface.getMethodDefinition() + gIface.methodNameToDefMap["patch"] = gIface.patchMethodDefinition() + gIface.methodNameToDefMap["update"] = gIface.updateMethodDefinition() + return &gIface +} + +func (gIface *DefaultGlobalInfraClient) Get(filterParam *string) (model.Infra, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(globalInfraGetInputType(), typeConverter) + sv.AddStructField("Filter", filterParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Infra + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalInfraGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Infra + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalInfraGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Infra), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGlobalInfraClient) Patch(infraParam model.Infra, enforceRevisionCheckParam *bool) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(globalInfraPatchInputType(), typeConverter) + sv.AddStructField("Infra", infraParam) + sv.AddStructField("EnforceRevisionCheck", enforceRevisionCheckParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalInfraPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGlobalInfraClient) Update(infraParam model.Infra) (model.Infra, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(globalInfraUpdateInputType(), typeConverter) + sv.AddStructField("Infra", infraParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Infra + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalInfraUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Infra + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalInfraUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Infra), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGlobalInfraClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGlobalInfraClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalInfraGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalInfraGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalInfraClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalInfraPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalInfraPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalInfraClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalInfraUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalInfraUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalInfraClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultUiViewsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultUiViewsClient.go new file mode 100644 index 000000000..b59035301 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/DefaultUiViewsClient.go @@ -0,0 +1,562 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: UiViews + * Functions that implement the generated UiViewsClient interface + */ + + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultUiViewsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultUiViewsClient(connector client.Connector) *DefaultUiViewsClient { + interfaceName := "com.vmware.nsx_global_policy.ui_views" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "create"), + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + uIface := DefaultUiViewsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + uIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + uIface.methodNameToDefMap["create"] = uIface.createMethodDefinition() + uIface.methodNameToDefMap["delete"] = uIface.deleteMethodDefinition() + uIface.methodNameToDefMap["get"] = uIface.getMethodDefinition() + uIface.methodNameToDefMap["get_0"] = uIface.get_0MethodDefinition() + uIface.methodNameToDefMap["update"] = uIface.updateMethodDefinition() + return &uIface +} + +func (uIface *DefaultUiViewsClient) Create(viewParam model.View) (model.View, error) { + typeConverter := uIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(uIface.interfaceIdentifier, "create") + sv := bindings.NewStructValueBuilder(uiViewsCreateInputType(), typeConverter) + sv.AddStructField("View", viewParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.View + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := uIface.connector.NewExecutionContext() + methodResult := uIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.View + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiViewsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.View), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *DefaultUiViewsClient) Delete(viewIdParam string) error { + typeConverter := uIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(uIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(uiViewsDeleteInputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := uIface.connector.NewExecutionContext() + methodResult := uIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *DefaultUiViewsClient) Get(tagParam *string, viewIdsParam *string, widgetIdParam *string) (model.ViewList, error) { + typeConverter := uIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(uIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(uiViewsGetInputType(), typeConverter) + sv.AddStructField("Tag", tagParam) + sv.AddStructField("ViewIds", viewIdsParam) + sv.AddStructField("WidgetId", widgetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ViewList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := uIface.connector.NewExecutionContext() + methodResult := uIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.ViewList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiViewsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ViewList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *DefaultUiViewsClient) Get0(viewIdParam string) (model.View, error) { + typeConverter := uIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(uIface.interfaceIdentifier, "get_0") + sv := bindings.NewStructValueBuilder(uiViewsGet0InputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.View + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := uIface.connector.NewExecutionContext() + methodResult := uIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.View + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiViewsGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.View), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *DefaultUiViewsClient) Update(viewIdParam string, viewParam model.View) (model.View, error) { + typeConverter := uIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(uIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(uiViewsUpdateInputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + sv.AddStructField("View", viewParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.View + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := uIface.connector.NewExecutionContext() + methodResult := uIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.View + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiViewsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.View), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (uIface *DefaultUiViewsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := uIface.connector.GetApiProvider().Invoke(uIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (uIface *DefaultUiViewsClient) createMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(uIface.interfaceName) + typeConverter := uIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(uiViewsCreateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(uiViewsCreateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.create method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.create method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "create") + errorDefinitions := make([]data.ErrorDefinition, 0) + uIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.create method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.create method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.create method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.create method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.create method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (uIface *DefaultUiViewsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(uIface.interfaceName) + typeConverter := uIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(uiViewsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(uiViewsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + uIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (uIface *DefaultUiViewsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(uIface.interfaceName) + typeConverter := uIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(uiViewsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(uiViewsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + uIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (uIface *DefaultUiViewsClient) get_0MethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(uIface.interfaceName) + typeConverter := uIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(uiViewsGet0InputType()) + output, outputError := typeConverter.ConvertToDataDefinition(uiViewsGet0OutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get_0 method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get_0 method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get_0") + errorDefinitions := make([]data.ErrorDefinition, 0) + uIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get_0 method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get_0 method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get_0 method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get_0 method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.get_0 method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (uIface *DefaultUiViewsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(uIface.interfaceName) + typeConverter := uIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(uiViewsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(uiViewsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + uIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUiViewsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ErrorResolverClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ErrorResolverClient.go new file mode 100644 index 000000000..d1515f491 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ErrorResolverClient.go @@ -0,0 +1,48 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: ErrorResolver + * Used by client-side stubs. + */ + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type ErrorResolverClient interface { + + // Returns some metadata about the given error_id. This includes information of whether there is a resolver present for the given error_id and its associated user input data + // + // @param errorIdParam (required) + // @return com.vmware.nsx_global_policy.model.ErrorResolverInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(errorIdParam string) (model.ErrorResolverInfo, error) + + // Returns a list of metadata for all the error resolvers registered. + // @return com.vmware.nsx_global_policy.model.ErrorResolverInfoList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.ErrorResolverInfoList, error) + + // Invokes the corresponding error resolver for the given error(s) present in the payload + // + // @param errorResolverMetadataListParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Resolveerror(errorResolverMetadataListParam model.ErrorResolverMetadataList) error +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ErrorResolverTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ErrorResolverTypes.go new file mode 100644 index 000000000..7c1478360 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/ErrorResolverTypes.go @@ -0,0 +1,168 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: ErrorResolver. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package nsx_global_policy + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func errorResolverGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_id"] = bindings.NewStringType() + fieldNameMap["error_id"] = "ErrorId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func errorResolverGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ErrorResolverInfoBindingType) +} + +func errorResolverGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["error_id"] = bindings.NewStringType() + fieldNameMap["error_id"] = "ErrorId" + paramsTypeMap["error_id"] = bindings.NewStringType() + paramsTypeMap["errorId"] = bindings.NewStringType() + pathParams["error_id"] = "errorId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/error-resolver/{errorId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func errorResolverListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func errorResolverListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ErrorResolverInfoListBindingType) +} + +func errorResolverListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/error-resolver", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func errorResolverResolveerrorInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_resolver_metadata_list"] = bindings.NewReferenceType(model.ErrorResolverMetadataListBindingType) + fieldNameMap["error_resolver_metadata_list"] = "ErrorResolverMetadataList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func errorResolverResolveerrorOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func errorResolverResolveerrorRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["error_resolver_metadata_list"] = bindings.NewReferenceType(model.ErrorResolverMetadataListBindingType) + fieldNameMap["error_resolver_metadata_list"] = "ErrorResolverMetadataList" + paramsTypeMap["error_resolver_metadata_list"] = bindings.NewReferenceType(model.ErrorResolverMetadataListBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=resolve_error", + "error_resolver_metadata_list", + "POST", + "/global-manager/api/v1/error-resolver", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/GlobalInfraClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/GlobalInfraClient.go new file mode 100644 index 000000000..211cc9d9f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/GlobalInfraClient.go @@ -0,0 +1,51 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GlobalInfra + * Used by client-side stubs. + */ + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GlobalInfraClient interface { + + // Read infra. Returns only the infra related properties. Inner object are not populated. + // + // @param filterParam Filter string as java regex (optional) + // @return com.vmware.nsx_global_policy.model.Infra + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(filterParam *string) (model.Infra, error) + + // Patch API at infra level can be used in two flavours 1. Like a regular API to update Infra object 2. Hierarchical API: To create/update/delete entire or part of intent hierarchy Hierarchical API: Provides users a way to create entire or part of intent in single API invocation. Input is expressed in a tree format. Each node in tree can have multiple children of different types. System will resolve the dependecies of nodes within the intent tree and will create the model. Children for any node can be specified using ChildResourceReference or ChildPolicyConfigResource. If a resource is specified using ChildResourceReference then it will not be updated only its children will be updated. If Object is specified using ChildPolicyConfigResource, object along with its children will be updated. Hierarchical API can also be used to delete any sub-branch of entire tree. + // + // @param infraParam (required) + // @param enforceRevisionCheckParam Force revision check (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(infraParam model.Infra, enforceRevisionCheckParam *bool) error + + // Update the infra including all the nested entities + // + // @param infraParam (required) + // @return com.vmware.nsx_global_policy.model.Infra + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(infraParam model.Infra) (model.Infra, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/GlobalInfraTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/GlobalInfraTypes.go new file mode 100644 index 000000000..c6bbaf173 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/GlobalInfraTypes.go @@ -0,0 +1,178 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GlobalInfra. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package nsx_global_policy + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func globalInfraGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalInfraGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InfraBindingType) +} + +func globalInfraGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + paramsTypeMap["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["filter"] = "filter" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalInfraPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra"] = bindings.NewReferenceType(model.InfraBindingType) + fields["enforce_revision_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["infra"] = "Infra" + fieldNameMap["enforce_revision_check"] = "EnforceRevisionCheck" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalInfraPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func globalInfraPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra"] = bindings.NewReferenceType(model.InfraBindingType) + fields["enforce_revision_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["infra"] = "Infra" + fieldNameMap["enforce_revision_check"] = "EnforceRevisionCheck" + paramsTypeMap["enforce_revision_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["infra"] = bindings.NewReferenceType(model.InfraBindingType) + queryParams["enforce_revision_check"] = "enforce_revision_check" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "infra", + "PATCH", + "/global-manager/api/v1/global-infra", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalInfraUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra"] = bindings.NewReferenceType(model.InfraBindingType) + fieldNameMap["infra"] = "Infra" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalInfraUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InfraBindingType) +} + +func globalInfraUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra"] = bindings.NewReferenceType(model.InfraBindingType) + fieldNameMap["infra"] = "Infra" + paramsTypeMap["infra"] = bindings.NewReferenceType(model.InfraBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "infra", + "PUT", + "/global-manager/api/v1/global-infra", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/NsxGlobalPolicyPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/NsxGlobalPolicyPackageTypes.go new file mode 100644 index 000000000..8490b3c95 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/NsxGlobalPolicyPackageTypes.go @@ -0,0 +1,19 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package nsx_global_policy + + + + + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/UiViewsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/UiViewsClient.go new file mode 100644 index 000000000..27e0af4f5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/UiViewsClient.go @@ -0,0 +1,75 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: UiViews + * Used by client-side stubs. + */ + +package nsx_global_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type UiViewsClient interface { + + // Creates a new View. + // + // @param viewParam (required) + // @return com.vmware.nsx_global_policy.model.View + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(viewParam model.View) (model.View, error) + + // Delete View + // + // @param viewIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(viewIdParam string) error + + // If no query params are specified then all the views entitled for the user are returned. The views to which a user is entitled to include the views created by the user and the shared views. + // + // @param tagParam The tag for which associated views to be queried. (optional) + // @param viewIdsParam Ids of the Views (optional) + // @param widgetIdParam Id of widget configuration (optional) + // @return com.vmware.nsx_global_policy.model.ViewList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tagParam *string, viewIdsParam *string, widgetIdParam *string) (model.ViewList, error) + + // Returns Information about a specific View. + // + // @param viewIdParam (required) + // @return com.vmware.nsx_global_policy.model.View + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(viewIdParam string) (model.View, error) + + // Update View + // + // @param viewIdParam (required) + // @param viewParam (required) + // @return com.vmware.nsx_global_policy.model.View + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(viewIdParam string, viewParam model.View) (model.View, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/UiViewsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/UiViewsTypes.go new file mode 100644 index 000000000..e1277d184 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/UiViewsTypes.go @@ -0,0 +1,291 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: UiViews. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package nsx_global_policy + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func uiViewsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view"] = bindings.NewReferenceType(model.ViewBindingType) + fieldNameMap["view"] = "View" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ViewBindingType) +} + +func uiViewsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view"] = bindings.NewReferenceType(model.ViewBindingType) + fieldNameMap["view"] = "View" + paramsTypeMap["view"] = bindings.NewReferenceType(model.ViewBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "view", + "POST", + "/global-manager/api/v1/ui-views", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiViewsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func uiViewsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["viewId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/ui-views/{viewId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiViewsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["view_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fieldNameMap["view_ids"] = "ViewIds" + fieldNameMap["widget_id"] = "WidgetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ViewListBindingType) +} + +func uiViewsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["view_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fieldNameMap["view_ids"] = "ViewIds" + fieldNameMap["widget_id"] = "WidgetId" + paramsTypeMap["widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["view_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["view_ids"] = "view_ids" + queryParams["widget_id"] = "widget_id" + queryParams["tag"] = "tag" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/ui-views", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiViewsGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ViewBindingType) +} + +func uiViewsGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["viewId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/ui-views/{viewId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiViewsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fields["view"] = bindings.NewReferenceType(model.ViewBindingType) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["view"] = "View" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ViewBindingType) +} + +func uiViewsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fields["view"] = bindings.NewReferenceType(model.ViewBindingType) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["view"] = "View" + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["view"] = bindings.NewReferenceType(model.ViewBindingType) + paramsTypeMap["viewId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "view", + "PUT", + "/global-manager/api/v1/ui-views/{viewId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/BfdProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/BfdProfilesClient.go new file mode 100644 index 000000000..587576340 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/BfdProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: BfdProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type BfdProfilesClient interface { + + // Delete BFD Config and all the entities contained by this BfdProfile. + // + // @param bfdProfileIdParam BfdProfile ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(bfdProfileIdParam string) error + + // Read a BfdProfile. + // + // @param bfdProfileIdParam BfdProfile ID (required) + // @return com.vmware.nsx_global_policy.model.BfdProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(bfdProfileIdParam string) (model.BfdProfile, error) + + // Paginated list of all BfdProfiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.BfdProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BfdProfileListResult, error) + + // If a BfdProfile with the bfd-profile-id is not already present, create a new BfdProfile. If it already exists, update the BfdProfile. This operation will fully replace the object. + // + // @param bfdProfileIdParam BfdProfile ID (required) + // @param bfdProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(bfdProfileIdParam string, bfdProfileParam model.BfdProfile) error + + // If a BfdProfile with the bfd-profile-id is not already present, create a new BfdProfile. If it already exists, update the BfdProfile. This operation will fully replace the object. + // + // @param bfdProfileIdParam BfdProfile ID (required) + // @param bfdProfileParam (required) + // @return com.vmware.nsx_global_policy.model.BfdProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(bfdProfileIdParam string, bfdProfileParam model.BfdProfile) (model.BfdProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/BfdProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/BfdProfilesTypes.go new file mode 100644 index 000000000..f20b23a3b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/BfdProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: BfdProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func bfdProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bfd_profile_id"] = bindings.NewStringType() + fieldNameMap["bfd_profile_id"] = "BfdProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func bfdProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bfd_profile_id"] = bindings.NewStringType() + fieldNameMap["bfd_profile_id"] = "BfdProfileId" + paramsTypeMap["bfd_profile_id"] = bindings.NewStringType() + paramsTypeMap["bfdProfileId"] = bindings.NewStringType() + pathParams["bfd_profile_id"] = "bfdProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/bfd-profiles/{bfdProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bfd_profile_id"] = bindings.NewStringType() + fieldNameMap["bfd_profile_id"] = "BfdProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BfdProfileBindingType) +} + +func bfdProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bfd_profile_id"] = bindings.NewStringType() + fieldNameMap["bfd_profile_id"] = "BfdProfileId" + paramsTypeMap["bfd_profile_id"] = bindings.NewStringType() + paramsTypeMap["bfdProfileId"] = bindings.NewStringType() + pathParams["bfd_profile_id"] = "bfdProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/bfd-profiles/{bfdProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BfdProfileListResultBindingType) +} + +func bfdProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/bfd-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bfd_profile_id"] = bindings.NewStringType() + fields["bfd_profile"] = bindings.NewReferenceType(model.BfdProfileBindingType) + fieldNameMap["bfd_profile_id"] = "BfdProfileId" + fieldNameMap["bfd_profile"] = "BfdProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func bfdProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bfd_profile_id"] = bindings.NewStringType() + fields["bfd_profile"] = bindings.NewReferenceType(model.BfdProfileBindingType) + fieldNameMap["bfd_profile_id"] = "BfdProfileId" + fieldNameMap["bfd_profile"] = "BfdProfile" + paramsTypeMap["bfd_profile_id"] = bindings.NewStringType() + paramsTypeMap["bfd_profile"] = bindings.NewReferenceType(model.BfdProfileBindingType) + paramsTypeMap["bfdProfileId"] = bindings.NewStringType() + pathParams["bfd_profile_id"] = "bfdProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bfd_profile", + "PATCH", + "/global-manager/api/v1/global-infra/bfd-profiles/{bfdProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bfd_profile_id"] = bindings.NewStringType() + fields["bfd_profile"] = bindings.NewReferenceType(model.BfdProfileBindingType) + fieldNameMap["bfd_profile_id"] = "BfdProfileId" + fieldNameMap["bfd_profile"] = "BfdProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BfdProfileBindingType) +} + +func bfdProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bfd_profile_id"] = bindings.NewStringType() + fields["bfd_profile"] = bindings.NewReferenceType(model.BfdProfileBindingType) + fieldNameMap["bfd_profile_id"] = "BfdProfileId" + fieldNameMap["bfd_profile"] = "BfdProfile" + paramsTypeMap["bfd_profile_id"] = bindings.NewStringType() + paramsTypeMap["bfd_profile"] = bindings.NewReferenceType(model.BfdProfileBindingType) + paramsTypeMap["bfdProfileId"] = bindings.NewStringType() + pathParams["bfd_profile_id"] = "bfdProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bfd_profile", + "PUT", + "/global-manager/api/v1/global-infra/bfd-profiles/{bfdProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CertificatesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CertificatesClient.go new file mode 100644 index 000000000..04496880c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CertificatesClient.go @@ -0,0 +1,80 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Certificates + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type CertificatesClient interface { + + // Removes the specified certificate. The private key associated with the certificate is also deleted. + // + // @param certificateIdParam ID of certificate to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(certificateIdParam string) error + + // Returns information for the specified certificate ID, including the certificate's id; resource_type (for example, certificate_self_signed, certificate_ca, or certificate_signed); pem_encoded data; and history of the certificate (who created or modified it and when). For additional information, include the ?details=true modifier at the end of the request URI. + // + // @param certificateIdParam ID of certificate to read (required) + // @param detailsParam whether to expand the pem data and show all its details (optional, default to false) + // @return com.vmware.nsx_global_policy.model.TlsCertificate + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(certificateIdParam string, detailsParam *bool) (model.TlsCertificate, error) + + // Returns all certificate information viewable by the user, including each certificate's id; resource_type (for example, certificate_self_signed, certificate_ca, or certificate_signed); pem_encoded data; and history of the certificate (who created or modified it and when). For additional information, include the ?details=true modifier at the end of the request URI. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param detailsParam whether to expand the pem data and show all its details (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Type of certificate to return (optional) + // @return com.vmware.nsx_global_policy.model.TlsCertificateList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, detailsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.TlsCertificateList, error) + + // Adds a new private-public certificate and, optionally, a private key that can be applied to one of the user-facing components (appliance management or edge). The certificate and the key should be stored in PEM format. If no private key is provided, the certificate is used as a client certificate in the trust store. A certificate chain will not be expanded into separate certificate instances for reference, but would be pushed to the enforcement point as a single certificate. This patch method does not modify an existing certificate. + // + // @param certificateIdParam (required) + // @param tlsTrustDataParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(certificateIdParam string, tlsTrustDataParam model.TlsTrustData) error + + // Adds a new private-public certificate and, optionally, a private key that can be applied to one of the user-facing components (appliance management or edge). The certificate and the key should be stored in PEM format. If no private key is provided, the certificate is used as a client certificate in the trust store. A certificate chain will not be expanded into separate certificate instances for reference, but would be pushed to the enforcement point as a single certificate. + // + // @param certificateIdParam (required) + // @param tlsTrustDataParam (required) + // @return com.vmware.nsx_global_policy.model.TlsCertificate + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(certificateIdParam string, tlsTrustDataParam model.TlsTrustData) (model.TlsCertificate, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CertificatesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CertificatesTypes.go new file mode 100644 index 000000000..311d55d88 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CertificatesTypes.go @@ -0,0 +1,330 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Certificates. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``type`` of method Certificates#list. +const Certificates_LIST_TYPE_CERTIFICATE = "cluster_api_certificate" + + + + +func certificatesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewStringType() + fieldNameMap["certificate_id"] = "CertificateId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func certificatesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["certificate_id"] = bindings.NewStringType() + fieldNameMap["certificate_id"] = "CertificateId" + paramsTypeMap["certificate_id"] = bindings.NewStringType() + paramsTypeMap["certificateId"] = bindings.NewStringType() + pathParams["certificate_id"] = "certificateId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/certificates/{certificateId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewStringType() + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["certificate_id"] = "CertificateId" + fieldNameMap["details"] = "Details" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TlsCertificateBindingType) +} + +func certificatesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["certificate_id"] = bindings.NewStringType() + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["certificate_id"] = "CertificateId" + fieldNameMap["details"] = "Details" + paramsTypeMap["certificate_id"] = bindings.NewStringType() + paramsTypeMap["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["certificateId"] = bindings.NewStringType() + pathParams["certificate_id"] = "certificateId" + queryParams["details"] = "details" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/certificates/{certificateId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["details"] = "Details" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TlsCertificateListBindingType) +} + +func certificatesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["details"] = "Details" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["details"] = "details" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/certificates", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewStringType() + fields["tls_trust_data"] = bindings.NewReferenceType(model.TlsTrustDataBindingType) + fieldNameMap["certificate_id"] = "CertificateId" + fieldNameMap["tls_trust_data"] = "TlsTrustData" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func certificatesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["certificate_id"] = bindings.NewStringType() + fields["tls_trust_data"] = bindings.NewReferenceType(model.TlsTrustDataBindingType) + fieldNameMap["certificate_id"] = "CertificateId" + fieldNameMap["tls_trust_data"] = "TlsTrustData" + paramsTypeMap["certificate_id"] = bindings.NewStringType() + paramsTypeMap["tls_trust_data"] = bindings.NewReferenceType(model.TlsTrustDataBindingType) + paramsTypeMap["certificateId"] = bindings.NewStringType() + pathParams["certificate_id"] = "certificateId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tls_trust_data", + "PATCH", + "/global-manager/api/v1/global-infra/certificates/{certificateId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewStringType() + fields["tls_trust_data"] = bindings.NewReferenceType(model.TlsTrustDataBindingType) + fieldNameMap["certificate_id"] = "CertificateId" + fieldNameMap["tls_trust_data"] = "TlsTrustData" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TlsCertificateBindingType) +} + +func certificatesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["certificate_id"] = bindings.NewStringType() + fields["tls_trust_data"] = bindings.NewReferenceType(model.TlsTrustDataBindingType) + fieldNameMap["certificate_id"] = "CertificateId" + fieldNameMap["tls_trust_data"] = "TlsTrustData" + paramsTypeMap["certificate_id"] = bindings.NewStringType() + paramsTypeMap["tls_trust_data"] = bindings.NewReferenceType(model.TlsTrustDataBindingType) + paramsTypeMap["certificateId"] = bindings.NewStringType() + pathParams["certificate_id"] = "certificateId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tls_trust_data", + "PUT", + "/global-manager/api/v1/global-infra/certificates/{certificateId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ConstraintsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ConstraintsClient.go new file mode 100644 index 000000000..c3ca16bf5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ConstraintsClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Constraints + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type ConstraintsClient interface { + + // Delete tenant constraint. + // + // @param constraintIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(constraintIdParam string) error + + // Read tenant constraint. + // + // @param constraintIdParam (required) + // @return com.vmware.nsx_global_policy.model.Constraint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(constraintIdParam string) (model.Constraint, error) + + // List tenant constraints. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.ConstraintListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ConstraintListResult, error) + + // Create tenant constraint if not exists, otherwise update the existing constraint. + // + // @param constraintIdParam (required) + // @param constraintParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(constraintIdParam string, constraintParam model.Constraint) error + + // Create tenant constraint if it does not exist, otherwise replace the existing constraint. + // + // @param constraintIdParam (required) + // @param constraintParam (required) + // @return com.vmware.nsx_global_policy.model.Constraint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(constraintIdParam string, constraintParam model.Constraint) (model.Constraint, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ConstraintsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ConstraintsTypes.go new file mode 100644 index 000000000..7bfd0daa0 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ConstraintsTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Constraints. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func constraintsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["constraint_id"] = bindings.NewStringType() + fieldNameMap["constraint_id"] = "ConstraintId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func constraintsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func constraintsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["constraint_id"] = bindings.NewStringType() + fieldNameMap["constraint_id"] = "ConstraintId" + paramsTypeMap["constraint_id"] = bindings.NewStringType() + paramsTypeMap["constraintId"] = bindings.NewStringType() + pathParams["constraint_id"] = "constraintId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/constraints/{constraintId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func constraintsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["constraint_id"] = bindings.NewStringType() + fieldNameMap["constraint_id"] = "ConstraintId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func constraintsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConstraintBindingType) +} + +func constraintsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["constraint_id"] = bindings.NewStringType() + fieldNameMap["constraint_id"] = "ConstraintId" + paramsTypeMap["constraint_id"] = bindings.NewStringType() + paramsTypeMap["constraintId"] = bindings.NewStringType() + pathParams["constraint_id"] = "constraintId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/constraints/{constraintId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func constraintsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func constraintsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConstraintListResultBindingType) +} + +func constraintsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/constraints", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func constraintsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["constraint_id"] = bindings.NewStringType() + fields["constraint"] = bindings.NewReferenceType(model.ConstraintBindingType) + fieldNameMap["constraint_id"] = "ConstraintId" + fieldNameMap["constraint"] = "Constraint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func constraintsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func constraintsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["constraint_id"] = bindings.NewStringType() + fields["constraint"] = bindings.NewReferenceType(model.ConstraintBindingType) + fieldNameMap["constraint_id"] = "ConstraintId" + fieldNameMap["constraint"] = "Constraint" + paramsTypeMap["constraint"] = bindings.NewReferenceType(model.ConstraintBindingType) + paramsTypeMap["constraint_id"] = bindings.NewStringType() + paramsTypeMap["constraintId"] = bindings.NewStringType() + pathParams["constraint_id"] = "constraintId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "constraint", + "PATCH", + "/global-manager/api/v1/global-infra/constraints/{constraintId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func constraintsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["constraint_id"] = bindings.NewStringType() + fields["constraint"] = bindings.NewReferenceType(model.ConstraintBindingType) + fieldNameMap["constraint_id"] = "ConstraintId" + fieldNameMap["constraint"] = "Constraint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func constraintsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConstraintBindingType) +} + +func constraintsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["constraint_id"] = bindings.NewStringType() + fields["constraint"] = bindings.NewReferenceType(model.ConstraintBindingType) + fieldNameMap["constraint_id"] = "ConstraintId" + fieldNameMap["constraint"] = "Constraint" + paramsTypeMap["constraint"] = bindings.NewReferenceType(model.ConstraintBindingType) + paramsTypeMap["constraint_id"] = bindings.NewStringType() + paramsTypeMap["constraintId"] = bindings.NewStringType() + pathParams["constraint_id"] = "constraintId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "constraint", + "PUT", + "/global-manager/api/v1/global-infra/constraints/{constraintId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ContextProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ContextProfilesClient.go new file mode 100644 index 000000000..362f23651 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ContextProfilesClient.go @@ -0,0 +1,79 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: ContextProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type ContextProfilesClient interface { + + // Deletes the specified Policy Context Profile. If the Policy Context Profile is consumed in a firewall rule, it won't get deleted. + // + // @param contextProfileIdParam Policy Context Profile Id (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(contextProfileIdParam string, forceParam *bool) error + + // Get a single PolicyContextProfile by id + // + // @param contextProfileIdParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyContextProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(contextProfileIdParam string) (model.PolicyContextProfile, error) + + // Get all PolicyContextProfiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyContextProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyContextProfileListResult, error) + + // Creates/Updates a PolicyContextProfile, which encapsulates attribute and sub-attributes of network services. Rules for using attributes and sub-attributes in single PolicyContextProfile 1. One type of attribute can't have multiple occurrences. ( Eg. - Attribute type APP_ID can be used only once per PolicyContextProfile.) 2. For specifying multiple values for an attribute, provide them in an array. 3. If sub-attribtes are mentioned for an attribute, then only single value is allowed for that attribute. 4. To get a list of supported attributes and sub-attributes fire the following REST API GET https:///policy/api/v1/infra/context-profiles/attributes + // + // @param contextProfileIdParam (required) + // @param policyContextProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(contextProfileIdParam string, policyContextProfileParam model.PolicyContextProfile) error + + // Creates/Updates a PolicyContextProfile, which encapsulates attribute and sub-attributes of network services. Rules for using attributes and sub-attributes in single PolicyContextProfile 1. One type of attribute can't have multiple occurrences. ( Eg. - Attribute type APP_ID can be used only once per PolicyContextProfile.) 2. For specifying multiple values for an attribute, provide them in an array. 3. If sub-attribtes are mentioned for an attribute, then only single value is allowed for that attribute. 4. To get a list of supported attributes and sub-attributes fire the following REST API GET https:///policy/api/v1/infra/context-profiles/attributes + // + // @param contextProfileIdParam (required) + // @param policyContextProfileParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyContextProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(contextProfileIdParam string, policyContextProfileParam model.PolicyContextProfile) (model.PolicyContextProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ContextProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ContextProfilesTypes.go new file mode 100644 index 000000000..66b6bcd8c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ContextProfilesTypes.go @@ -0,0 +1,322 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: ContextProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func contextProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["context_profile_id"] = "ContextProfileId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func contextProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func contextProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["context_profile_id"] = "ContextProfileId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["context_profile_id"] = bindings.NewStringType() + paramsTypeMap["contextProfileId"] = bindings.NewStringType() + pathParams["context_profile_id"] = "contextProfileId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/context-profiles/{contextProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func contextProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_profile_id"] = bindings.NewStringType() + fieldNameMap["context_profile_id"] = "ContextProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func contextProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyContextProfileBindingType) +} + +func contextProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_profile_id"] = bindings.NewStringType() + fieldNameMap["context_profile_id"] = "ContextProfileId" + paramsTypeMap["context_profile_id"] = bindings.NewStringType() + paramsTypeMap["contextProfileId"] = bindings.NewStringType() + pathParams["context_profile_id"] = "contextProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/context-profiles/{contextProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func contextProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func contextProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyContextProfileListResultBindingType) +} + +func contextProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/context-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func contextProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_profile_id"] = bindings.NewStringType() + fields["policy_context_profile"] = bindings.NewReferenceType(model.PolicyContextProfileBindingType) + fieldNameMap["context_profile_id"] = "ContextProfileId" + fieldNameMap["policy_context_profile"] = "PolicyContextProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func contextProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func contextProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_profile_id"] = bindings.NewStringType() + fields["policy_context_profile"] = bindings.NewReferenceType(model.PolicyContextProfileBindingType) + fieldNameMap["context_profile_id"] = "ContextProfileId" + fieldNameMap["policy_context_profile"] = "PolicyContextProfile" + paramsTypeMap["context_profile_id"] = bindings.NewStringType() + paramsTypeMap["policy_context_profile"] = bindings.NewReferenceType(model.PolicyContextProfileBindingType) + paramsTypeMap["contextProfileId"] = bindings.NewStringType() + pathParams["context_profile_id"] = "contextProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_context_profile", + "PATCH", + "/global-manager/api/v1/global-infra/context-profiles/{contextProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func contextProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_profile_id"] = bindings.NewStringType() + fields["policy_context_profile"] = bindings.NewReferenceType(model.PolicyContextProfileBindingType) + fieldNameMap["context_profile_id"] = "ContextProfileId" + fieldNameMap["policy_context_profile"] = "PolicyContextProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func contextProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyContextProfileBindingType) +} + +func contextProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_profile_id"] = bindings.NewStringType() + fields["policy_context_profile"] = bindings.NewReferenceType(model.PolicyContextProfileBindingType) + fieldNameMap["context_profile_id"] = "ContextProfileId" + fieldNameMap["policy_context_profile"] = "PolicyContextProfile" + paramsTypeMap["context_profile_id"] = bindings.NewStringType() + paramsTypeMap["policy_context_profile"] = bindings.NewReferenceType(model.PolicyContextProfileBindingType) + paramsTypeMap["contextProfileId"] = bindings.NewStringType() + pathParams["context_profile_id"] = "contextProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_context_profile", + "PUT", + "/global-manager/api/v1/global-infra/context-profiles/{contextProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CrlsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CrlsClient.go new file mode 100644 index 000000000..9e87c9fb8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CrlsClient.go @@ -0,0 +1,92 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Crls + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type CrlsClient interface { + + // Deletes an existing CRL. + // + // @param crlIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(crlIdParam string) error + + // Returns information about the specified CRL. For additional information, include the ?details=true modifier at the end of the request URI. + // + // @param crlIdParam (required) + // @param detailsParam whether to expand the pem data and show all its details (optional, default to false) + // @return com.vmware.nsx_global_policy.model.TlsCrl + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(crlIdParam string, detailsParam *bool) (model.TlsCrl, error) + + // Adds a new certificate revocation list (CRLs). The CRL is used to verify the client certificate status against the revocation lists published by the CA. For this reason, the administrator needs to add the CRL in certificate repository as well. The CRL can contain a single CRL or multiple CRLs depending on the PEM data. - Single CRL: a single CRL is created with the given id. - Composite CRL: multiple CRLs are generated. Each of the CRL is created with an id generated based on the given id. First CRL is created with crl-id, second with crl-id-1, third with crl-id-2, etc. + // + // @param crlIdParam (required) + // @param tlsCrlParam (required) + // @return com.vmware.nsx_global_policy.model.TlsCrlListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Importcrl(crlIdParam string, tlsCrlParam model.TlsCrl) (model.TlsCrlListResult, error) + + // Returns information about all CRLs. For additional information, include the ?details=true modifier at the end of the request URI. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param detailsParam whether to expand the pem data and show all its details (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Type of certificate to return (optional) + // @return com.vmware.nsx_global_policy.model.TlsCrlListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, detailsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.TlsCrlListResult, error) + + // Create or patch a Certificate Revocation List for the given id. The CRL is used to verify the client certificate status against the revocation lists published by the CA. For this reason, the administrator needs to add the CRL in certificate repository as well. The CRL must contain PEM data for a single CRL. + // + // @param crlIdParam (required) + // @param tlsCrlParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(crlIdParam string, tlsCrlParam model.TlsCrl) error + + // Create or replace a Certificate Revocation List for the given id. The CRL is used to verify the client certificate status against the revocation lists published by the CA. For this reason, the administrator needs to add the CRL in certificate repository as well. The CRL must contain PEM data for a single CRL. Revision is required. + // + // @param crlIdParam (required) + // @param tlsCrlParam (required) + // @return com.vmware.nsx_global_policy.model.TlsCrl + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(crlIdParam string, tlsCrlParam model.TlsCrl) (model.TlsCrl, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CrlsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CrlsTypes.go new file mode 100644 index 000000000..28d752f3e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/CrlsTypes.go @@ -0,0 +1,385 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Crls. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``type`` of method Crls#list. +const Crls_LIST_TYPE_CERTIFICATE = "cluster_api_certificate" + + + + +func crlsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_id"] = bindings.NewStringType() + fieldNameMap["crl_id"] = "CrlId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func crlsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_id"] = bindings.NewStringType() + fieldNameMap["crl_id"] = "CrlId" + paramsTypeMap["crl_id"] = bindings.NewStringType() + paramsTypeMap["crlId"] = bindings.NewStringType() + pathParams["crl_id"] = "crlId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/crls/{crlId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_id"] = bindings.NewStringType() + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["details"] = "Details" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TlsCrlBindingType) +} + +func crlsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_id"] = bindings.NewStringType() + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["details"] = "Details" + paramsTypeMap["crl_id"] = bindings.NewStringType() + paramsTypeMap["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["crlId"] = bindings.NewStringType() + pathParams["crl_id"] = "crlId" + queryParams["details"] = "details" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/crls/{crlId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsImportcrlInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_id"] = bindings.NewStringType() + fields["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["tls_crl"] = "TlsCrl" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsImportcrlOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TlsCrlListResultBindingType) +} + +func crlsImportcrlRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_id"] = bindings.NewStringType() + fields["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["tls_crl"] = "TlsCrl" + paramsTypeMap["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + paramsTypeMap["crl_id"] = bindings.NewStringType() + paramsTypeMap["crlId"] = bindings.NewStringType() + pathParams["crl_id"] = "crlId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=import", + "tls_crl", + "POST", + "/global-manager/api/v1/global-infra/crls/{crlId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["details"] = "Details" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TlsCrlListResultBindingType) +} + +func crlsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["details"] = "Details" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["details"] = "details" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/crls", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_id"] = bindings.NewStringType() + fields["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["tls_crl"] = "TlsCrl" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func crlsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_id"] = bindings.NewStringType() + fields["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["tls_crl"] = "TlsCrl" + paramsTypeMap["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + paramsTypeMap["crl_id"] = bindings.NewStringType() + paramsTypeMap["crlId"] = bindings.NewStringType() + pathParams["crl_id"] = "crlId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tls_crl", + "PATCH", + "/global-manager/api/v1/global-infra/crls/{crlId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_id"] = bindings.NewStringType() + fields["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["tls_crl"] = "TlsCrl" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TlsCrlBindingType) +} + +func crlsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_id"] = bindings.NewStringType() + fields["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["tls_crl"] = "TlsCrl" + paramsTypeMap["tls_crl"] = bindings.NewReferenceType(model.TlsCrlBindingType) + paramsTypeMap["crl_id"] = bindings.NewStringType() + paramsTypeMap["crlId"] = bindings.NewStringType() + pathParams["crl_id"] = "crlId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tls_crl", + "PUT", + "/global-manager/api/v1/global-infra/crls/{crlId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultBfdProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultBfdProfilesClient.go new file mode 100644 index 000000000..3c6c92db8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultBfdProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: BfdProfiles + * Functions that implement the generated BfdProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultBfdProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultBfdProfilesClient(connector client.Connector) *DefaultBfdProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.bfd_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + bIface := DefaultBfdProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + bIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + bIface.methodNameToDefMap["delete"] = bIface.deleteMethodDefinition() + bIface.methodNameToDefMap["get"] = bIface.getMethodDefinition() + bIface.methodNameToDefMap["list"] = bIface.listMethodDefinition() + bIface.methodNameToDefMap["patch"] = bIface.patchMethodDefinition() + bIface.methodNameToDefMap["update"] = bIface.updateMethodDefinition() + return &bIface +} + +func (bIface *DefaultBfdProfilesClient) Delete(bfdProfileIdParam string) error { + typeConverter := bIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(bIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(bfdProfilesDeleteInputType(), typeConverter) + sv.AddStructField("BfdProfileId", bfdProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := bIface.connector.NewExecutionContext() + methodResult := bIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (bIface *DefaultBfdProfilesClient) Get(bfdProfileIdParam string) (model.BfdProfile, error) { + typeConverter := bIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(bIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(bfdProfilesGetInputType(), typeConverter) + sv.AddStructField("BfdProfileId", bfdProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BfdProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := bIface.connector.NewExecutionContext() + methodResult := bIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.BfdProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BfdProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *DefaultBfdProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BfdProfileListResult, error) { + typeConverter := bIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(bIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(bfdProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BfdProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := bIface.connector.NewExecutionContext() + methodResult := bIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.BfdProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BfdProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *DefaultBfdProfilesClient) Patch(bfdProfileIdParam string, bfdProfileParam model.BfdProfile) error { + typeConverter := bIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(bIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(bfdProfilesPatchInputType(), typeConverter) + sv.AddStructField("BfdProfileId", bfdProfileIdParam) + sv.AddStructField("BfdProfile", bfdProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := bIface.connector.NewExecutionContext() + methodResult := bIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (bIface *DefaultBfdProfilesClient) Update(bfdProfileIdParam string, bfdProfileParam model.BfdProfile) (model.BfdProfile, error) { + typeConverter := bIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(bIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(bfdProfilesUpdateInputType(), typeConverter) + sv.AddStructField("BfdProfileId", bfdProfileIdParam) + sv.AddStructField("BfdProfile", bfdProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BfdProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := bIface.connector.NewExecutionContext() + methodResult := bIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.BfdProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BfdProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (bIface *DefaultBfdProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := bIface.connector.GetApiProvider().Invoke(bIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (bIface *DefaultBfdProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(bIface.interfaceName) + typeConverter := bIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(bfdProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(bfdProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + bIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (bIface *DefaultBfdProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(bIface.interfaceName) + typeConverter := bIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(bfdProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(bfdProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + bIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (bIface *DefaultBfdProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(bIface.interfaceName) + typeConverter := bIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(bfdProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(bfdProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + bIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (bIface *DefaultBfdProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(bIface.interfaceName) + typeConverter := bIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(bfdProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(bfdProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + bIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (bIface *DefaultBfdProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(bIface.interfaceName) + typeConverter := bIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(bfdProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(bfdProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + bIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + bIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultBfdProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultCertificatesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultCertificatesClient.go new file mode 100644 index 000000000..c01e19466 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultCertificatesClient.go @@ -0,0 +1,562 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Certificates + * Functions that implement the generated CertificatesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultCertificatesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultCertificatesClient(connector client.Connector) *DefaultCertificatesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.certificates" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + cIface := DefaultCertificatesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + cIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + cIface.methodNameToDefMap["delete"] = cIface.deleteMethodDefinition() + cIface.methodNameToDefMap["get"] = cIface.getMethodDefinition() + cIface.methodNameToDefMap["list"] = cIface.listMethodDefinition() + cIface.methodNameToDefMap["patch"] = cIface.patchMethodDefinition() + cIface.methodNameToDefMap["update"] = cIface.updateMethodDefinition() + return &cIface +} + +func (cIface *DefaultCertificatesClient) Delete(certificateIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(certificatesDeleteInputType(), typeConverter) + sv.AddStructField("CertificateId", certificateIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultCertificatesClient) Get(certificateIdParam string, detailsParam *bool) (model.TlsCertificate, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(certificatesGetInputType(), typeConverter) + sv.AddStructField("CertificateId", certificateIdParam) + sv.AddStructField("Details", detailsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TlsCertificate + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.TlsCertificate + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificatesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TlsCertificate), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultCertificatesClient) List(cursorParam *string, detailsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.TlsCertificateList, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(certificatesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Details", detailsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TlsCertificateList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.TlsCertificateList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificatesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TlsCertificateList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultCertificatesClient) Patch(certificateIdParam string, tlsTrustDataParam model.TlsTrustData) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(certificatesPatchInputType(), typeConverter) + sv.AddStructField("CertificateId", certificateIdParam) + sv.AddStructField("TlsTrustData", tlsTrustDataParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultCertificatesClient) Update(certificateIdParam string, tlsTrustDataParam model.TlsTrustData) (model.TlsCertificate, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(certificatesUpdateInputType(), typeConverter) + sv.AddStructField("CertificateId", certificateIdParam) + sv.AddStructField("TlsTrustData", tlsTrustDataParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TlsCertificate + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.TlsCertificate + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificatesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TlsCertificate), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (cIface *DefaultCertificatesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := cIface.connector.GetApiProvider().Invoke(cIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (cIface *DefaultCertificatesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(certificatesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(certificatesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCertificatesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(certificatesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(certificatesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCertificatesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(certificatesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(certificatesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCertificatesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(certificatesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(certificatesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCertificatesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(certificatesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(certificatesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCertificatesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultConstraintsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultConstraintsClient.go new file mode 100644 index 000000000..cfff20098 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultConstraintsClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Constraints + * Functions that implement the generated ConstraintsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultConstraintsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultConstraintsClient(connector client.Connector) *DefaultConstraintsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.constraints" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + cIface := DefaultConstraintsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + cIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + cIface.methodNameToDefMap["delete"] = cIface.deleteMethodDefinition() + cIface.methodNameToDefMap["get"] = cIface.getMethodDefinition() + cIface.methodNameToDefMap["list"] = cIface.listMethodDefinition() + cIface.methodNameToDefMap["patch"] = cIface.patchMethodDefinition() + cIface.methodNameToDefMap["update"] = cIface.updateMethodDefinition() + return &cIface +} + +func (cIface *DefaultConstraintsClient) Delete(constraintIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(constraintsDeleteInputType(), typeConverter) + sv.AddStructField("ConstraintId", constraintIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := constraintsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultConstraintsClient) Get(constraintIdParam string) (model.Constraint, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(constraintsGetInputType(), typeConverter) + sv.AddStructField("ConstraintId", constraintIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Constraint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := constraintsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Constraint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), constraintsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Constraint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultConstraintsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ConstraintListResult, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(constraintsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConstraintListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := constraintsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.ConstraintListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), constraintsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConstraintListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultConstraintsClient) Patch(constraintIdParam string, constraintParam model.Constraint) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(constraintsPatchInputType(), typeConverter) + sv.AddStructField("ConstraintId", constraintIdParam) + sv.AddStructField("Constraint", constraintParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := constraintsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultConstraintsClient) Update(constraintIdParam string, constraintParam model.Constraint) (model.Constraint, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(constraintsUpdateInputType(), typeConverter) + sv.AddStructField("ConstraintId", constraintIdParam) + sv.AddStructField("Constraint", constraintParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Constraint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := constraintsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Constraint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), constraintsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Constraint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (cIface *DefaultConstraintsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := cIface.connector.GetApiProvider().Invoke(cIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (cIface *DefaultConstraintsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(constraintsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(constraintsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultConstraintsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(constraintsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(constraintsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultConstraintsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(constraintsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(constraintsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultConstraintsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(constraintsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(constraintsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultConstraintsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(constraintsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(constraintsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultConstraintsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultContextProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultContextProfilesClient.go new file mode 100644 index 000000000..791e25110 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultContextProfilesClient.go @@ -0,0 +1,561 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: ContextProfiles + * Functions that implement the generated ContextProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultContextProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultContextProfilesClient(connector client.Connector) *DefaultContextProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.context_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + cIface := DefaultContextProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + cIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + cIface.methodNameToDefMap["delete"] = cIface.deleteMethodDefinition() + cIface.methodNameToDefMap["get"] = cIface.getMethodDefinition() + cIface.methodNameToDefMap["list"] = cIface.listMethodDefinition() + cIface.methodNameToDefMap["patch"] = cIface.patchMethodDefinition() + cIface.methodNameToDefMap["update"] = cIface.updateMethodDefinition() + return &cIface +} + +func (cIface *DefaultContextProfilesClient) Delete(contextProfileIdParam string, forceParam *bool) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(contextProfilesDeleteInputType(), typeConverter) + sv.AddStructField("ContextProfileId", contextProfileIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := contextProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultContextProfilesClient) Get(contextProfileIdParam string) (model.PolicyContextProfile, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(contextProfilesGetInputType(), typeConverter) + sv.AddStructField("ContextProfileId", contextProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyContextProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := contextProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyContextProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), contextProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyContextProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultContextProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyContextProfileListResult, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(contextProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyContextProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := contextProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyContextProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), contextProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyContextProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultContextProfilesClient) Patch(contextProfileIdParam string, policyContextProfileParam model.PolicyContextProfile) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(contextProfilesPatchInputType(), typeConverter) + sv.AddStructField("ContextProfileId", contextProfileIdParam) + sv.AddStructField("PolicyContextProfile", policyContextProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := contextProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultContextProfilesClient) Update(contextProfileIdParam string, policyContextProfileParam model.PolicyContextProfile) (model.PolicyContextProfile, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(contextProfilesUpdateInputType(), typeConverter) + sv.AddStructField("ContextProfileId", contextProfileIdParam) + sv.AddStructField("PolicyContextProfile", policyContextProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyContextProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := contextProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyContextProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), contextProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyContextProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (cIface *DefaultContextProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := cIface.connector.GetApiProvider().Invoke(cIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (cIface *DefaultContextProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(contextProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(contextProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultContextProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(contextProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(contextProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultContextProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(contextProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(contextProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultContextProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(contextProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(contextProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultContextProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(contextProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(contextProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultContextProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultCrlsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultCrlsClient.go new file mode 100644 index 000000000..8ff380ea9 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultCrlsClient.go @@ -0,0 +1,660 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Crls + * Functions that implement the generated CrlsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultCrlsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultCrlsClient(connector client.Connector) *DefaultCrlsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.crls" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "importcrl"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + cIface := DefaultCrlsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + cIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + cIface.methodNameToDefMap["delete"] = cIface.deleteMethodDefinition() + cIface.methodNameToDefMap["get"] = cIface.getMethodDefinition() + cIface.methodNameToDefMap["importcrl"] = cIface.importcrlMethodDefinition() + cIface.methodNameToDefMap["list"] = cIface.listMethodDefinition() + cIface.methodNameToDefMap["patch"] = cIface.patchMethodDefinition() + cIface.methodNameToDefMap["update"] = cIface.updateMethodDefinition() + return &cIface +} + +func (cIface *DefaultCrlsClient) Delete(crlIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(crlsDeleteInputType(), typeConverter) + sv.AddStructField("CrlId", crlIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultCrlsClient) Get(crlIdParam string, detailsParam *bool) (model.TlsCrl, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(crlsGetInputType(), typeConverter) + sv.AddStructField("CrlId", crlIdParam) + sv.AddStructField("Details", detailsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TlsCrl + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.TlsCrl + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TlsCrl), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultCrlsClient) Importcrl(crlIdParam string, tlsCrlParam model.TlsCrl) (model.TlsCrlListResult, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "importcrl") + sv := bindings.NewStructValueBuilder(crlsImportcrlInputType(), typeConverter) + sv.AddStructField("CrlId", crlIdParam) + sv.AddStructField("TlsCrl", tlsCrlParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TlsCrlListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsImportcrlRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.TlsCrlListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlsImportcrlOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TlsCrlListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultCrlsClient) List(cursorParam *string, detailsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.TlsCrlListResult, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(crlsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Details", detailsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TlsCrlListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.TlsCrlListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TlsCrlListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultCrlsClient) Patch(crlIdParam string, tlsCrlParam model.TlsCrl) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(crlsPatchInputType(), typeConverter) + sv.AddStructField("CrlId", crlIdParam) + sv.AddStructField("TlsCrl", tlsCrlParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultCrlsClient) Update(crlIdParam string, tlsCrlParam model.TlsCrl) (model.TlsCrl, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(crlsUpdateInputType(), typeConverter) + sv.AddStructField("CrlId", crlIdParam) + sv.AddStructField("TlsCrl", tlsCrlParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TlsCrl + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.TlsCrl + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TlsCrl), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (cIface *DefaultCrlsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := cIface.connector.GetApiProvider().Invoke(cIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (cIface *DefaultCrlsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(crlsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(crlsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCrlsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(crlsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(crlsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCrlsClient) importcrlMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(crlsImportcrlInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(crlsImportcrlOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.importcrl method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.importcrl method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "importcrl") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.importcrl method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.importcrl method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.importcrl method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.importcrl method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.importcrl method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCrlsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(crlsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(crlsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCrlsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(crlsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(crlsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCrlsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(crlsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(crlsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCrlsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDhcpRelayConfigsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDhcpRelayConfigsClient.go new file mode 100644 index 000000000..84107fd13 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDhcpRelayConfigsClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: DhcpRelayConfigs + * Functions that implement the generated DhcpRelayConfigsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDhcpRelayConfigsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDhcpRelayConfigsClient(connector client.Connector) *DefaultDhcpRelayConfigsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.dhcp_relay_configs" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDhcpRelayConfigsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDhcpRelayConfigsClient) Delete(dhcpRelayConfigIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(dhcpRelayConfigsDeleteInputType(), typeConverter) + sv.AddStructField("DhcpRelayConfigId", dhcpRelayConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpRelayConfigsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDhcpRelayConfigsClient) Get(dhcpRelayConfigIdParam string) (model.DhcpRelayConfig, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(dhcpRelayConfigsGetInputType(), typeConverter) + sv.AddStructField("DhcpRelayConfigId", dhcpRelayConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpRelayConfigsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DhcpRelayConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpRelayConfigsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDhcpRelayConfigsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpRelayConfigListResult, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(dhcpRelayConfigsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpRelayConfigsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DhcpRelayConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpRelayConfigsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDhcpRelayConfigsClient) Patch(dhcpRelayConfigIdParam string, dhcpRelayConfigParam model.DhcpRelayConfig) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(dhcpRelayConfigsPatchInputType(), typeConverter) + sv.AddStructField("DhcpRelayConfigId", dhcpRelayConfigIdParam) + sv.AddStructField("DhcpRelayConfig", dhcpRelayConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpRelayConfigsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDhcpRelayConfigsClient) Update(dhcpRelayConfigIdParam string, dhcpRelayConfigParam model.DhcpRelayConfig) (model.DhcpRelayConfig, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(dhcpRelayConfigsUpdateInputType(), typeConverter) + sv.AddStructField("DhcpRelayConfigId", dhcpRelayConfigIdParam) + sv.AddStructField("DhcpRelayConfig", dhcpRelayConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpRelayConfigsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DhcpRelayConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpRelayConfigsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDhcpRelayConfigsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDhcpRelayConfigsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpRelayConfigsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpRelayConfigsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpRelayConfigsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpRelayConfigsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpRelayConfigsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpRelayConfigsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDhcpServerConfigsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDhcpServerConfigsClient.go new file mode 100644 index 000000000..e5f39734c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDhcpServerConfigsClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: DhcpServerConfigs + * Functions that implement the generated DhcpServerConfigsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDhcpServerConfigsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDhcpServerConfigsClient(connector client.Connector) *DefaultDhcpServerConfigsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.dhcp_server_configs" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDhcpServerConfigsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDhcpServerConfigsClient) Delete(dhcpServerConfigIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(dhcpServerConfigsDeleteInputType(), typeConverter) + sv.AddStructField("DhcpServerConfigId", dhcpServerConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpServerConfigsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDhcpServerConfigsClient) Get(dhcpServerConfigIdParam string) (model.DhcpServerConfig, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(dhcpServerConfigsGetInputType(), typeConverter) + sv.AddStructField("DhcpServerConfigId", dhcpServerConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpServerConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpServerConfigsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DhcpServerConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpServerConfigsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpServerConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDhcpServerConfigsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpServerConfigListResult, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(dhcpServerConfigsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpServerConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpServerConfigsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DhcpServerConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpServerConfigsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpServerConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDhcpServerConfigsClient) Patch(dhcpServerConfigIdParam string, dhcpServerConfigParam model.DhcpServerConfig) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(dhcpServerConfigsPatchInputType(), typeConverter) + sv.AddStructField("DhcpServerConfigId", dhcpServerConfigIdParam) + sv.AddStructField("DhcpServerConfig", dhcpServerConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpServerConfigsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDhcpServerConfigsClient) Update(dhcpServerConfigIdParam string, dhcpServerConfigParam model.DhcpServerConfig) (model.DhcpServerConfig, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(dhcpServerConfigsUpdateInputType(), typeConverter) + sv.AddStructField("DhcpServerConfigId", dhcpServerConfigIdParam) + sv.AddStructField("DhcpServerConfig", dhcpServerConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpServerConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpServerConfigsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DhcpServerConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpServerConfigsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpServerConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDhcpServerConfigsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDhcpServerConfigsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpServerConfigsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpServerConfigsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpServerConfigsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpServerConfigsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpServerConfigsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpServerConfigsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDnsForwarderZonesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDnsForwarderZonesClient.go new file mode 100644 index 000000000..3292d9d6a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDnsForwarderZonesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: DnsForwarderZones + * Functions that implement the generated DnsForwarderZonesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDnsForwarderZonesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDnsForwarderZonesClient(connector client.Connector) *DefaultDnsForwarderZonesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.dns_forwarder_zones" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDnsForwarderZonesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDnsForwarderZonesClient) Delete(dnsForwarderZoneIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(dnsForwarderZonesDeleteInputType(), typeConverter) + sv.AddStructField("DnsForwarderZoneId", dnsForwarderZoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderZonesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderZonesClient) Get(dnsForwarderZoneIdParam string) (model.PolicyDnsForwarderZone, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(dnsForwarderZonesGetInputType(), typeConverter) + sv.AddStructField("DnsForwarderZoneId", dnsForwarderZoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDnsForwarderZone + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderZonesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDnsForwarderZone + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsForwarderZonesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDnsForwarderZone), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderZonesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyDnsForwarderZoneListResult, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(dnsForwarderZonesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDnsForwarderZoneListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderZonesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDnsForwarderZoneListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsForwarderZonesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDnsForwarderZoneListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderZonesClient) Patch(dnsForwarderZoneIdParam string, policyDnsForwarderZoneParam model.PolicyDnsForwarderZone) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(dnsForwarderZonesPatchInputType(), typeConverter) + sv.AddStructField("DnsForwarderZoneId", dnsForwarderZoneIdParam) + sv.AddStructField("PolicyDnsForwarderZone", policyDnsForwarderZoneParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderZonesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderZonesClient) Update(dnsForwarderZoneIdParam string, policyDnsForwarderZoneParam model.PolicyDnsForwarderZone) (model.PolicyDnsForwarderZone, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(dnsForwarderZonesUpdateInputType(), typeConverter) + sv.AddStructField("DnsForwarderZoneId", dnsForwarderZoneIdParam) + sv.AddStructField("PolicyDnsForwarderZone", policyDnsForwarderZoneParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDnsForwarderZone + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderZonesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDnsForwarderZone + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsForwarderZonesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDnsForwarderZone), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDnsForwarderZonesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDnsForwarderZonesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderZonesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderZonesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderZonesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderZonesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderZonesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderZonesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDnsSecurityProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDnsSecurityProfilesClient.go new file mode 100644 index 000000000..231e7716a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDnsSecurityProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: DnsSecurityProfiles + * Functions that implement the generated DnsSecurityProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDnsSecurityProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDnsSecurityProfilesClient(connector client.Connector) *DefaultDnsSecurityProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.dns_security_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDnsSecurityProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDnsSecurityProfilesClient) Delete(profileIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(dnsSecurityProfilesDeleteInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsSecurityProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsSecurityProfilesClient) Get(profileIdParam string) (model.DnsSecurityProfile, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(dnsSecurityProfilesGetInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsSecurityProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsSecurityProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DnsSecurityProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsSecurityProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsSecurityProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDnsSecurityProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DnsSecurityProfileListResult, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(dnsSecurityProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsSecurityProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsSecurityProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DnsSecurityProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsSecurityProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsSecurityProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDnsSecurityProfilesClient) Patch(profileIdParam string, dnsSecurityProfileParam model.DnsSecurityProfile) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(dnsSecurityProfilesPatchInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + sv.AddStructField("DnsSecurityProfile", dnsSecurityProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsSecurityProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsSecurityProfilesClient) Update(profileIdParam string, dnsSecurityProfileParam model.DnsSecurityProfile) (model.DnsSecurityProfile, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(dnsSecurityProfilesUpdateInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + sv.AddStructField("DnsSecurityProfile", dnsSecurityProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsSecurityProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsSecurityProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DnsSecurityProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsSecurityProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsSecurityProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDnsSecurityProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDnsSecurityProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsSecurityProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsSecurityProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsSecurityProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsSecurityProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsSecurityProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsSecurityProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDomainsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDomainsClient.go new file mode 100644 index 000000000..f92ef7507 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDomainsClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Domains + * Functions that implement the generated DomainsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDomainsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDomainsClient(connector client.Connector) *DefaultDomainsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.domains" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDomainsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDomainsClient) Delete(domainIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(domainsDeleteInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDomainsClient) Get(domainIdParam string) (model.Domain, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(domainsGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Domain + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Domain + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Domain), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDomainsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DomainListResult, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(domainsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DomainListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DomainListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DomainListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDomainsClient) Patch(domainIdParam string, domainParam model.Domain) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(domainsPatchInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Domain", domainParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDomainsClient) Update(domainIdParam string, domainParam model.Domain) (model.Domain, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(domainsUpdateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Domain", domainParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Domain + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Domain + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Domain), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDomainsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDomainsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDomainsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDomainsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDomainsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDomainsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDraftsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDraftsClient.go new file mode 100644 index 000000000..ff63defe4 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultDraftsClient.go @@ -0,0 +1,653 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Drafts + * Functions that implement the generated DraftsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDraftsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDraftsClient(connector client.Connector) *DefaultDraftsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.drafts" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "publish"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDraftsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["publish"] = dIface.publishMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDraftsClient) Delete(draftIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(draftsDeleteInputType(), typeConverter) + sv.AddStructField("DraftId", draftIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := draftsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDraftsClient) Get(draftIdParam string) (model.PolicyDraft, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(draftsGetInputType(), typeConverter) + sv.AddStructField("DraftId", draftIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDraft + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := draftsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDraft + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), draftsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDraft), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDraftsClient) List(autoDraftsParam *bool, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyDraftListResult, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(draftsListInputType(), typeConverter) + sv.AddStructField("AutoDrafts", autoDraftsParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDraftListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := draftsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDraftListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), draftsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDraftListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDraftsClient) Patch(draftIdParam string, policyDraftParam model.PolicyDraft) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(draftsPatchInputType(), typeConverter) + sv.AddStructField("DraftId", draftIdParam) + sv.AddStructField("PolicyDraft", policyDraftParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := draftsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDraftsClient) Publish(draftIdParam string, infraParam model.Infra) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "publish") + sv := bindings.NewStructValueBuilder(draftsPublishInputType(), typeConverter) + sv.AddStructField("DraftId", draftIdParam) + sv.AddStructField("Infra", infraParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := draftsPublishRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDraftsClient) Update(draftIdParam string, policyDraftParam model.PolicyDraft) (model.PolicyDraft, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(draftsUpdateInputType(), typeConverter) + sv.AddStructField("DraftId", draftIdParam) + sv.AddStructField("PolicyDraft", policyDraftParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDraft + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := draftsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDraft + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), draftsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDraft), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDraftsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDraftsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(draftsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(draftsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDraftsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(draftsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(draftsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDraftsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(draftsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(draftsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDraftsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(draftsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(draftsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDraftsClient) publishMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(draftsPublishInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(draftsPublishOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.publish method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.publish method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "publish") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.publish method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.publish method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.publish method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.publish method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.publish method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDraftsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(draftsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(draftsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDraftsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFederationConfigClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFederationConfigClient.go new file mode 100644 index 000000000..05e1a5ed3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFederationConfigClient.go @@ -0,0 +1,176 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FederationConfig + * Functions that implement the generated FederationConfigClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFederationConfigClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFederationConfigClient(connector client.Connector) *DefaultFederationConfigClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.federation_config" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFederationConfigClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["get"] = fIface.getMethodDefinition() + return &fIface +} + +func (fIface *DefaultFederationConfigClient) Get() (model.FederationConfig, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(federationConfigGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FederationConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := federationConfigGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FederationConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), federationConfigGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FederationConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFederationConfigClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFederationConfigClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(federationConfigGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(federationConfigGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFederationConfigClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFederationConfigClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFederationConfigClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFederationConfigClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFederationConfigClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFederationConfigClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFederationConfigClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFirewallSchedulersClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFirewallSchedulersClient.go new file mode 100644 index 000000000..10d86f5ae --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFirewallSchedulersClient.go @@ -0,0 +1,561 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FirewallSchedulers + * Functions that implement the generated FirewallSchedulersClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFirewallSchedulersClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFirewallSchedulersClient(connector client.Connector) *DefaultFirewallSchedulersClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.firewall_schedulers" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFirewallSchedulersClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["delete"] = fIface.deleteMethodDefinition() + fIface.methodNameToDefMap["get"] = fIface.getMethodDefinition() + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + fIface.methodNameToDefMap["patch"] = fIface.patchMethodDefinition() + fIface.methodNameToDefMap["update"] = fIface.updateMethodDefinition() + return &fIface +} + +func (fIface *DefaultFirewallSchedulersClient) Delete(firewallSchedulerIdParam string, forceParam *bool) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(firewallSchedulersDeleteInputType(), typeConverter) + sv.AddStructField("FirewallSchedulerId", firewallSchedulerIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSchedulersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFirewallSchedulersClient) Get(firewallSchedulerIdParam string) (model.PolicyFirewallScheduler, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(firewallSchedulersGetInputType(), typeConverter) + sv.AddStructField("FirewallSchedulerId", firewallSchedulerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyFirewallScheduler + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSchedulersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyFirewallScheduler + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), firewallSchedulersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyFirewallScheduler), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFirewallSchedulersClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyFirewallSchedulerListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(firewallSchedulersListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyFirewallSchedulerListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSchedulersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyFirewallSchedulerListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), firewallSchedulersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyFirewallSchedulerListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFirewallSchedulersClient) Patch(firewallSchedulerIdParam string, policyFirewallSchedulerParam model.PolicyFirewallScheduler) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(firewallSchedulersPatchInputType(), typeConverter) + sv.AddStructField("FirewallSchedulerId", firewallSchedulerIdParam) + sv.AddStructField("PolicyFirewallScheduler", policyFirewallSchedulerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSchedulersPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFirewallSchedulersClient) Update(firewallSchedulerIdParam string, policyFirewallSchedulerParam model.PolicyFirewallScheduler) (model.PolicyFirewallScheduler, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(firewallSchedulersUpdateInputType(), typeConverter) + sv.AddStructField("FirewallSchedulerId", firewallSchedulerIdParam) + sv.AddStructField("PolicyFirewallScheduler", policyFirewallSchedulerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyFirewallScheduler + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSchedulersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyFirewallScheduler + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), firewallSchedulersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyFirewallScheduler), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFirewallSchedulersClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFirewallSchedulersClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSchedulersDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSchedulersDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFirewallSchedulersClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSchedulersGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSchedulersGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFirewallSchedulersClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSchedulersListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSchedulersListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFirewallSchedulersClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSchedulersPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSchedulersPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFirewallSchedulersClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSchedulersUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSchedulersUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSchedulersClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFirewallSessionTimerProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFirewallSessionTimerProfilesClient.go new file mode 100644 index 000000000..b0a58e7c6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFirewallSessionTimerProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FirewallSessionTimerProfiles + * Functions that implement the generated FirewallSessionTimerProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFirewallSessionTimerProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFirewallSessionTimerProfilesClient(connector client.Connector) *DefaultFirewallSessionTimerProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.firewall_session_timer_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFirewallSessionTimerProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["delete"] = fIface.deleteMethodDefinition() + fIface.methodNameToDefMap["get"] = fIface.getMethodDefinition() + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + fIface.methodNameToDefMap["patch"] = fIface.patchMethodDefinition() + fIface.methodNameToDefMap["update"] = fIface.updateMethodDefinition() + return &fIface +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) Delete(firewallSessionTimerProfileIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(firewallSessionTimerProfilesDeleteInputType(), typeConverter) + sv.AddStructField("FirewallSessionTimerProfileId", firewallSessionTimerProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSessionTimerProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) Get(firewallSessionTimerProfileIdParam string) (model.PolicyFirewallSessionTimerProfile, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(firewallSessionTimerProfilesGetInputType(), typeConverter) + sv.AddStructField("FirewallSessionTimerProfileId", firewallSessionTimerProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyFirewallSessionTimerProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSessionTimerProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyFirewallSessionTimerProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), firewallSessionTimerProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyFirewallSessionTimerProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyFirewallSessionTimerProfileListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(firewallSessionTimerProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyFirewallSessionTimerProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSessionTimerProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyFirewallSessionTimerProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), firewallSessionTimerProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyFirewallSessionTimerProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) Patch(firewallSessionTimerProfileIdParam string, policyFirewallSessionTimerProfileParam model.PolicyFirewallSessionTimerProfile) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(firewallSessionTimerProfilesPatchInputType(), typeConverter) + sv.AddStructField("FirewallSessionTimerProfileId", firewallSessionTimerProfileIdParam) + sv.AddStructField("PolicyFirewallSessionTimerProfile", policyFirewallSessionTimerProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSessionTimerProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) Update(firewallSessionTimerProfileIdParam string, policyFirewallSessionTimerProfileParam model.PolicyFirewallSessionTimerProfile) (model.PolicyFirewallSessionTimerProfile, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(firewallSessionTimerProfilesUpdateInputType(), typeConverter) + sv.AddStructField("FirewallSessionTimerProfileId", firewallSessionTimerProfileIdParam) + sv.AddStructField("PolicyFirewallSessionTimerProfile", policyFirewallSessionTimerProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyFirewallSessionTimerProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSessionTimerProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyFirewallSessionTimerProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), firewallSessionTimerProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyFirewallSessionTimerProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFirewallSessionTimerProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFirewallSessionTimerProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFirewallSessionTimerProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFloodProtectionProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFloodProtectionProfilesClient.go new file mode 100644 index 000000000..ea3422d3c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFloodProtectionProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FloodProtectionProfiles + * Functions that implement the generated FloodProtectionProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFloodProtectionProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFloodProtectionProfilesClient(connector client.Connector) *DefaultFloodProtectionProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.flood_protection_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFloodProtectionProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["delete"] = fIface.deleteMethodDefinition() + fIface.methodNameToDefMap["get"] = fIface.getMethodDefinition() + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + fIface.methodNameToDefMap["patch"] = fIface.patchMethodDefinition() + fIface.methodNameToDefMap["update"] = fIface.updateMethodDefinition() + return &fIface +} + +func (fIface *DefaultFloodProtectionProfilesClient) Delete(floodProtectionProfileIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(floodProtectionProfilesDeleteInputType(), typeConverter) + sv.AddStructField("FloodProtectionProfileId", floodProtectionProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfilesClient) Get(floodProtectionProfileIdParam string) (*data.StructValue, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(floodProtectionProfilesGetInputType(), typeConverter) + sv.AddStructField("FloodProtectionProfileId", floodProtectionProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), floodProtectionProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.FloodProtectionProfileListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(floodProtectionProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FloodProtectionProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FloodProtectionProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), floodProtectionProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FloodProtectionProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfilesClient) Patch(floodProtectionProfileIdParam string, floodProtectionProfileParam *data.StructValue) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(floodProtectionProfilesPatchInputType(), typeConverter) + sv.AddStructField("FloodProtectionProfileId", floodProtectionProfileIdParam) + sv.AddStructField("FloodProtectionProfile", floodProtectionProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfilesClient) Update(floodProtectionProfileIdParam string, floodProtectionProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(floodProtectionProfilesUpdateInputType(), typeConverter) + sv.AddStructField("FloodProtectionProfileId", floodProtectionProfileIdParam) + sv.AddStructField("FloodProtectionProfile", floodProtectionProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), floodProtectionProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFloodProtectionProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFloodProtectionProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFullSyncStatesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFullSyncStatesClient.go new file mode 100644 index 000000000..72ffda62d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultFullSyncStatesClient.go @@ -0,0 +1,279 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FullSyncStates + * Functions that implement the generated FullSyncStatesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFullSyncStatesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFullSyncStatesClient(connector client.Connector) *DefaultFullSyncStatesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.full_sync_states" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFullSyncStatesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["get"] = fIface.getMethodDefinition() + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + return &fIface +} + +func (fIface *DefaultFullSyncStatesClient) Get(fullSyncIdParam string) (model.FullSyncState, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(fullSyncStatesGetInputType(), typeConverter) + sv.AddStructField("FullSyncId", fullSyncIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FullSyncState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := fullSyncStatesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FullSyncState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), fullSyncStatesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FullSyncState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFullSyncStatesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.FullSyncStateListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(fullSyncStatesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FullSyncStateListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := fullSyncStatesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FullSyncStateListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), fullSyncStatesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FullSyncStateListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFullSyncStatesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFullSyncStatesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(fullSyncStatesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(fullSyncStatesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFullSyncStatesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(fullSyncStatesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(fullSyncStatesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFullSyncStatesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGatewayQosProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGatewayQosProfilesClient.go new file mode 100644 index 000000000..99d19909b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGatewayQosProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GatewayQosProfiles + * Functions that implement the generated GatewayQosProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGatewayQosProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGatewayQosProfilesClient(connector client.Connector) *DefaultGatewayQosProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.gateway_qos_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGatewayQosProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["delete"] = gIface.deleteMethodDefinition() + gIface.methodNameToDefMap["get"] = gIface.getMethodDefinition() + gIface.methodNameToDefMap["list"] = gIface.listMethodDefinition() + gIface.methodNameToDefMap["patch"] = gIface.patchMethodDefinition() + gIface.methodNameToDefMap["update"] = gIface.updateMethodDefinition() + return &gIface +} + +func (gIface *DefaultGatewayQosProfilesClient) Delete(qosProfileIdParam string) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(gatewayQosProfilesDeleteInputType(), typeConverter) + sv.AddStructField("QosProfileId", qosProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayQosProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGatewayQosProfilesClient) Get(qosProfileIdParam string) (model.GatewayQosProfile, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(gatewayQosProfilesGetInputType(), typeConverter) + sv.AddStructField("QosProfileId", qosProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayQosProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayQosProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayQosProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayQosProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayQosProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGatewayQosProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.GatewayQosProfileListResult, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(gatewayQosProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayQosProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayQosProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayQosProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayQosProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayQosProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGatewayQosProfilesClient) Patch(qosProfileIdParam string, gatewayQosProfileParam model.GatewayQosProfile) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(gatewayQosProfilesPatchInputType(), typeConverter) + sv.AddStructField("QosProfileId", qosProfileIdParam) + sv.AddStructField("GatewayQosProfile", gatewayQosProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayQosProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGatewayQosProfilesClient) Update(qosProfileIdParam string, gatewayQosProfileParam model.GatewayQosProfile) (model.GatewayQosProfile, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(gatewayQosProfilesUpdateInputType(), typeConverter) + sv.AddStructField("QosProfileId", qosProfileIdParam) + sv.AddStructField("GatewayQosProfile", gatewayQosProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayQosProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayQosProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayQosProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayQosProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayQosProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGatewayQosProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGatewayQosProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayQosProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayQosProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayQosProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayQosProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayQosProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayQosProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGlobalManagerConfigClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGlobalManagerConfigClient.go new file mode 100644 index 000000000..c0895031a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGlobalManagerConfigClient.go @@ -0,0 +1,364 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GlobalManagerConfig + * Functions that implement the generated GlobalManagerConfigClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGlobalManagerConfigClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGlobalManagerConfigClient(connector client.Connector) *DefaultGlobalManagerConfigClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.global_manager_config" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "showsensitivedata"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGlobalManagerConfigClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["patch"] = gIface.patchMethodDefinition() + gIface.methodNameToDefMap["showsensitivedata"] = gIface.showsensitivedataMethodDefinition() + gIface.methodNameToDefMap["update"] = gIface.updateMethodDefinition() + return &gIface +} + +func (gIface *DefaultGlobalManagerConfigClient) Patch(globalManagerConfigParam model.GlobalManagerConfig) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(globalManagerConfigPatchInputType(), typeConverter) + sv.AddStructField("GlobalManagerConfig", globalManagerConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagerConfigPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGlobalManagerConfigClient) Showsensitivedata() (model.GlobalManagerConfig, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "showsensitivedata") + sv := bindings.NewStructValueBuilder(globalManagerConfigShowsensitivedataInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GlobalManagerConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagerConfigShowsensitivedataRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GlobalManagerConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalManagerConfigShowsensitivedataOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GlobalManagerConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGlobalManagerConfigClient) Update(globalManagerConfigParam model.GlobalManagerConfig) (model.GlobalManagerConfig, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(globalManagerConfigUpdateInputType(), typeConverter) + sv.AddStructField("GlobalManagerConfig", globalManagerConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GlobalManagerConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagerConfigUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GlobalManagerConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalManagerConfigUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GlobalManagerConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGlobalManagerConfigClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGlobalManagerConfigClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagerConfigPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagerConfigPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalManagerConfigClient) showsensitivedataMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagerConfigShowsensitivedataInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagerConfigShowsensitivedataOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.showsensitivedata method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.showsensitivedata method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "showsensitivedata") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.showsensitivedata method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.showsensitivedata method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.showsensitivedata method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.showsensitivedata method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.showsensitivedata method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalManagerConfigClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagerConfigUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagerConfigUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagerConfigClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGlobalManagersClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGlobalManagersClient.go new file mode 100644 index 000000000..9037afddc --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGlobalManagersClient.go @@ -0,0 +1,657 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GlobalManagers + * Functions that implement the generated GlobalManagersClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGlobalManagersClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGlobalManagersClient(connector client.Connector) *DefaultGlobalManagersClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.global_managers" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "create"), + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGlobalManagersClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["create"] = gIface.createMethodDefinition() + gIface.methodNameToDefMap["delete"] = gIface.deleteMethodDefinition() + gIface.methodNameToDefMap["get"] = gIface.getMethodDefinition() + gIface.methodNameToDefMap["list"] = gIface.listMethodDefinition() + gIface.methodNameToDefMap["patch"] = gIface.patchMethodDefinition() + gIface.methodNameToDefMap["update"] = gIface.updateMethodDefinition() + return &gIface +} + +func (gIface *DefaultGlobalManagersClient) Create(actionParam string) (model.GlobalManager, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "create") + sv := bindings.NewStructValueBuilder(globalManagersCreateInputType(), typeConverter) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GlobalManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GlobalManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalManagersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GlobalManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGlobalManagersClient) Delete(globalManagerIdParam string) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(globalManagersDeleteInputType(), typeConverter) + sv.AddStructField("GlobalManagerId", globalManagerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGlobalManagersClient) Get(globalManagerIdParam string) (model.GlobalManager, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(globalManagersGetInputType(), typeConverter) + sv.AddStructField("GlobalManagerId", globalManagerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GlobalManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GlobalManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalManagersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GlobalManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGlobalManagersClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.GlobalManagerListResult, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(globalManagersListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GlobalManagerListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GlobalManagerListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalManagersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GlobalManagerListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGlobalManagersClient) Patch(globalManagerIdParam string, globalManagerParam model.GlobalManager) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(globalManagersPatchInputType(), typeConverter) + sv.AddStructField("GlobalManagerId", globalManagerIdParam) + sv.AddStructField("GlobalManager", globalManagerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagersPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGlobalManagersClient) Update(globalManagerIdParam string, globalManagerParam model.GlobalManager) (model.GlobalManager, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(globalManagersUpdateInputType(), typeConverter) + sv.AddStructField("GlobalManagerId", globalManagerIdParam) + sv.AddStructField("GlobalManager", globalManagerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GlobalManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalManagersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GlobalManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalManagersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GlobalManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGlobalManagersClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGlobalManagersClient) createMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagersCreateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagersCreateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.create method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.create method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "create") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.create method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.create method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.create method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.create method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.create method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalManagersClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagersDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagersDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalManagersClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagersGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagersGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalManagersClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagersListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagersListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalManagersClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagersPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagersPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGlobalManagersClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(globalManagersUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(globalManagersUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGlobalManagersClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGroupAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGroupAssociationsClient.go new file mode 100644 index 000000000..2b7021571 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGroupAssociationsClient.go @@ -0,0 +1,184 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GroupAssociations + * Functions that implement the generated GroupAssociationsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGroupAssociationsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGroupAssociationsClient(connector client.Connector) *DefaultGroupAssociationsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.group_associations" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGroupAssociationsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["list"] = gIface.listMethodDefinition() + return &gIface +} + +func (gIface *DefaultGroupAssociationsClient) List(intentPathParam string, cursorParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceForEPListResult, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(groupAssociationsListInputType(), typeConverter) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyResourceReferenceForEPListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupAssociationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyResourceReferenceForEPListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupAssociationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyResourceReferenceForEPListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGroupAssociationsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGroupAssociationsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(groupAssociationsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(groupAssociationsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupAssociationsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupAssociationsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupAssociationsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupAssociationsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupAssociationsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupAssociationsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupAssociationsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGroupServiceAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGroupServiceAssociationsClient.go new file mode 100644 index 000000000..5c25b3e42 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultGroupServiceAssociationsClient.go @@ -0,0 +1,183 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GroupServiceAssociations + * Functions that implement the generated GroupServiceAssociationsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGroupServiceAssociationsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGroupServiceAssociationsClient(connector client.Connector) *DefaultGroupServiceAssociationsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.group_service_associations" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGroupServiceAssociationsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["list"] = gIface.listMethodDefinition() + return &gIface +} + +func (gIface *DefaultGroupServiceAssociationsClient) List(intentPathParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceListResult, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(groupServiceAssociationsListInputType(), typeConverter) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyResourceReferenceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupServiceAssociationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyResourceReferenceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupServiceAssociationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyResourceReferenceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGroupServiceAssociationsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGroupServiceAssociationsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(groupServiceAssociationsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(groupServiceAssociationsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupServiceAssociationsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupServiceAssociationsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupServiceAssociationsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupServiceAssociationsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupServiceAssociationsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupServiceAssociationsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupServiceAssociationsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpAddressGroupAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpAddressGroupAssociationsClient.go new file mode 100644 index 000000000..be760b3fc --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpAddressGroupAssociationsClient.go @@ -0,0 +1,184 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: IpAddressGroupAssociations + * Functions that implement the generated IpAddressGroupAssociationsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultIpAddressGroupAssociationsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultIpAddressGroupAssociationsClient(connector client.Connector) *DefaultIpAddressGroupAssociationsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.ip_address_group_associations" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + iIface := DefaultIpAddressGroupAssociationsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + iIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + iIface.methodNameToDefMap["list"] = iIface.listMethodDefinition() + return &iIface +} + +func (iIface *DefaultIpAddressGroupAssociationsClient) List(ipAddressParam string, cursorParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceForEPListResult, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(ipAddressGroupAssociationsListInputType(), typeConverter) + sv.AddStructField("IpAddress", ipAddressParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyResourceReferenceForEPListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipAddressGroupAssociationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyResourceReferenceForEPListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipAddressGroupAssociationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyResourceReferenceForEPListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (iIface *DefaultIpAddressGroupAssociationsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := iIface.connector.GetApiProvider().Invoke(iIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (iIface *DefaultIpAddressGroupAssociationsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipAddressGroupAssociationsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipAddressGroupAssociationsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpAddressGroupAssociationsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpAddressGroupAssociationsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpAddressGroupAssociationsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpAddressGroupAssociationsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpAddressGroupAssociationsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpAddressGroupAssociationsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpAddressGroupAssociationsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpDiscoveryProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpDiscoveryProfilesClient.go new file mode 100644 index 000000000..dcfd16ce4 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpDiscoveryProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: IpDiscoveryProfiles + * Functions that implement the generated IpDiscoveryProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultIpDiscoveryProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultIpDiscoveryProfilesClient(connector client.Connector) *DefaultIpDiscoveryProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.ip_discovery_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + iIface := DefaultIpDiscoveryProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + iIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + iIface.methodNameToDefMap["delete"] = iIface.deleteMethodDefinition() + iIface.methodNameToDefMap["get"] = iIface.getMethodDefinition() + iIface.methodNameToDefMap["list"] = iIface.listMethodDefinition() + iIface.methodNameToDefMap["patch"] = iIface.patchMethodDefinition() + iIface.methodNameToDefMap["update"] = iIface.updateMethodDefinition() + return &iIface +} + +func (iIface *DefaultIpDiscoveryProfilesClient) Delete(ipDiscoveryProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(ipDiscoveryProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpDiscoveryProfileId", ipDiscoveryProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipDiscoveryProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpDiscoveryProfilesClient) Get(ipDiscoveryProfileIdParam string) (model.IPDiscoveryProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(ipDiscoveryProfilesGetInputType(), typeConverter) + sv.AddStructField("IpDiscoveryProfileId", ipDiscoveryProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPDiscoveryProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipDiscoveryProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPDiscoveryProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipDiscoveryProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPDiscoveryProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpDiscoveryProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPDiscoveryProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(ipDiscoveryProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPDiscoveryProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipDiscoveryProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPDiscoveryProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipDiscoveryProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPDiscoveryProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpDiscoveryProfilesClient) Patch(ipDiscoveryProfileIdParam string, ipDiscoveryProfileParam model.IPDiscoveryProfile) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(ipDiscoveryProfilesPatchInputType(), typeConverter) + sv.AddStructField("IpDiscoveryProfileId", ipDiscoveryProfileIdParam) + sv.AddStructField("IpDiscoveryProfile", ipDiscoveryProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipDiscoveryProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpDiscoveryProfilesClient) Update(ipDiscoveryProfileIdParam string, ipDiscoveryProfileParam model.IPDiscoveryProfile) (model.IPDiscoveryProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(ipDiscoveryProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpDiscoveryProfileId", ipDiscoveryProfileIdParam) + sv.AddStructField("IpDiscoveryProfile", ipDiscoveryProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPDiscoveryProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipDiscoveryProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPDiscoveryProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipDiscoveryProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPDiscoveryProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (iIface *DefaultIpDiscoveryProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := iIface.connector.GetApiProvider().Invoke(iIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (iIface *DefaultIpDiscoveryProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpDiscoveryProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpDiscoveryProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpDiscoveryProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpDiscoveryProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipDiscoveryProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpDiscoveryProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixDfwCollectorProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixDfwCollectorProfilesClient.go new file mode 100644 index 000000000..494c9107a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixDfwCollectorProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: IpfixDfwCollectorProfiles + * Functions that implement the generated IpfixDfwCollectorProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultIpfixDfwCollectorProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultIpfixDfwCollectorProfilesClient(connector client.Connector) *DefaultIpfixDfwCollectorProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.ipfix_dfw_collector_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + iIface := DefaultIpfixDfwCollectorProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + iIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + iIface.methodNameToDefMap["delete"] = iIface.deleteMethodDefinition() + iIface.methodNameToDefMap["get"] = iIface.getMethodDefinition() + iIface.methodNameToDefMap["list"] = iIface.listMethodDefinition() + iIface.methodNameToDefMap["patch"] = iIface.patchMethodDefinition() + iIface.methodNameToDefMap["update"] = iIface.updateMethodDefinition() + return &iIface +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) Delete(ipfixDfwCollectorProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(ipfixDfwCollectorProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpfixDfwCollectorProfileId", ipfixDfwCollectorProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwCollectorProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) Get(ipfixDfwCollectorProfileIdParam string) (model.IPFIXDFWCollectorProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(ipfixDfwCollectorProfilesGetInputType(), typeConverter) + sv.AddStructField("IpfixDfwCollectorProfileId", ipfixDfwCollectorProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXDFWCollectorProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwCollectorProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXDFWCollectorProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixDfwCollectorProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXDFWCollectorProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPFIXDFWCollectorProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(ipfixDfwCollectorProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXDFWCollectorProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwCollectorProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXDFWCollectorProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixDfwCollectorProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXDFWCollectorProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) Patch(ipfixDfwCollectorProfileIdParam string, iPFIXDFWCollectorProfileParam model.IPFIXDFWCollectorProfile) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(ipfixDfwCollectorProfilesPatchInputType(), typeConverter) + sv.AddStructField("IpfixDfwCollectorProfileId", ipfixDfwCollectorProfileIdParam) + sv.AddStructField("IPFIXDFWCollectorProfile", iPFIXDFWCollectorProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwCollectorProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) Update(ipfixDfwCollectorProfileIdParam string, iPFIXDFWCollectorProfileParam model.IPFIXDFWCollectorProfile) (model.IPFIXDFWCollectorProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(ipfixDfwCollectorProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpfixDfwCollectorProfileId", ipfixDfwCollectorProfileIdParam) + sv.AddStructField("IPFIXDFWCollectorProfile", iPFIXDFWCollectorProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXDFWCollectorProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwCollectorProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXDFWCollectorProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixDfwCollectorProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXDFWCollectorProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := iIface.connector.GetApiProvider().Invoke(iIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixDfwCollectorProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwCollectorProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwCollectorProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixDfwProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixDfwProfilesClient.go new file mode 100644 index 000000000..c5ce684fa --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixDfwProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: IpfixDfwProfiles + * Functions that implement the generated IpfixDfwProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultIpfixDfwProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultIpfixDfwProfilesClient(connector client.Connector) *DefaultIpfixDfwProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.ipfix_dfw_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + iIface := DefaultIpfixDfwProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + iIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + iIface.methodNameToDefMap["delete"] = iIface.deleteMethodDefinition() + iIface.methodNameToDefMap["get"] = iIface.getMethodDefinition() + iIface.methodNameToDefMap["list"] = iIface.listMethodDefinition() + iIface.methodNameToDefMap["patch"] = iIface.patchMethodDefinition() + iIface.methodNameToDefMap["update"] = iIface.updateMethodDefinition() + return &iIface +} + +func (iIface *DefaultIpfixDfwProfilesClient) Delete(ipfixDfwProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(ipfixDfwProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpfixDfwProfileId", ipfixDfwProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpfixDfwProfilesClient) Get(ipfixDfwProfileIdParam string) (model.IPFIXDFWProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(ipfixDfwProfilesGetInputType(), typeConverter) + sv.AddStructField("IpfixDfwProfileId", ipfixDfwProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXDFWProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXDFWProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixDfwProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXDFWProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpfixDfwProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPFIXDFWProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(ipfixDfwProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXDFWProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXDFWProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixDfwProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXDFWProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpfixDfwProfilesClient) Patch(ipfixDfwProfileIdParam string, iPFIXDFWProfileParam model.IPFIXDFWProfile) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(ipfixDfwProfilesPatchInputType(), typeConverter) + sv.AddStructField("IpfixDfwProfileId", ipfixDfwProfileIdParam) + sv.AddStructField("IPFIXDFWProfile", iPFIXDFWProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpfixDfwProfilesClient) Update(ipfixDfwProfileIdParam string, iPFIXDFWProfileParam model.IPFIXDFWProfile) (model.IPFIXDFWProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(ipfixDfwProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpfixDfwProfileId", ipfixDfwProfileIdParam) + sv.AddStructField("IPFIXDFWProfile", iPFIXDFWProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXDFWProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixDfwProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXDFWProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixDfwProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXDFWProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (iIface *DefaultIpfixDfwProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := iIface.connector.GetApiProvider().Invoke(iIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (iIface *DefaultIpfixDfwProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixDfwProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixDfwProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixDfwProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixDfwProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixDfwProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixDfwProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixL2CollectorProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixL2CollectorProfilesClient.go new file mode 100644 index 000000000..74c5478c8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixL2CollectorProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: IpfixL2CollectorProfiles + * Functions that implement the generated IpfixL2CollectorProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultIpfixL2CollectorProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultIpfixL2CollectorProfilesClient(connector client.Connector) *DefaultIpfixL2CollectorProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.ipfix_l2_collector_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + iIface := DefaultIpfixL2CollectorProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + iIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + iIface.methodNameToDefMap["delete"] = iIface.deleteMethodDefinition() + iIface.methodNameToDefMap["get"] = iIface.getMethodDefinition() + iIface.methodNameToDefMap["list"] = iIface.listMethodDefinition() + iIface.methodNameToDefMap["patch"] = iIface.patchMethodDefinition() + iIface.methodNameToDefMap["update"] = iIface.updateMethodDefinition() + return &iIface +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) Delete(ipfixL2CollectorProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(ipfixL2CollectorProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpfixL2CollectorProfileId", ipfixL2CollectorProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2CollectorProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) Get(ipfixL2CollectorProfileIdParam string) (model.IPFIXL2CollectorProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(ipfixL2CollectorProfilesGetInputType(), typeConverter) + sv.AddStructField("IpfixL2CollectorProfileId", ipfixL2CollectorProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXL2CollectorProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2CollectorProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXL2CollectorProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixL2CollectorProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXL2CollectorProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPFIXL2CollectorProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(ipfixL2CollectorProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXL2CollectorProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2CollectorProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXL2CollectorProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixL2CollectorProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXL2CollectorProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) Patch(ipfixL2CollectorProfileIdParam string, iPFIXL2CollectorProfileParam model.IPFIXL2CollectorProfile) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(ipfixL2CollectorProfilesPatchInputType(), typeConverter) + sv.AddStructField("IpfixL2CollectorProfileId", ipfixL2CollectorProfileIdParam) + sv.AddStructField("IPFIXL2CollectorProfile", iPFIXL2CollectorProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2CollectorProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) Update(ipfixL2CollectorProfileIdParam string, iPFIXL2CollectorProfileParam model.IPFIXL2CollectorProfile) (model.IPFIXL2CollectorProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(ipfixL2CollectorProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpfixL2CollectorProfileId", ipfixL2CollectorProfileIdParam) + sv.AddStructField("IPFIXL2CollectorProfile", iPFIXL2CollectorProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXL2CollectorProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2CollectorProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXL2CollectorProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixL2CollectorProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXL2CollectorProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (iIface *DefaultIpfixL2CollectorProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := iIface.connector.GetApiProvider().Invoke(iIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (iIface *DefaultIpfixL2CollectorProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixL2CollectorProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2CollectorProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2CollectorProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixL2ProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixL2ProfilesClient.go new file mode 100644 index 000000000..b60630627 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpfixL2ProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: IpfixL2Profiles + * Functions that implement the generated IpfixL2ProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultIpfixL2ProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultIpfixL2ProfilesClient(connector client.Connector) *DefaultIpfixL2ProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.ipfix_l2_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + iIface := DefaultIpfixL2ProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + iIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + iIface.methodNameToDefMap["delete"] = iIface.deleteMethodDefinition() + iIface.methodNameToDefMap["get"] = iIface.getMethodDefinition() + iIface.methodNameToDefMap["list"] = iIface.listMethodDefinition() + iIface.methodNameToDefMap["patch"] = iIface.patchMethodDefinition() + iIface.methodNameToDefMap["update"] = iIface.updateMethodDefinition() + return &iIface +} + +func (iIface *DefaultIpfixL2ProfilesClient) Delete(ipfixL2ProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(ipfixL2ProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpfixL2ProfileId", ipfixL2ProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2ProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpfixL2ProfilesClient) Get(ipfixL2ProfileIdParam string) (model.IPFIXL2Profile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(ipfixL2ProfilesGetInputType(), typeConverter) + sv.AddStructField("IpfixL2ProfileId", ipfixL2ProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXL2Profile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2ProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXL2Profile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixL2ProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXL2Profile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpfixL2ProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPFIXL2ProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(ipfixL2ProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXL2ProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2ProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXL2ProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixL2ProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXL2ProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpfixL2ProfilesClient) Patch(ipfixL2ProfileIdParam string, iPFIXL2ProfileParam model.IPFIXL2Profile) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(ipfixL2ProfilesPatchInputType(), typeConverter) + sv.AddStructField("IpfixL2ProfileId", ipfixL2ProfileIdParam) + sv.AddStructField("IPFIXL2Profile", iPFIXL2ProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2ProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpfixL2ProfilesClient) Update(ipfixL2ProfileIdParam string, iPFIXL2ProfileParam model.IPFIXL2Profile) (model.IPFIXL2Profile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(ipfixL2ProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpfixL2ProfileId", ipfixL2ProfileIdParam) + sv.AddStructField("IPFIXL2Profile", iPFIXL2ProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPFIXL2Profile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixL2ProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.IPFIXL2Profile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixL2ProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPFIXL2Profile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (iIface *DefaultIpfixL2ProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := iIface.connector.GetApiProvider().Invoke(iIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (iIface *DefaultIpfixL2ProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixL2ProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixL2ProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixL2ProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpfixL2ProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipfixL2ProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpfixL2ProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpv6DadProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpv6DadProfilesClient.go new file mode 100644 index 000000000..fa4c4413e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpv6DadProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Ipv6DadProfiles + * Functions that implement the generated Ipv6DadProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultIpv6DadProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultIpv6DadProfilesClient(connector client.Connector) *DefaultIpv6DadProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.ipv6_dad_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + iIface := DefaultIpv6DadProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + iIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + iIface.methodNameToDefMap["delete"] = iIface.deleteMethodDefinition() + iIface.methodNameToDefMap["get"] = iIface.getMethodDefinition() + iIface.methodNameToDefMap["list"] = iIface.listMethodDefinition() + iIface.methodNameToDefMap["patch"] = iIface.patchMethodDefinition() + iIface.methodNameToDefMap["update"] = iIface.updateMethodDefinition() + return &iIface +} + +func (iIface *DefaultIpv6DadProfilesClient) Delete(dadProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(ipv6DadProfilesDeleteInputType(), typeConverter) + sv.AddStructField("DadProfileId", dadProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6DadProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpv6DadProfilesClient) Get(dadProfileIdParam string) (model.Ipv6DadProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(ipv6DadProfilesGetInputType(), typeConverter) + sv.AddStructField("DadProfileId", dadProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Ipv6DadProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6DadProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Ipv6DadProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6DadProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Ipv6DadProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpv6DadProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Ipv6DadProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(ipv6DadProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Ipv6DadProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6DadProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Ipv6DadProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6DadProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Ipv6DadProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpv6DadProfilesClient) Patch(dadProfileIdParam string, ipv6DadProfileParam model.Ipv6DadProfile) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(ipv6DadProfilesPatchInputType(), typeConverter) + sv.AddStructField("DadProfileId", dadProfileIdParam) + sv.AddStructField("Ipv6DadProfile", ipv6DadProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6DadProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpv6DadProfilesClient) Update(dadProfileIdParam string, ipv6DadProfileParam model.Ipv6DadProfile) (model.Ipv6DadProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(ipv6DadProfilesUpdateInputType(), typeConverter) + sv.AddStructField("DadProfileId", dadProfileIdParam) + sv.AddStructField("Ipv6DadProfile", ipv6DadProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Ipv6DadProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6DadProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Ipv6DadProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6DadProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Ipv6DadProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (iIface *DefaultIpv6DadProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := iIface.connector.GetApiProvider().Invoke(iIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (iIface *DefaultIpv6DadProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpv6DadProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpv6DadProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpv6DadProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpv6DadProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6DadProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6DadProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpv6NdraProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpv6NdraProfilesClient.go new file mode 100644 index 000000000..4c6590ac3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultIpv6NdraProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Ipv6NdraProfiles + * Functions that implement the generated Ipv6NdraProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultIpv6NdraProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultIpv6NdraProfilesClient(connector client.Connector) *DefaultIpv6NdraProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.ipv6_ndra_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + iIface := DefaultIpv6NdraProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + iIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + iIface.methodNameToDefMap["delete"] = iIface.deleteMethodDefinition() + iIface.methodNameToDefMap["get"] = iIface.getMethodDefinition() + iIface.methodNameToDefMap["list"] = iIface.listMethodDefinition() + iIface.methodNameToDefMap["patch"] = iIface.patchMethodDefinition() + iIface.methodNameToDefMap["update"] = iIface.updateMethodDefinition() + return &iIface +} + +func (iIface *DefaultIpv6NdraProfilesClient) Delete(ndraProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(ipv6NdraProfilesDeleteInputType(), typeConverter) + sv.AddStructField("NdraProfileId", ndraProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6NdraProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpv6NdraProfilesClient) Get(ndraProfileIdParam string) (model.Ipv6NdraProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(ipv6NdraProfilesGetInputType(), typeConverter) + sv.AddStructField("NdraProfileId", ndraProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Ipv6NdraProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6NdraProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Ipv6NdraProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6NdraProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Ipv6NdraProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpv6NdraProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Ipv6NdraProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(ipv6NdraProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Ipv6NdraProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6NdraProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Ipv6NdraProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6NdraProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Ipv6NdraProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *DefaultIpv6NdraProfilesClient) Patch(ndraProfileIdParam string, ipv6NdraProfileParam model.Ipv6NdraProfile) error { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(ipv6NdraProfilesPatchInputType(), typeConverter) + sv.AddStructField("NdraProfileId", ndraProfileIdParam) + sv.AddStructField("Ipv6NdraProfile", ipv6NdraProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6NdraProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *DefaultIpv6NdraProfilesClient) Update(ndraProfileIdParam string, ipv6NdraProfileParam model.Ipv6NdraProfile) (model.Ipv6NdraProfile, error) { + typeConverter := iIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(iIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(ipv6NdraProfilesUpdateInputType(), typeConverter) + sv.AddStructField("NdraProfileId", ndraProfileIdParam) + sv.AddStructField("Ipv6NdraProfile", ipv6NdraProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Ipv6NdraProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6NdraProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := iIface.connector.NewExecutionContext() + methodResult := iIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Ipv6NdraProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6NdraProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Ipv6NdraProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (iIface *DefaultIpv6NdraProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := iIface.connector.GetApiProvider().Invoke(iIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (iIface *DefaultIpv6NdraProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpv6NdraProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpv6NdraProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpv6NdraProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (iIface *DefaultIpv6NdraProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(iIface.interfaceName) + typeConverter := iIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(ipv6NdraProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + iIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + iIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultIpv6NdraProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultLabelsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultLabelsClient.go new file mode 100644 index 000000000..6b9b915df --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultLabelsClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Labels + * Functions that implement the generated LabelsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultLabelsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultLabelsClient(connector client.Connector) *DefaultLabelsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.labels" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + lIface := DefaultLabelsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + lIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + lIface.methodNameToDefMap["delete"] = lIface.deleteMethodDefinition() + lIface.methodNameToDefMap["get"] = lIface.getMethodDefinition() + lIface.methodNameToDefMap["list"] = lIface.listMethodDefinition() + lIface.methodNameToDefMap["patch"] = lIface.patchMethodDefinition() + lIface.methodNameToDefMap["update"] = lIface.updateMethodDefinition() + return &lIface +} + +func (lIface *DefaultLabelsClient) Delete(labelIdParam string) error { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(labelsDeleteInputType(), typeConverter) + sv.AddStructField("LabelId", labelIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := labelsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *DefaultLabelsClient) Get(labelIdParam string) (model.PolicyLabel, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(labelsGetInputType(), typeConverter) + sv.AddStructField("LabelId", labelIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyLabel + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := labelsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyLabel + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), labelsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyLabel), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *DefaultLabelsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyLabelListResult, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(labelsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyLabelListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := labelsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyLabelListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), labelsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyLabelListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *DefaultLabelsClient) Patch(labelIdParam string, policyLabelParam model.PolicyLabel) error { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(labelsPatchInputType(), typeConverter) + sv.AddStructField("LabelId", labelIdParam) + sv.AddStructField("PolicyLabel", policyLabelParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := labelsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *DefaultLabelsClient) Update(labelIdParam string, policyLabelParam model.PolicyLabel) (model.PolicyLabel, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(labelsUpdateInputType(), typeConverter) + sv.AddStructField("LabelId", labelIdParam) + sv.AddStructField("PolicyLabel", policyLabelParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyLabel + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := labelsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyLabel + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), labelsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyLabel), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (lIface *DefaultLabelsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := lIface.connector.GetApiProvider().Invoke(lIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (lIface *DefaultLabelsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(labelsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(labelsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLabelsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(labelsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(labelsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLabelsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(labelsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(labelsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLabelsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(labelsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(labelsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLabelsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(labelsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(labelsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLabelsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultMacDiscoveryProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultMacDiscoveryProfilesClient.go new file mode 100644 index 000000000..1bc83d254 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultMacDiscoveryProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: MacDiscoveryProfiles + * Functions that implement the generated MacDiscoveryProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultMacDiscoveryProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultMacDiscoveryProfilesClient(connector client.Connector) *DefaultMacDiscoveryProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.mac_discovery_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + mIface := DefaultMacDiscoveryProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + mIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + mIface.methodNameToDefMap["delete"] = mIface.deleteMethodDefinition() + mIface.methodNameToDefMap["get"] = mIface.getMethodDefinition() + mIface.methodNameToDefMap["list"] = mIface.listMethodDefinition() + mIface.methodNameToDefMap["patch"] = mIface.patchMethodDefinition() + mIface.methodNameToDefMap["update"] = mIface.updateMethodDefinition() + return &mIface +} + +func (mIface *DefaultMacDiscoveryProfilesClient) Delete(macDiscoveryProfileIdParam string) error { + typeConverter := mIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(mIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(macDiscoveryProfilesDeleteInputType(), typeConverter) + sv.AddStructField("MacDiscoveryProfileId", macDiscoveryProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macDiscoveryProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := mIface.connector.NewExecutionContext() + methodResult := mIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *DefaultMacDiscoveryProfilesClient) Get(macDiscoveryProfileIdParam string) (model.MacDiscoveryProfile, error) { + typeConverter := mIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(mIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(macDiscoveryProfilesGetInputType(), typeConverter) + sv.AddStructField("MacDiscoveryProfileId", macDiscoveryProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MacDiscoveryProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macDiscoveryProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := mIface.connector.NewExecutionContext() + methodResult := mIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.MacDiscoveryProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macDiscoveryProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MacDiscoveryProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *DefaultMacDiscoveryProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MacDiscoveryProfileListResult, error) { + typeConverter := mIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(mIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(macDiscoveryProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MacDiscoveryProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macDiscoveryProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := mIface.connector.NewExecutionContext() + methodResult := mIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.MacDiscoveryProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macDiscoveryProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MacDiscoveryProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *DefaultMacDiscoveryProfilesClient) Patch(macDiscoveryProfileIdParam string, macDiscoveryProfileParam model.MacDiscoveryProfile) error { + typeConverter := mIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(mIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(macDiscoveryProfilesPatchInputType(), typeConverter) + sv.AddStructField("MacDiscoveryProfileId", macDiscoveryProfileIdParam) + sv.AddStructField("MacDiscoveryProfile", macDiscoveryProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macDiscoveryProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := mIface.connector.NewExecutionContext() + methodResult := mIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *DefaultMacDiscoveryProfilesClient) Update(macDiscoveryProfileIdParam string, macDiscoveryProfileParam model.MacDiscoveryProfile) (model.MacDiscoveryProfile, error) { + typeConverter := mIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(mIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(macDiscoveryProfilesUpdateInputType(), typeConverter) + sv.AddStructField("MacDiscoveryProfileId", macDiscoveryProfileIdParam) + sv.AddStructField("MacDiscoveryProfile", macDiscoveryProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MacDiscoveryProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macDiscoveryProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := mIface.connector.NewExecutionContext() + methodResult := mIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.MacDiscoveryProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macDiscoveryProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MacDiscoveryProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (mIface *DefaultMacDiscoveryProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := mIface.connector.GetApiProvider().Invoke(mIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (mIface *DefaultMacDiscoveryProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(mIface.interfaceName) + typeConverter := mIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + mIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (mIface *DefaultMacDiscoveryProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(mIface.interfaceName) + typeConverter := mIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + mIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (mIface *DefaultMacDiscoveryProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(mIface.interfaceName) + typeConverter := mIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + mIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (mIface *DefaultMacDiscoveryProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(mIface.interfaceName) + typeConverter := mIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + mIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (mIface *DefaultMacDiscoveryProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(mIface.interfaceName) + typeConverter := mIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(macDiscoveryProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + mIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + mIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultMacDiscoveryProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultOverriddenResourcesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultOverriddenResourcesClient.go new file mode 100644 index 000000000..6c6f59006 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultOverriddenResourcesClient.go @@ -0,0 +1,178 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: OverriddenResources + * Functions that implement the generated OverriddenResourcesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultOverriddenResourcesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultOverriddenResourcesClient(connector client.Connector) *DefaultOverriddenResourcesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.overridden_resources" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + oIface := DefaultOverriddenResourcesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + oIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + oIface.methodNameToDefMap["list"] = oIface.listMethodDefinition() + return &oIface +} + +func (oIface *DefaultOverriddenResourcesClient) List(intentPathParam *string, sitePathParam *string) (model.OverriddenResourceListResult, error) { + typeConverter := oIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(oIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(overriddenResourcesListInputType(), typeConverter) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("SitePath", sitePathParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.OverriddenResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := overriddenResourcesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := oIface.connector.NewExecutionContext() + methodResult := oIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.OverriddenResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), overriddenResourcesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.OverriddenResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (oIface *DefaultOverriddenResourcesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := oIface.connector.GetApiProvider().Invoke(oIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (oIface *DefaultOverriddenResourcesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(oIface.interfaceName) + typeConverter := oIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(overriddenResourcesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(overriddenResourcesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultOverriddenResourcesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultOverriddenResourcesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + oIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultOverriddenResourcesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + oIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultOverriddenResourcesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + oIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultOverriddenResourcesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + oIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultOverriddenResourcesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + oIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultOverriddenResourcesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultPortMirroringProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultPortMirroringProfilesClient.go new file mode 100644 index 000000000..dfd3d65c0 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultPortMirroringProfilesClient.go @@ -0,0 +1,559 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: PortMirroringProfiles + * Functions that implement the generated PortMirroringProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultPortMirroringProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultPortMirroringProfilesClient(connector client.Connector) *DefaultPortMirroringProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.port_mirroring_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + pIface := DefaultPortMirroringProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + pIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + pIface.methodNameToDefMap["delete"] = pIface.deleteMethodDefinition() + pIface.methodNameToDefMap["get"] = pIface.getMethodDefinition() + pIface.methodNameToDefMap["list"] = pIface.listMethodDefinition() + pIface.methodNameToDefMap["patch"] = pIface.patchMethodDefinition() + pIface.methodNameToDefMap["update"] = pIface.updateMethodDefinition() + return &pIface +} + +func (pIface *DefaultPortMirroringProfilesClient) Delete(portMirroringProfileIdParam string) error { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(portMirroringProfilesDeleteInputType(), typeConverter) + sv.AddStructField("PortMirroringProfileId", portMirroringProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := portMirroringProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *DefaultPortMirroringProfilesClient) Get(portMirroringProfileIdParam string) (model.PortMirroringProfile, error) { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(portMirroringProfilesGetInputType(), typeConverter) + sv.AddStructField("PortMirroringProfileId", portMirroringProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PortMirroringProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := portMirroringProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PortMirroringProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), portMirroringProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PortMirroringProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *DefaultPortMirroringProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PortMirroringProfileListResult, error) { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(portMirroringProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PortMirroringProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := portMirroringProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PortMirroringProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), portMirroringProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PortMirroringProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *DefaultPortMirroringProfilesClient) Patch(portMirroringProfileIdParam string, portMirroringProfileParam model.PortMirroringProfile) error { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(portMirroringProfilesPatchInputType(), typeConverter) + sv.AddStructField("PortMirroringProfileId", portMirroringProfileIdParam) + sv.AddStructField("PortMirroringProfile", portMirroringProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := portMirroringProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *DefaultPortMirroringProfilesClient) Update(portMirroringProfileIdParam string, portMirroringProfileParam model.PortMirroringProfile) (model.PortMirroringProfile, error) { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(portMirroringProfilesUpdateInputType(), typeConverter) + sv.AddStructField("PortMirroringProfileId", portMirroringProfileIdParam) + sv.AddStructField("PortMirroringProfile", portMirroringProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PortMirroringProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := portMirroringProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PortMirroringProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), portMirroringProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PortMirroringProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (pIface *DefaultPortMirroringProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := pIface.connector.GetApiProvider().Invoke(pIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (pIface *DefaultPortMirroringProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPortMirroringProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPortMirroringProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPortMirroringProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPortMirroringProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(portMirroringProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortMirroringProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultQosProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultQosProfilesClient.go new file mode 100644 index 000000000..bba7e7f2d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultQosProfilesClient.go @@ -0,0 +1,559 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: QosProfiles + * Functions that implement the generated QosProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultQosProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultQosProfilesClient(connector client.Connector) *DefaultQosProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.qos_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + qIface := DefaultQosProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + qIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + qIface.methodNameToDefMap["delete"] = qIface.deleteMethodDefinition() + qIface.methodNameToDefMap["get"] = qIface.getMethodDefinition() + qIface.methodNameToDefMap["list"] = qIface.listMethodDefinition() + qIface.methodNameToDefMap["patch"] = qIface.patchMethodDefinition() + qIface.methodNameToDefMap["update"] = qIface.updateMethodDefinition() + return &qIface +} + +func (qIface *DefaultQosProfilesClient) Delete(qosProfileIdParam string) error { + typeConverter := qIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(qIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(qosProfilesDeleteInputType(), typeConverter) + sv.AddStructField("QosProfileId", qosProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := qosProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + qIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := qIface.connector.NewExecutionContext() + methodResult := qIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), qIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (qIface *DefaultQosProfilesClient) Get(qosProfileIdParam string) (model.QosProfile, error) { + typeConverter := qIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(qIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(qosProfilesGetInputType(), typeConverter) + sv.AddStructField("QosProfileId", qosProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.QosProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := qosProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + qIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := qIface.connector.NewExecutionContext() + methodResult := qIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.QosProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), qosProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.QosProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), qIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (qIface *DefaultQosProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.QosProfileListResult, error) { + typeConverter := qIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(qIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(qosProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.QosProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := qosProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + qIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := qIface.connector.NewExecutionContext() + methodResult := qIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.QosProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), qosProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.QosProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), qIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (qIface *DefaultQosProfilesClient) Patch(qosProfileIdParam string, qosProfileParam model.QosProfile) error { + typeConverter := qIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(qIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(qosProfilesPatchInputType(), typeConverter) + sv.AddStructField("QosProfileId", qosProfileIdParam) + sv.AddStructField("QosProfile", qosProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := qosProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + qIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := qIface.connector.NewExecutionContext() + methodResult := qIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), qIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (qIface *DefaultQosProfilesClient) Update(qosProfileIdParam string, qosProfileParam model.QosProfile) (model.QosProfile, error) { + typeConverter := qIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(qIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(qosProfilesUpdateInputType(), typeConverter) + sv.AddStructField("QosProfileId", qosProfileIdParam) + sv.AddStructField("QosProfile", qosProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.QosProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := qosProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + qIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := qIface.connector.NewExecutionContext() + methodResult := qIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.QosProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), qosProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.QosProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), qIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (qIface *DefaultQosProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := qIface.connector.GetApiProvider().Invoke(qIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (qIface *DefaultQosProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(qIface.interfaceName) + typeConverter := qIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(qosProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(qosProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + qIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (qIface *DefaultQosProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(qIface.interfaceName) + typeConverter := qIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(qosProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(qosProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + qIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (qIface *DefaultQosProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(qIface.interfaceName) + typeConverter := qIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(qosProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(qosProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + qIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (qIface *DefaultQosProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(qIface.interfaceName) + typeConverter := qIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(qosProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(qosProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + qIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (qIface *DefaultQosProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(qIface.interfaceName) + typeConverter := qIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(qosProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(qosProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + qIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQosProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSegmentSecurityProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSegmentSecurityProfilesClient.go new file mode 100644 index 000000000..1721dfe00 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSegmentSecurityProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SegmentSecurityProfiles + * Functions that implement the generated SegmentSecurityProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSegmentSecurityProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSegmentSecurityProfilesClient(connector client.Connector) *DefaultSegmentSecurityProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segment_security_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSegmentSecurityProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSegmentSecurityProfilesClient) Delete(segmentSecurityProfileIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(segmentSecurityProfilesDeleteInputType(), typeConverter) + sv.AddStructField("SegmentSecurityProfileId", segmentSecurityProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentSecurityProfilesClient) Get(segmentSecurityProfileIdParam string) (model.SegmentSecurityProfile, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(segmentSecurityProfilesGetInputType(), typeConverter) + sv.AddStructField("SegmentSecurityProfileId", segmentSecurityProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentSecurityProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentSecurityProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentSecurityProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentSecurityProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentSecurityProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentSecurityProfileListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(segmentSecurityProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentSecurityProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentSecurityProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentSecurityProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentSecurityProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentSecurityProfilesClient) Patch(segmentSecurityProfileIdParam string, segmentSecurityProfileParam model.SegmentSecurityProfile) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(segmentSecurityProfilesPatchInputType(), typeConverter) + sv.AddStructField("SegmentSecurityProfileId", segmentSecurityProfileIdParam) + sv.AddStructField("SegmentSecurityProfile", segmentSecurityProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentSecurityProfilesClient) Update(segmentSecurityProfileIdParam string, segmentSecurityProfileParam model.SegmentSecurityProfile) (model.SegmentSecurityProfile, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(segmentSecurityProfilesUpdateInputType(), typeConverter) + sv.AddStructField("SegmentSecurityProfileId", segmentSecurityProfileIdParam) + sv.AddStructField("SegmentSecurityProfile", segmentSecurityProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentSecurityProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentSecurityProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentSecurityProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentSecurityProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSegmentSecurityProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSegmentSecurityProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentSecurityProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentSecurityProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentSecurityProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentSecurityProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSegmentsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSegmentsClient.go new file mode 100644 index 000000000..e39b7f49f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSegmentsClient.go @@ -0,0 +1,841 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Segments + * Functions that implement the generated SegmentsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSegmentsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSegmentsClient(connector client.Connector) *DefaultSegmentsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "delete_0"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "patch_0"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + core.NewMethodIdentifier(interfaceIdentifier, "update_0"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSegmentsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["delete_0"] = sIface.delete_0MethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["patch_0"] = sIface.patch_0MethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + sIface.methodNameToDefMap["update_0"] = sIface.update_0MethodDefinition() + return &sIface +} + +func (sIface *DefaultSegmentsClient) Delete(segmentIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(segmentsDeleteInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Delete0(segmentIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete_0") + sv := bindings.NewStructValueBuilder(segmentsDelete0InputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsDelete0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Get(segmentIdParam string) (model.Segment, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(segmentsGetInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Segment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Segment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Segment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(segmentsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Patch(segmentIdParam string, segmentParam model.Segment) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(segmentsPatchInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Segment", segmentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Patch0(segmentIdParam string, segmentParam model.Segment) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch_0") + sv := bindings.NewStructValueBuilder(segmentsPatch0InputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Segment", segmentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsPatch0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Update(segmentIdParam string, segmentParam model.Segment) (model.Segment, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(segmentsUpdateInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Segment", segmentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Segment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Segment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Segment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Update0(segmentIdParam string, segmentParam model.Segment) (model.Segment, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update_0") + sv := bindings.NewStructValueBuilder(segmentsUpdate0InputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Segment", segmentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Segment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsUpdate0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Segment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentsUpdate0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Segment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSegmentsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSegmentsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) delete_0MethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsDelete0InputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsDelete0OutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete_0") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) patch_0MethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsPatch0InputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsPatch0OutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch_0 method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch_0 method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch_0") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch_0 method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch_0 method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch_0 method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch_0 method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch_0 method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) update_0MethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsUpdate0InputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsUpdate0OutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update_0 method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update_0 method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update_0") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update_0 method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update_0 method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update_0 method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update_0 method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update_0 method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultServicesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultServicesClient.go new file mode 100644 index 000000000..0df1ce04f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultServicesClient.go @@ -0,0 +1,561 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Services + * Functions that implement the generated ServicesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultServicesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultServicesClient(connector client.Connector) *DefaultServicesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.services" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultServicesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultServicesClient) Delete(serviceIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(servicesDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultServicesClient) Get(serviceIdParam string) (model.Service, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(servicesGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Service + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Service + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Service), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultServicesClient) List(cursorParam *string, defaultServiceParam *bool, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ServiceListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(servicesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DefaultService", defaultServiceParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.ServiceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultServicesClient) Patch(serviceIdParam string, serviceParam model.Service) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(servicesPatchInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Service", serviceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultServicesClient) Update(serviceIdParam string, serviceParam model.Service) (model.Service, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(servicesUpdateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Service", serviceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Service + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Service + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Service), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultServicesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultServicesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(servicesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(servicesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultServicesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(servicesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(servicesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultServicesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(servicesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(servicesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultServicesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(servicesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(servicesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultServicesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(servicesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(servicesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultServicesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSitesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSitesClient.go new file mode 100644 index 000000000..4ad333aaf --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSitesClient.go @@ -0,0 +1,561 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Sites + * Functions that implement the generated SitesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSitesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSitesClient(connector client.Connector) *DefaultSitesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.sites" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSitesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSitesClient) Delete(siteIdParam string, forceParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(sitesDeleteInputType(), typeConverter) + sv.AddStructField("SiteId", siteIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSitesClient) Get(siteIdParam string) (model.Site, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(sitesGetInputType(), typeConverter) + sv.AddStructField("SiteId", siteIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Site + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Site + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sitesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Site), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSitesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SiteListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(sitesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SiteListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SiteListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sitesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SiteListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSitesClient) Patch(siteIdParam string, siteParam model.Site) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(sitesPatchInputType(), typeConverter) + sv.AddStructField("SiteId", siteIdParam) + sv.AddStructField("Site", siteParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSitesClient) Update(siteIdParam string, siteParam model.Site) (model.Site, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(sitesUpdateInputType(), typeConverter) + sv.AddStructField("SiteId", siteIdParam) + sv.AddStructField("Site", siteParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Site + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Site + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sitesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Site), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSitesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSitesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sitesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sitesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSitesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sitesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sitesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSitesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sitesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sitesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSitesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sitesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sitesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSitesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sitesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sitesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSitesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSpanClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSpanClient.go new file mode 100644 index 000000000..0c3bd3e24 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSpanClient.go @@ -0,0 +1,178 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Span + * Functions that implement the generated SpanClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSpanClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSpanClient(connector client.Connector) *DefaultSpanClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.span" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSpanClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + return &sIface +} + +func (sIface *DefaultSpanClient) Get(intentPathParam string, sitePathParam *string) (model.Span, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(spanGetInputType(), typeConverter) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("SitePath", sitePathParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Span + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := spanGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Span + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), spanGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Span), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSpanClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSpanClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(spanGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(spanGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpanClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpanClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpanClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpanClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpanClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpanClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpanClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSpoofguardProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSpoofguardProfilesClient.go new file mode 100644 index 000000000..fd7d797d9 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultSpoofguardProfilesClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SpoofguardProfiles + * Functions that implement the generated SpoofguardProfilesClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSpoofguardProfilesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSpoofguardProfilesClient(connector client.Connector) *DefaultSpoofguardProfilesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.spoofguard_profiles" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSpoofguardProfilesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSpoofguardProfilesClient) Delete(spoofguardProfileIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(spoofguardProfilesDeleteInputType(), typeConverter) + sv.AddStructField("SpoofguardProfileId", spoofguardProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := spoofguardProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSpoofguardProfilesClient) Get(spoofguardProfileIdParam string) (model.SpoofGuardProfile, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(spoofguardProfilesGetInputType(), typeConverter) + sv.AddStructField("SpoofguardProfileId", spoofguardProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SpoofGuardProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := spoofguardProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SpoofGuardProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), spoofguardProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SpoofGuardProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSpoofguardProfilesClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SpoofGuardProfileListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(spoofguardProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SpoofGuardProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := spoofguardProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SpoofGuardProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), spoofguardProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SpoofGuardProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSpoofguardProfilesClient) Patch(spoofguardProfileIdParam string, spoofGuardProfileParam model.SpoofGuardProfile) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(spoofguardProfilesPatchInputType(), typeConverter) + sv.AddStructField("SpoofguardProfileId", spoofguardProfileIdParam) + sv.AddStructField("SpoofGuardProfile", spoofGuardProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := spoofguardProfilesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSpoofguardProfilesClient) Update(spoofguardProfileIdParam string, spoofGuardProfileParam model.SpoofGuardProfile) (model.SpoofGuardProfile, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(spoofguardProfilesUpdateInputType(), typeConverter) + sv.AddStructField("SpoofguardProfileId", spoofguardProfileIdParam) + sv.AddStructField("SpoofGuardProfile", spoofGuardProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SpoofGuardProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := spoofguardProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SpoofGuardProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), spoofguardProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SpoofGuardProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSpoofguardProfilesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSpoofguardProfilesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSpoofguardProfilesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSpoofguardProfilesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSpoofguardProfilesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSpoofguardProfilesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(spoofguardProfilesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSpoofguardProfilesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTagsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTagsClient.go new file mode 100644 index 000000000..fb7312f40 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTagsClient.go @@ -0,0 +1,185 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Tags + * Functions that implement the generated TagsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultTagsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultTagsClient(connector client.Connector) *DefaultTagsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tags" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + tIface := DefaultTagsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + tIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + tIface.methodNameToDefMap["list"] = tIface.listMethodDefinition() + return &tIface +} + +func (tIface *DefaultTagsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, scopeParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, tagParam *string) (model.TagInfoListResult, error) { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(tagsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Scope", scopeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("Tag", tagParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TagInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tagsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.TagInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tagsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TagInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (tIface *DefaultTagsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := tIface.connector.GetApiProvider().Invoke(tIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (tIface *DefaultTagsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tagsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tagsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTagsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTagsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTagsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTagsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTagsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTagsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTagsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTier0sClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTier0sClient.go new file mode 100644 index 000000000..bd8307f57 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTier0sClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Tier0s + * Functions that implement the generated Tier0sClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultTier0sClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultTier0sClient(connector client.Connector) *DefaultTier0sClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier0s" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + tIface := DefaultTier0sClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + tIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + tIface.methodNameToDefMap["delete"] = tIface.deleteMethodDefinition() + tIface.methodNameToDefMap["get"] = tIface.getMethodDefinition() + tIface.methodNameToDefMap["list"] = tIface.listMethodDefinition() + tIface.methodNameToDefMap["patch"] = tIface.patchMethodDefinition() + tIface.methodNameToDefMap["update"] = tIface.updateMethodDefinition() + return &tIface +} + +func (tIface *DefaultTier0sClient) Delete(tier0IdParam string) error { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(tier0sDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier0sDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *DefaultTier0sClient) Get(tier0IdParam string) (model.Tier0, error) { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(tier0sGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier0 + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier0sGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier0 + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tier0sGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier0), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *DefaultTier0sClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier0ListResult, error) { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(tier0sListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier0ListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier0sListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier0ListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tier0sListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier0ListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *DefaultTier0sClient) Patch(tier0IdParam string, tier0Param model.Tier0) error { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(tier0sPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Tier0", tier0Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier0sPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *DefaultTier0sClient) Update(tier0IdParam string, tier0Param model.Tier0) (model.Tier0, error) { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(tier0sUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Tier0", tier0Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier0 + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier0sUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier0 + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tier0sUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier0), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (tIface *DefaultTier0sClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := tIface.connector.GetApiProvider().Invoke(tIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (tIface *DefaultTier0sClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier0sDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier0sDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (tIface *DefaultTier0sClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier0sGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier0sGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (tIface *DefaultTier0sClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier0sListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier0sListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (tIface *DefaultTier0sClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier0sPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier0sPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (tIface *DefaultTier0sClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier0sUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier0sUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier0sClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTier1sClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTier1sClient.go new file mode 100644 index 000000000..39e53597a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultTier1sClient.go @@ -0,0 +1,560 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Tier1s + * Functions that implement the generated Tier1sClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultTier1sClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultTier1sClient(connector client.Connector) *DefaultTier1sClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier1s" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + tIface := DefaultTier1sClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + tIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + tIface.methodNameToDefMap["delete"] = tIface.deleteMethodDefinition() + tIface.methodNameToDefMap["get"] = tIface.getMethodDefinition() + tIface.methodNameToDefMap["list"] = tIface.listMethodDefinition() + tIface.methodNameToDefMap["patch"] = tIface.patchMethodDefinition() + tIface.methodNameToDefMap["update"] = tIface.updateMethodDefinition() + return &tIface +} + +func (tIface *DefaultTier1sClient) Delete(tier1IdParam string) error { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(tier1sDeleteInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier1sDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *DefaultTier1sClient) Get(tier1IdParam string) (model.Tier1, error) { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(tier1sGetInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier1 + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier1sGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier1 + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tier1sGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier1), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *DefaultTier1sClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier1ListResult, error) { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(tier1sListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier1ListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier1sListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier1ListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tier1sListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier1ListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *DefaultTier1sClient) Patch(tier1IdParam string, tier1Param model.Tier1) error { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(tier1sPatchInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("Tier1", tier1Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier1sPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *DefaultTier1sClient) Update(tier1IdParam string, tier1Param model.Tier1) (model.Tier1, error) { + typeConverter := tIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(tIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(tier1sUpdateInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("Tier1", tier1Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier1 + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tier1sUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := tIface.connector.NewExecutionContext() + methodResult := tIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier1 + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tier1sUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier1), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (tIface *DefaultTier1sClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := tIface.connector.GetApiProvider().Invoke(tIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (tIface *DefaultTier1sClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier1sDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier1sDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (tIface *DefaultTier1sClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier1sGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier1sGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (tIface *DefaultTier1sClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier1sListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier1sListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (tIface *DefaultTier1sClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier1sPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier1sPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (tIface *DefaultTier1sClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(tIface.interfaceName) + typeConverter := tIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(tier1sUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(tier1sUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + tIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + tIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultTier1sClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultUpgradeSummaryClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultUpgradeSummaryClient.go new file mode 100644 index 000000000..9285ab650 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultUpgradeSummaryClient.go @@ -0,0 +1,182 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: UpgradeSummary + * Functions that implement the generated UpgradeSummaryClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultUpgradeSummaryClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultUpgradeSummaryClient(connector client.Connector) *DefaultUpgradeSummaryClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.upgrade_summary" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + uIface := DefaultUpgradeSummaryClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + uIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + uIface.methodNameToDefMap["list"] = uIface.listMethodDefinition() + return &uIface +} + +func (uIface *DefaultUpgradeSummaryClient) List(currentVersionParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.FederationUpgradeSummaryListResult, error) { + typeConverter := uIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(uIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(upgradeSummaryListInputType(), typeConverter) + sv.AddStructField("CurrentVersion", currentVersionParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FederationUpgradeSummaryListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeSummaryListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := uIface.connector.NewExecutionContext() + methodResult := uIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FederationUpgradeSummaryListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeSummaryListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FederationUpgradeSummaryListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (uIface *DefaultUpgradeSummaryClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := uIface.connector.GetApiProvider().Invoke(uIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (uIface *DefaultUpgradeSummaryClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(uIface.interfaceName) + typeConverter := uIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(upgradeSummaryListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(upgradeSummaryListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUpgradeSummaryClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUpgradeSummaryClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + uIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUpgradeSummaryClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUpgradeSummaryClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUpgradeSummaryClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUpgradeSummaryClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + uIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultUpgradeSummaryClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultVirtualMachineGroupAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultVirtualMachineGroupAssociationsClient.go new file mode 100644 index 000000000..bb27691c7 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultVirtualMachineGroupAssociationsClient.go @@ -0,0 +1,184 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: VirtualMachineGroupAssociations + * Functions that implement the generated VirtualMachineGroupAssociationsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultVirtualMachineGroupAssociationsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultVirtualMachineGroupAssociationsClient(connector client.Connector) *DefaultVirtualMachineGroupAssociationsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.virtual_machine_group_associations" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + vIface := DefaultVirtualMachineGroupAssociationsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + vIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + vIface.methodNameToDefMap["list"] = vIface.listMethodDefinition() + return &vIface +} + +func (vIface *DefaultVirtualMachineGroupAssociationsClient) List(vmExternalIdParam string, cursorParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceForEPListResult, error) { + typeConverter := vIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(vIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(virtualMachineGroupAssociationsListInputType(), typeConverter) + sv.AddStructField("VmExternalId", vmExternalIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyResourceReferenceForEPListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualMachineGroupAssociationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := vIface.connector.NewExecutionContext() + methodResult := vIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyResourceReferenceForEPListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualMachineGroupAssociationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyResourceReferenceForEPListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (vIface *DefaultVirtualMachineGroupAssociationsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := vIface.connector.GetApiProvider().Invoke(vIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (vIface *DefaultVirtualMachineGroupAssociationsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(vIface.interfaceName) + typeConverter := vIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(virtualMachineGroupAssociationsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(virtualMachineGroupAssociationsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualMachineGroupAssociationsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualMachineGroupAssociationsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + vIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualMachineGroupAssociationsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + vIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualMachineGroupAssociationsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + vIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualMachineGroupAssociationsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + vIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualMachineGroupAssociationsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + vIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualMachineGroupAssociationsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultVirtualNetworkInterfaceGroupAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultVirtualNetworkInterfaceGroupAssociationsClient.go new file mode 100644 index 000000000..dfc4be01c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DefaultVirtualNetworkInterfaceGroupAssociationsClient.go @@ -0,0 +1,184 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: VirtualNetworkInterfaceGroupAssociations + * Functions that implement the generated VirtualNetworkInterfaceGroupAssociationsClient interface + */ + + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultVirtualNetworkInterfaceGroupAssociationsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultVirtualNetworkInterfaceGroupAssociationsClient(connector client.Connector) *DefaultVirtualNetworkInterfaceGroupAssociationsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.virtual_network_interface_group_associations" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + vIface := DefaultVirtualNetworkInterfaceGroupAssociationsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + vIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + vIface.methodNameToDefMap["list"] = vIface.listMethodDefinition() + return &vIface +} + +func (vIface *DefaultVirtualNetworkInterfaceGroupAssociationsClient) List(vifExternalIdParam string, cursorParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceForEPListResult, error) { + typeConverter := vIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(vIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(virtualNetworkInterfaceGroupAssociationsListInputType(), typeConverter) + sv.AddStructField("VifExternalId", vifExternalIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyResourceReferenceForEPListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualNetworkInterfaceGroupAssociationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := vIface.connector.NewExecutionContext() + methodResult := vIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyResourceReferenceForEPListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualNetworkInterfaceGroupAssociationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyResourceReferenceForEPListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (vIface *DefaultVirtualNetworkInterfaceGroupAssociationsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := vIface.connector.GetApiProvider().Invoke(vIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (vIface *DefaultVirtualNetworkInterfaceGroupAssociationsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(vIface.interfaceName) + typeConverter := vIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(virtualNetworkInterfaceGroupAssociationsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(virtualNetworkInterfaceGroupAssociationsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualNetworkInterfaceGroupAssociationsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualNetworkInterfaceGroupAssociationsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + vIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualNetworkInterfaceGroupAssociationsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + vIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualNetworkInterfaceGroupAssociationsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + vIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualNetworkInterfaceGroupAssociationsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + vIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualNetworkInterfaceGroupAssociationsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + vIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultVirtualNetworkInterfaceGroupAssociationsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpRelayConfigsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpRelayConfigsClient.go new file mode 100644 index 000000000..be60c400b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpRelayConfigsClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: DhcpRelayConfigs + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DhcpRelayConfigsClient interface { + + // Delete DHCP relay configuration + // + // @param dhcpRelayConfigIdParam DHCP relay config ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(dhcpRelayConfigIdParam string) error + + // Read DHCP relay configuration + // + // @param dhcpRelayConfigIdParam DHCP relay config ID (required) + // @return com.vmware.nsx_global_policy.model.DhcpRelayConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(dhcpRelayConfigIdParam string) (model.DhcpRelayConfig, error) + + // Paginated list of all DHCP relay config instances + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.DhcpRelayConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpRelayConfigListResult, error) + + // If DHCP relay config with the dhcp-relay-config-id is not already present, create a new DHCP relay config instance. If it already exists, update the DHCP relay config instance with specified attributes. + // + // @param dhcpRelayConfigIdParam DHCP relay config ID (required) + // @param dhcpRelayConfigParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(dhcpRelayConfigIdParam string, dhcpRelayConfigParam model.DhcpRelayConfig) error + + // If DHCP relay config with the dhcp-relay-config-id is not already present, create a new DHCP relay config instance. If it already exists, replace the DHCP relay config instance with this object. + // + // @param dhcpRelayConfigIdParam DHCP relay config ID (required) + // @param dhcpRelayConfigParam (required) + // @return com.vmware.nsx_global_policy.model.DhcpRelayConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(dhcpRelayConfigIdParam string, dhcpRelayConfigParam model.DhcpRelayConfig) (model.DhcpRelayConfig, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpRelayConfigsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpRelayConfigsTypes.go new file mode 100644 index 000000000..f906fbf98 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpRelayConfigsTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: DhcpRelayConfigs. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func dhcpRelayConfigsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_relay_config_id"] = bindings.NewStringType() + fieldNameMap["dhcp_relay_config_id"] = "DhcpRelayConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpRelayConfigsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dhcpRelayConfigsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_relay_config_id"] = bindings.NewStringType() + fieldNameMap["dhcp_relay_config_id"] = "DhcpRelayConfigId" + paramsTypeMap["dhcp_relay_config_id"] = bindings.NewStringType() + paramsTypeMap["dhcpRelayConfigId"] = bindings.NewStringType() + pathParams["dhcp_relay_config_id"] = "dhcpRelayConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/dhcp-relay-configs/{dhcpRelayConfigId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpRelayConfigsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_relay_config_id"] = bindings.NewStringType() + fieldNameMap["dhcp_relay_config_id"] = "DhcpRelayConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpRelayConfigsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayConfigBindingType) +} + +func dhcpRelayConfigsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_relay_config_id"] = bindings.NewStringType() + fieldNameMap["dhcp_relay_config_id"] = "DhcpRelayConfigId" + paramsTypeMap["dhcp_relay_config_id"] = bindings.NewStringType() + paramsTypeMap["dhcpRelayConfigId"] = bindings.NewStringType() + pathParams["dhcp_relay_config_id"] = "dhcpRelayConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/dhcp-relay-configs/{dhcpRelayConfigId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpRelayConfigsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpRelayConfigsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayConfigListResultBindingType) +} + +func dhcpRelayConfigsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/dhcp-relay-configs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpRelayConfigsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_relay_config_id"] = bindings.NewStringType() + fields["dhcp_relay_config"] = bindings.NewReferenceType(model.DhcpRelayConfigBindingType) + fieldNameMap["dhcp_relay_config_id"] = "DhcpRelayConfigId" + fieldNameMap["dhcp_relay_config"] = "DhcpRelayConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpRelayConfigsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dhcpRelayConfigsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_relay_config_id"] = bindings.NewStringType() + fields["dhcp_relay_config"] = bindings.NewReferenceType(model.DhcpRelayConfigBindingType) + fieldNameMap["dhcp_relay_config_id"] = "DhcpRelayConfigId" + fieldNameMap["dhcp_relay_config"] = "DhcpRelayConfig" + paramsTypeMap["dhcp_relay_config_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_relay_config"] = bindings.NewReferenceType(model.DhcpRelayConfigBindingType) + paramsTypeMap["dhcpRelayConfigId"] = bindings.NewStringType() + pathParams["dhcp_relay_config_id"] = "dhcpRelayConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_relay_config", + "PATCH", + "/global-manager/api/v1/global-infra/dhcp-relay-configs/{dhcpRelayConfigId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpRelayConfigsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_relay_config_id"] = bindings.NewStringType() + fields["dhcp_relay_config"] = bindings.NewReferenceType(model.DhcpRelayConfigBindingType) + fieldNameMap["dhcp_relay_config_id"] = "DhcpRelayConfigId" + fieldNameMap["dhcp_relay_config"] = "DhcpRelayConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpRelayConfigsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayConfigBindingType) +} + +func dhcpRelayConfigsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_relay_config_id"] = bindings.NewStringType() + fields["dhcp_relay_config"] = bindings.NewReferenceType(model.DhcpRelayConfigBindingType) + fieldNameMap["dhcp_relay_config_id"] = "DhcpRelayConfigId" + fieldNameMap["dhcp_relay_config"] = "DhcpRelayConfig" + paramsTypeMap["dhcp_relay_config_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_relay_config"] = bindings.NewReferenceType(model.DhcpRelayConfigBindingType) + paramsTypeMap["dhcpRelayConfigId"] = bindings.NewStringType() + pathParams["dhcp_relay_config_id"] = "dhcpRelayConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_relay_config", + "PUT", + "/global-manager/api/v1/global-infra/dhcp-relay-configs/{dhcpRelayConfigId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpServerConfigsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpServerConfigsClient.go new file mode 100644 index 000000000..48bf61e51 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpServerConfigsClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: DhcpServerConfigs + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DhcpServerConfigsClient interface { + + // Delete DHCP server configuration + // + // @param dhcpServerConfigIdParam DHCP server config ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(dhcpServerConfigIdParam string) error + + // Read DHCP server configuration + // + // @param dhcpServerConfigIdParam DHCP server config ID (required) + // @return com.vmware.nsx_global_policy.model.DhcpServerConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(dhcpServerConfigIdParam string) (model.DhcpServerConfig, error) + + // Paginated list of all DHCP server config instances + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.DhcpServerConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpServerConfigListResult, error) + + // If DHCP server config with the dhcp-server-config-id is not already present, create a new DHCP server config instance. If it already exists, update the DHCP server config instance with specified attributes. Realized entities of this API can be found using the path of Tier-0, Tier1, or Segment where this config is applied on. Modification of edge_cluster_path in DhcpServerConfig will lose all existing DHCP leases. If both the preferred_edge_paths in the DhcpServerConfig are changed in a same PATCH API, e.g. change from [a,b] to [x,y], the current DHCP server leases will be lost, which could cause network connectivity issues. It is recommended to change only one member index in an update call, e.g. from [a, b] to [a,y]. Clearing preferred_edge_paths will not reassign edge nodes from the edge cluster. Instead, the previously-allocated edge nodes will be retained to avoid loss of leases. + // + // @param dhcpServerConfigIdParam DHCP server config ID (required) + // @param dhcpServerConfigParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(dhcpServerConfigIdParam string, dhcpServerConfigParam model.DhcpServerConfig) error + + // If DHCP server config with the dhcp-server-config-id is not already present, create a new DHCP server config instance. If it already exists, replace the DHCP server config instance with this object. Realized entities of this API can be found using the path of Tier-0, Tier1, or Segment where this config is applied on. Modification of edge_cluster_path in DhcpServerConfig will lose all existing DHCP leases. If both the preferred_edge_paths in the DhcpServerConfig are changed in a same PUT API, e.g. change from [a,b] to [x,y], the current DHCP server leases will be lost, which could cause network connectivity issues. It is recommended to change only one member index in an update call, e.g. from [a, b] to [a,y]. Clearing preferred_edge_paths will not reassign edge nodes from the edge cluster. Instead, the previously-allocated edge nodes will be retained to avoid loss of leases. + // + // @param dhcpServerConfigIdParam DHCP server config ID (required) + // @param dhcpServerConfigParam (required) + // @return com.vmware.nsx_global_policy.model.DhcpServerConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(dhcpServerConfigIdParam string, dhcpServerConfigParam model.DhcpServerConfig) (model.DhcpServerConfig, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpServerConfigsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpServerConfigsTypes.go new file mode 100644 index 000000000..83151bff3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DhcpServerConfigsTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: DhcpServerConfigs. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func dhcpServerConfigsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_server_config_id"] = bindings.NewStringType() + fieldNameMap["dhcp_server_config_id"] = "DhcpServerConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpServerConfigsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dhcpServerConfigsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_server_config_id"] = bindings.NewStringType() + fieldNameMap["dhcp_server_config_id"] = "DhcpServerConfigId" + paramsTypeMap["dhcp_server_config_id"] = bindings.NewStringType() + paramsTypeMap["dhcpServerConfigId"] = bindings.NewStringType() + pathParams["dhcp_server_config_id"] = "dhcpServerConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/dhcp-server-configs/{dhcpServerConfigId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpServerConfigsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_server_config_id"] = bindings.NewStringType() + fieldNameMap["dhcp_server_config_id"] = "DhcpServerConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpServerConfigsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpServerConfigBindingType) +} + +func dhcpServerConfigsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_server_config_id"] = bindings.NewStringType() + fieldNameMap["dhcp_server_config_id"] = "DhcpServerConfigId" + paramsTypeMap["dhcp_server_config_id"] = bindings.NewStringType() + paramsTypeMap["dhcpServerConfigId"] = bindings.NewStringType() + pathParams["dhcp_server_config_id"] = "dhcpServerConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/dhcp-server-configs/{dhcpServerConfigId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpServerConfigsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpServerConfigsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpServerConfigListResultBindingType) +} + +func dhcpServerConfigsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/dhcp-server-configs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpServerConfigsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_server_config_id"] = bindings.NewStringType() + fields["dhcp_server_config"] = bindings.NewReferenceType(model.DhcpServerConfigBindingType) + fieldNameMap["dhcp_server_config_id"] = "DhcpServerConfigId" + fieldNameMap["dhcp_server_config"] = "DhcpServerConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpServerConfigsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dhcpServerConfigsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_server_config_id"] = bindings.NewStringType() + fields["dhcp_server_config"] = bindings.NewReferenceType(model.DhcpServerConfigBindingType) + fieldNameMap["dhcp_server_config_id"] = "DhcpServerConfigId" + fieldNameMap["dhcp_server_config"] = "DhcpServerConfig" + paramsTypeMap["dhcp_server_config_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_server_config"] = bindings.NewReferenceType(model.DhcpServerConfigBindingType) + paramsTypeMap["dhcpServerConfigId"] = bindings.NewStringType() + pathParams["dhcp_server_config_id"] = "dhcpServerConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_server_config", + "PATCH", + "/global-manager/api/v1/global-infra/dhcp-server-configs/{dhcpServerConfigId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpServerConfigsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_server_config_id"] = bindings.NewStringType() + fields["dhcp_server_config"] = bindings.NewReferenceType(model.DhcpServerConfigBindingType) + fieldNameMap["dhcp_server_config_id"] = "DhcpServerConfigId" + fieldNameMap["dhcp_server_config"] = "DhcpServerConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpServerConfigsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpServerConfigBindingType) +} + +func dhcpServerConfigsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_server_config_id"] = bindings.NewStringType() + fields["dhcp_server_config"] = bindings.NewReferenceType(model.DhcpServerConfigBindingType) + fieldNameMap["dhcp_server_config_id"] = "DhcpServerConfigId" + fieldNameMap["dhcp_server_config"] = "DhcpServerConfig" + paramsTypeMap["dhcp_server_config_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_server_config"] = bindings.NewReferenceType(model.DhcpServerConfigBindingType) + paramsTypeMap["dhcpServerConfigId"] = bindings.NewStringType() + pathParams["dhcp_server_config_id"] = "dhcpServerConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_server_config", + "PUT", + "/global-manager/api/v1/global-infra/dhcp-server-configs/{dhcpServerConfigId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsForwarderZonesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsForwarderZonesClient.go new file mode 100644 index 000000000..c99220d1b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsForwarderZonesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: DnsForwarderZones + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DnsForwarderZonesClient interface { + + // Delete the DNS Forwarder Zone + // + // @param dnsForwarderZoneIdParam DNS Forwarder Zone ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(dnsForwarderZoneIdParam string) error + + // Read the DNS Forwarder Zone + // + // @param dnsForwarderZoneIdParam DNS Forwarder Zone ID (required) + // @return com.vmware.nsx_global_policy.model.PolicyDnsForwarderZone + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(dnsForwarderZoneIdParam string) (model.PolicyDnsForwarderZone, error) + + // Paginated list of all Dns Forwarder Zones + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyDnsForwarderZoneListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyDnsForwarderZoneListResult, error) + + // Create or update the DNS Forwarder Zone + // + // @param dnsForwarderZoneIdParam DNS Forwarder Zone ID (required) + // @param policyDnsForwarderZoneParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(dnsForwarderZoneIdParam string, policyDnsForwarderZoneParam model.PolicyDnsForwarderZone) error + + // Create or update the DNS Forwarder Zone + // + // @param dnsForwarderZoneIdParam DNS Forwarder Zone ID (required) + // @param policyDnsForwarderZoneParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyDnsForwarderZone + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(dnsForwarderZoneIdParam string, policyDnsForwarderZoneParam model.PolicyDnsForwarderZone) (model.PolicyDnsForwarderZone, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsForwarderZonesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsForwarderZonesTypes.go new file mode 100644 index 000000000..acf742581 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsForwarderZonesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: DnsForwarderZones. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func dnsForwarderZonesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_forwarder_zone_id"] = bindings.NewStringType() + fieldNameMap["dns_forwarder_zone_id"] = "DnsForwarderZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderZonesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsForwarderZonesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dns_forwarder_zone_id"] = bindings.NewStringType() + fieldNameMap["dns_forwarder_zone_id"] = "DnsForwarderZoneId" + paramsTypeMap["dns_forwarder_zone_id"] = bindings.NewStringType() + paramsTypeMap["dnsForwarderZoneId"] = bindings.NewStringType() + pathParams["dns_forwarder_zone_id"] = "dnsForwarderZoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/dns-forwarder-zones/{dnsForwarderZoneId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderZonesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_forwarder_zone_id"] = bindings.NewStringType() + fieldNameMap["dns_forwarder_zone_id"] = "DnsForwarderZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderZonesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDnsForwarderZoneBindingType) +} + +func dnsForwarderZonesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dns_forwarder_zone_id"] = bindings.NewStringType() + fieldNameMap["dns_forwarder_zone_id"] = "DnsForwarderZoneId" + paramsTypeMap["dns_forwarder_zone_id"] = bindings.NewStringType() + paramsTypeMap["dnsForwarderZoneId"] = bindings.NewStringType() + pathParams["dns_forwarder_zone_id"] = "dnsForwarderZoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/dns-forwarder-zones/{dnsForwarderZoneId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderZonesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderZonesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDnsForwarderZoneListResultBindingType) +} + +func dnsForwarderZonesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/dns-forwarder-zones", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderZonesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_forwarder_zone_id"] = bindings.NewStringType() + fields["policy_dns_forwarder_zone"] = bindings.NewReferenceType(model.PolicyDnsForwarderZoneBindingType) + fieldNameMap["dns_forwarder_zone_id"] = "DnsForwarderZoneId" + fieldNameMap["policy_dns_forwarder_zone"] = "PolicyDnsForwarderZone" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderZonesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsForwarderZonesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dns_forwarder_zone_id"] = bindings.NewStringType() + fields["policy_dns_forwarder_zone"] = bindings.NewReferenceType(model.PolicyDnsForwarderZoneBindingType) + fieldNameMap["dns_forwarder_zone_id"] = "DnsForwarderZoneId" + fieldNameMap["policy_dns_forwarder_zone"] = "PolicyDnsForwarderZone" + paramsTypeMap["dns_forwarder_zone_id"] = bindings.NewStringType() + paramsTypeMap["policy_dns_forwarder_zone"] = bindings.NewReferenceType(model.PolicyDnsForwarderZoneBindingType) + paramsTypeMap["dnsForwarderZoneId"] = bindings.NewStringType() + pathParams["dns_forwarder_zone_id"] = "dnsForwarderZoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_dns_forwarder_zone", + "PATCH", + "/global-manager/api/v1/global-infra/dns-forwarder-zones/{dnsForwarderZoneId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderZonesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_forwarder_zone_id"] = bindings.NewStringType() + fields["policy_dns_forwarder_zone"] = bindings.NewReferenceType(model.PolicyDnsForwarderZoneBindingType) + fieldNameMap["dns_forwarder_zone_id"] = "DnsForwarderZoneId" + fieldNameMap["policy_dns_forwarder_zone"] = "PolicyDnsForwarderZone" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderZonesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDnsForwarderZoneBindingType) +} + +func dnsForwarderZonesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dns_forwarder_zone_id"] = bindings.NewStringType() + fields["policy_dns_forwarder_zone"] = bindings.NewReferenceType(model.PolicyDnsForwarderZoneBindingType) + fieldNameMap["dns_forwarder_zone_id"] = "DnsForwarderZoneId" + fieldNameMap["policy_dns_forwarder_zone"] = "PolicyDnsForwarderZone" + paramsTypeMap["dns_forwarder_zone_id"] = bindings.NewStringType() + paramsTypeMap["policy_dns_forwarder_zone"] = bindings.NewReferenceType(model.PolicyDnsForwarderZoneBindingType) + paramsTypeMap["dnsForwarderZoneId"] = bindings.NewStringType() + pathParams["dns_forwarder_zone_id"] = "dnsForwarderZoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_dns_forwarder_zone", + "PUT", + "/global-manager/api/v1/global-infra/dns-forwarder-zones/{dnsForwarderZoneId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsSecurityProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsSecurityProfilesClient.go new file mode 100644 index 000000000..bb31f2e3f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsSecurityProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: DnsSecurityProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DnsSecurityProfilesClient interface { + + // Delete DNS security profile + // + // @param profileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(profileIdParam string) error + + // Read the DNS Forwarder for the given tier-0 instance + // + // @param profileIdParam (required) + // @return com.vmware.nsx_global_policy.model.DnsSecurityProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(profileIdParam string) (model.DnsSecurityProfile, error) + + // List all DNS security profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.DnsSecurityProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DnsSecurityProfileListResult, error) + + // Create or update DNS security profile + // + // @param profileIdParam (required) + // @param dnsSecurityProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(profileIdParam string, dnsSecurityProfileParam model.DnsSecurityProfile) error + + // Create or update DNS security profile + // + // @param profileIdParam (required) + // @param dnsSecurityProfileParam (required) + // @return com.vmware.nsx_global_policy.model.DnsSecurityProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(profileIdParam string, dnsSecurityProfileParam model.DnsSecurityProfile) (model.DnsSecurityProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsSecurityProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsSecurityProfilesTypes.go new file mode 100644 index 000000000..2cb58b05c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DnsSecurityProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: DnsSecurityProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func dnsSecurityProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsSecurityProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsSecurityProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/dns-security-profiles/{profileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsSecurityProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsSecurityProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsSecurityProfileBindingType) +} + +func dnsSecurityProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/dns-security-profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsSecurityProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsSecurityProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsSecurityProfileListResultBindingType) +} + +func dnsSecurityProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/dns-security-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsSecurityProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fields["dns_security_profile"] = bindings.NewReferenceType(model.DnsSecurityProfileBindingType) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["dns_security_profile"] = "DnsSecurityProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsSecurityProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsSecurityProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fields["dns_security_profile"] = bindings.NewReferenceType(model.DnsSecurityProfileBindingType) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["dns_security_profile"] = "DnsSecurityProfile" + paramsTypeMap["dns_security_profile"] = bindings.NewReferenceType(model.DnsSecurityProfileBindingType) + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dns_security_profile", + "PATCH", + "/global-manager/api/v1/global-infra/dns-security-profiles/{profileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsSecurityProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fields["dns_security_profile"] = bindings.NewReferenceType(model.DnsSecurityProfileBindingType) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["dns_security_profile"] = "DnsSecurityProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsSecurityProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsSecurityProfileBindingType) +} + +func dnsSecurityProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fields["dns_security_profile"] = bindings.NewReferenceType(model.DnsSecurityProfileBindingType) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["dns_security_profile"] = "DnsSecurityProfile" + paramsTypeMap["dns_security_profile"] = bindings.NewReferenceType(model.DnsSecurityProfileBindingType) + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dns_security_profile", + "PUT", + "/global-manager/api/v1/global-infra/dns-security-profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DomainsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DomainsClient.go new file mode 100644 index 000000000..96abe32e0 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DomainsClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Domains + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DomainsClient interface { + + // Delete the domain along with all the entities contained by this domain. The groups that are a part of this domain are also deleted along with the domain. + // + // @param domainIdParam Domain ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(domainIdParam string) error + + // Read a domain. + // + // @param domainIdParam Domain ID (required) + // @return com.vmware.nsx_global_policy.model.Domain + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string) (model.Domain, error) + + // Paginated list of all domains for infra. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.DomainListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DomainListResult, error) + + // If a domain with the domain-id is not already present, create a new domain. If it already exists, patch the domain + // + // @param domainIdParam Domain ID (required) + // @param domainParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(domainIdParam string, domainParam model.Domain) error + + // If a domain with the domain-id is not already present, create a new domain. If it already exists, update the domain including the nested groups. This is a full replace + // + // @param domainIdParam Domain ID (required) + // @param domainParam (required) + // @return com.vmware.nsx_global_policy.model.Domain + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(domainIdParam string, domainParam model.Domain) (model.Domain, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DomainsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DomainsTypes.go new file mode 100644 index 000000000..822b4a676 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DomainsTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Domains. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func domainsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func domainsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/domains/{domainId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DomainBindingType) +} + +func domainsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DomainListResultBindingType) +} + +func domainsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["domain"] = bindings.NewReferenceType(model.DomainBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain"] = "Domain" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func domainsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["domain"] = bindings.NewReferenceType(model.DomainBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain"] = "Domain" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domain"] = bindings.NewReferenceType(model.DomainBindingType) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "domain", + "PATCH", + "/global-manager/api/v1/global-infra/domains/{domainId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["domain"] = bindings.NewReferenceType(model.DomainBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain"] = "Domain" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DomainBindingType) +} + +func domainsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["domain"] = bindings.NewReferenceType(model.DomainBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain"] = "Domain" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domain"] = bindings.NewReferenceType(model.DomainBindingType) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "domain", + "PUT", + "/global-manager/api/v1/global-infra/domains/{domainId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DraftsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DraftsClient.go new file mode 100644 index 000000000..8c213c78e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DraftsClient.go @@ -0,0 +1,90 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Drafts + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DraftsClient interface { + + // Delete a manual draft. + // + // @param draftIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(draftIdParam string) error + + // Read a draft for a given draft identifier. + // + // @param draftIdParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyDraft + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(draftIdParam string) (model.PolicyDraft, error) + + // List policy drafts. + // + // @param autoDraftsParam Fetch list of draft based on is_auto_draft flag (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyDraftListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(autoDraftsParam *bool, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyDraftListResult, error) + + // Create a new manual draft if the specified draft id does not correspond to an existing draft. Update the manual draft otherwise. Auto draft can not be updated. + // + // @param draftIdParam (required) + // @param policyDraftParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(draftIdParam string, policyDraftParam model.PolicyDraft) error + + // Read a draft and publish it by applying changes onto current configuration. + // + // @param draftIdParam (required) + // @param infraParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Publish(draftIdParam string, infraParam model.Infra) error + + // Create a new manual draft if the specified draft id does not correspond to an existing draft. Update the manual draft otherwise. Auto draft can not be updated. + // + // @param draftIdParam (required) + // @param policyDraftParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyDraft + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(draftIdParam string, policyDraftParam model.PolicyDraft) (model.PolicyDraft, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DraftsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DraftsTypes.go new file mode 100644 index 000000000..0c140f2f9 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/DraftsTypes.go @@ -0,0 +1,377 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Drafts. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func draftsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["draft_id"] = bindings.NewStringType() + fieldNameMap["draft_id"] = "DraftId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func draftsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func draftsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["draft_id"] = bindings.NewStringType() + fieldNameMap["draft_id"] = "DraftId" + paramsTypeMap["draft_id"] = bindings.NewStringType() + paramsTypeMap["draftId"] = bindings.NewStringType() + pathParams["draft_id"] = "draftId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/drafts/{draftId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func draftsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["draft_id"] = bindings.NewStringType() + fieldNameMap["draft_id"] = "DraftId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func draftsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDraftBindingType) +} + +func draftsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["draft_id"] = bindings.NewStringType() + fieldNameMap["draft_id"] = "DraftId" + paramsTypeMap["draft_id"] = bindings.NewStringType() + paramsTypeMap["draftId"] = bindings.NewStringType() + pathParams["draft_id"] = "draftId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/drafts/{draftId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func draftsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["auto_drafts"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["auto_drafts"] = "AutoDrafts" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func draftsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDraftListResultBindingType) +} + +func draftsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["auto_drafts"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["auto_drafts"] = "AutoDrafts" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["auto_drafts"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["auto_drafts"] = "auto_drafts" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/drafts", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func draftsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["draft_id"] = bindings.NewStringType() + fields["policy_draft"] = bindings.NewReferenceType(model.PolicyDraftBindingType) + fieldNameMap["draft_id"] = "DraftId" + fieldNameMap["policy_draft"] = "PolicyDraft" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func draftsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func draftsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["draft_id"] = bindings.NewStringType() + fields["policy_draft"] = bindings.NewReferenceType(model.PolicyDraftBindingType) + fieldNameMap["draft_id"] = "DraftId" + fieldNameMap["policy_draft"] = "PolicyDraft" + paramsTypeMap["policy_draft"] = bindings.NewReferenceType(model.PolicyDraftBindingType) + paramsTypeMap["draft_id"] = bindings.NewStringType() + paramsTypeMap["draftId"] = bindings.NewStringType() + pathParams["draft_id"] = "draftId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_draft", + "PATCH", + "/global-manager/api/v1/global-infra/drafts/{draftId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func draftsPublishInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["draft_id"] = bindings.NewStringType() + fields["infra"] = bindings.NewReferenceType(model.InfraBindingType) + fieldNameMap["draft_id"] = "DraftId" + fieldNameMap["infra"] = "Infra" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func draftsPublishOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func draftsPublishRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["draft_id"] = bindings.NewStringType() + fields["infra"] = bindings.NewReferenceType(model.InfraBindingType) + fieldNameMap["draft_id"] = "DraftId" + fieldNameMap["infra"] = "Infra" + paramsTypeMap["draft_id"] = bindings.NewStringType() + paramsTypeMap["infra"] = bindings.NewReferenceType(model.InfraBindingType) + paramsTypeMap["draftId"] = bindings.NewStringType() + pathParams["draft_id"] = "draftId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=publish", + "infra", + "POST", + "/global-manager/api/v1/global-infra/drafts/{draftId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func draftsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["draft_id"] = bindings.NewStringType() + fields["policy_draft"] = bindings.NewReferenceType(model.PolicyDraftBindingType) + fieldNameMap["draft_id"] = "DraftId" + fieldNameMap["policy_draft"] = "PolicyDraft" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func draftsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDraftBindingType) +} + +func draftsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["draft_id"] = bindings.NewStringType() + fields["policy_draft"] = bindings.NewReferenceType(model.PolicyDraftBindingType) + fieldNameMap["draft_id"] = "DraftId" + fieldNameMap["policy_draft"] = "PolicyDraft" + paramsTypeMap["policy_draft"] = bindings.NewReferenceType(model.PolicyDraftBindingType) + paramsTypeMap["draft_id"] = bindings.NewStringType() + paramsTypeMap["draftId"] = bindings.NewStringType() + pathParams["draft_id"] = "draftId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_draft", + "PUT", + "/global-manager/api/v1/global-infra/drafts/{draftId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FederationConfigClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FederationConfigClient.go new file mode 100644 index 000000000..ec6702b48 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FederationConfigClient.go @@ -0,0 +1,27 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FederationConfig + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type FederationConfigClient interface { + + // Read a federation config from Global Manager. + // @return com.vmware.nsx_global_policy.model.FederationConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.FederationConfig, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FederationConfigTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FederationConfigTypes.go new file mode 100644 index 000000000..be4822066 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FederationConfigTypes.go @@ -0,0 +1,70 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FederationConfig. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func federationConfigGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func federationConfigGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FederationConfigBindingType) +} + +func federationConfigGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/federation-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSchedulersClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSchedulersClient.go new file mode 100644 index 000000000..efb1daa42 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSchedulersClient.go @@ -0,0 +1,79 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FirewallSchedulers + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type FirewallSchedulersClient interface { + + // Deletes the specified PolicyFirewallScheduler. If scheduler is consumed in a security policy, it won't get deleted. + // + // @param firewallSchedulerIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(firewallSchedulerIdParam string, forceParam *bool) error + + // Get a PolicyFirewallScheduler by id + // + // @param firewallSchedulerIdParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyFirewallScheduler + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(firewallSchedulerIdParam string) (model.PolicyFirewallScheduler, error) + + // Get all PolicyFirewallSchedulers + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyFirewallSchedulerListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyFirewallSchedulerListResult, error) + + // Creates/Updates a PolicyFirewallScheduler, which can be set at security policy. Note that at least one property out of \"days\", \"start_date\", \"time_interval\", \"end_date\" is required if \"recurring\" field is true. Also \"start_time\" and \"end_time\" should not be present. And if \"recurring\" field is false then \"start_date\" and \"end_date\" is mandatory, \"start_time\" and \"end_time\" is optional. Also the fields \"days\" and \"time_interval\" should not be present. + // + // @param firewallSchedulerIdParam (required) + // @param policyFirewallSchedulerParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(firewallSchedulerIdParam string, policyFirewallSchedulerParam model.PolicyFirewallScheduler) error + + // Updates a PolicyFirewallScheduler, which can be set at security policy. Note that at least one property out of \"days\", \"start_date\", \"time_interval\", \"end_date\" is required if \"recurring\" field is true. Also \"start_time\" and \"end_time\" should not be present. And if \"recurring\" field is false then \"start_date\" and \"end_date\" is mandatory, \"start_time\" and \"end_time\" is optional. Also the fields \"days\" and \"time_interval\" should not be present. + // + // @param firewallSchedulerIdParam (required) + // @param policyFirewallSchedulerParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyFirewallScheduler + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(firewallSchedulerIdParam string, policyFirewallSchedulerParam model.PolicyFirewallScheduler) (model.PolicyFirewallScheduler, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSchedulersTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSchedulersTypes.go new file mode 100644 index 000000000..b08ef3e67 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSchedulersTypes.go @@ -0,0 +1,322 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FirewallSchedulers. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func firewallSchedulersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_scheduler_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["firewall_scheduler_id"] = "FirewallSchedulerId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSchedulersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func firewallSchedulersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_scheduler_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["firewall_scheduler_id"] = "FirewallSchedulerId" + fieldNameMap["force"] = "Force" + paramsTypeMap["firewall_scheduler_id"] = bindings.NewStringType() + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["firewallSchedulerId"] = bindings.NewStringType() + pathParams["firewall_scheduler_id"] = "firewallSchedulerId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/firewall-schedulers/{firewallSchedulerId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func firewallSchedulersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_scheduler_id"] = bindings.NewStringType() + fieldNameMap["firewall_scheduler_id"] = "FirewallSchedulerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSchedulersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyFirewallSchedulerBindingType) +} + +func firewallSchedulersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_scheduler_id"] = bindings.NewStringType() + fieldNameMap["firewall_scheduler_id"] = "FirewallSchedulerId" + paramsTypeMap["firewall_scheduler_id"] = bindings.NewStringType() + paramsTypeMap["firewallSchedulerId"] = bindings.NewStringType() + pathParams["firewall_scheduler_id"] = "firewallSchedulerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/firewall-schedulers/{firewallSchedulerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func firewallSchedulersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSchedulersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyFirewallSchedulerListResultBindingType) +} + +func firewallSchedulersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/firewall-schedulers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func firewallSchedulersPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_scheduler_id"] = bindings.NewStringType() + fields["policy_firewall_scheduler"] = bindings.NewReferenceType(model.PolicyFirewallSchedulerBindingType) + fieldNameMap["firewall_scheduler_id"] = "FirewallSchedulerId" + fieldNameMap["policy_firewall_scheduler"] = "PolicyFirewallScheduler" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSchedulersPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func firewallSchedulersPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_scheduler_id"] = bindings.NewStringType() + fields["policy_firewall_scheduler"] = bindings.NewReferenceType(model.PolicyFirewallSchedulerBindingType) + fieldNameMap["firewall_scheduler_id"] = "FirewallSchedulerId" + fieldNameMap["policy_firewall_scheduler"] = "PolicyFirewallScheduler" + paramsTypeMap["policy_firewall_scheduler"] = bindings.NewReferenceType(model.PolicyFirewallSchedulerBindingType) + paramsTypeMap["firewall_scheduler_id"] = bindings.NewStringType() + paramsTypeMap["firewallSchedulerId"] = bindings.NewStringType() + pathParams["firewall_scheduler_id"] = "firewallSchedulerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_firewall_scheduler", + "PATCH", + "/global-manager/api/v1/global-infra/firewall-schedulers/{firewallSchedulerId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func firewallSchedulersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_scheduler_id"] = bindings.NewStringType() + fields["policy_firewall_scheduler"] = bindings.NewReferenceType(model.PolicyFirewallSchedulerBindingType) + fieldNameMap["firewall_scheduler_id"] = "FirewallSchedulerId" + fieldNameMap["policy_firewall_scheduler"] = "PolicyFirewallScheduler" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSchedulersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyFirewallSchedulerBindingType) +} + +func firewallSchedulersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_scheduler_id"] = bindings.NewStringType() + fields["policy_firewall_scheduler"] = bindings.NewReferenceType(model.PolicyFirewallSchedulerBindingType) + fieldNameMap["firewall_scheduler_id"] = "FirewallSchedulerId" + fieldNameMap["policy_firewall_scheduler"] = "PolicyFirewallScheduler" + paramsTypeMap["policy_firewall_scheduler"] = bindings.NewReferenceType(model.PolicyFirewallSchedulerBindingType) + paramsTypeMap["firewall_scheduler_id"] = bindings.NewStringType() + paramsTypeMap["firewallSchedulerId"] = bindings.NewStringType() + pathParams["firewall_scheduler_id"] = "firewallSchedulerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_firewall_scheduler", + "PUT", + "/global-manager/api/v1/global-infra/firewall-schedulers/{firewallSchedulerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSessionTimerProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSessionTimerProfilesClient.go new file mode 100644 index 000000000..9c11fb77b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSessionTimerProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FirewallSessionTimerProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type FirewallSessionTimerProfilesClient interface { + + // API will delete Firewall Session Timer Profile + // + // @param firewallSessionTimerProfileIdParam Firewall Session Timer Profile ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(firewallSessionTimerProfileIdParam string) error + + // API will get Firewall Session Timer Profile + // + // @param firewallSessionTimerProfileIdParam Firewall Session Timer Profile ID (required) + // @return com.vmware.nsx_global_policy.model.PolicyFirewallSessionTimerProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(firewallSessionTimerProfileIdParam string) (model.PolicyFirewallSessionTimerProfile, error) + + // API will list all Firewall Session Timer Profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyFirewallSessionTimerProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyFirewallSessionTimerProfileListResult, error) + + // API will create/update Firewall Session Timer Profile + // + // @param firewallSessionTimerProfileIdParam Firewall Session Timer Profile ID (required) + // @param policyFirewallSessionTimerProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(firewallSessionTimerProfileIdParam string, policyFirewallSessionTimerProfileParam model.PolicyFirewallSessionTimerProfile) error + + // API will update Firewall Session Timer Profile + // + // @param firewallSessionTimerProfileIdParam Firewall Session Timer Profile ID (required) + // @param policyFirewallSessionTimerProfileParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyFirewallSessionTimerProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(firewallSessionTimerProfileIdParam string, policyFirewallSessionTimerProfileParam model.PolicyFirewallSessionTimerProfile) (model.PolicyFirewallSessionTimerProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSessionTimerProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSessionTimerProfilesTypes.go new file mode 100644 index 000000000..e8444d444 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FirewallSessionTimerProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FirewallSessionTimerProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func firewallSessionTimerProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_session_timer_profile_id"] = bindings.NewStringType() + fieldNameMap["firewall_session_timer_profile_id"] = "FirewallSessionTimerProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSessionTimerProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func firewallSessionTimerProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_session_timer_profile_id"] = bindings.NewStringType() + fieldNameMap["firewall_session_timer_profile_id"] = "FirewallSessionTimerProfileId" + paramsTypeMap["firewall_session_timer_profile_id"] = bindings.NewStringType() + paramsTypeMap["firewallSessionTimerProfileId"] = bindings.NewStringType() + pathParams["firewall_session_timer_profile_id"] = "firewallSessionTimerProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/firewall-session-timer-profiles/{firewallSessionTimerProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func firewallSessionTimerProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_session_timer_profile_id"] = bindings.NewStringType() + fieldNameMap["firewall_session_timer_profile_id"] = "FirewallSessionTimerProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSessionTimerProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingType) +} + +func firewallSessionTimerProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_session_timer_profile_id"] = bindings.NewStringType() + fieldNameMap["firewall_session_timer_profile_id"] = "FirewallSessionTimerProfileId" + paramsTypeMap["firewall_session_timer_profile_id"] = bindings.NewStringType() + paramsTypeMap["firewallSessionTimerProfileId"] = bindings.NewStringType() + pathParams["firewall_session_timer_profile_id"] = "firewallSessionTimerProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/firewall-session-timer-profiles/{firewallSessionTimerProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func firewallSessionTimerProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSessionTimerProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileListResultBindingType) +} + +func firewallSessionTimerProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/firewall-session-timer-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func firewallSessionTimerProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_session_timer_profile_id"] = bindings.NewStringType() + fields["policy_firewall_session_timer_profile"] = bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingType) + fieldNameMap["firewall_session_timer_profile_id"] = "FirewallSessionTimerProfileId" + fieldNameMap["policy_firewall_session_timer_profile"] = "PolicyFirewallSessionTimerProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSessionTimerProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func firewallSessionTimerProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_session_timer_profile_id"] = bindings.NewStringType() + fields["policy_firewall_session_timer_profile"] = bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingType) + fieldNameMap["firewall_session_timer_profile_id"] = "FirewallSessionTimerProfileId" + fieldNameMap["policy_firewall_session_timer_profile"] = "PolicyFirewallSessionTimerProfile" + paramsTypeMap["firewall_session_timer_profile_id"] = bindings.NewStringType() + paramsTypeMap["policy_firewall_session_timer_profile"] = bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingType) + paramsTypeMap["firewallSessionTimerProfileId"] = bindings.NewStringType() + pathParams["firewall_session_timer_profile_id"] = "firewallSessionTimerProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_firewall_session_timer_profile", + "PATCH", + "/global-manager/api/v1/global-infra/firewall-session-timer-profiles/{firewallSessionTimerProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func firewallSessionTimerProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_session_timer_profile_id"] = bindings.NewStringType() + fields["policy_firewall_session_timer_profile"] = bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingType) + fieldNameMap["firewall_session_timer_profile_id"] = "FirewallSessionTimerProfileId" + fieldNameMap["policy_firewall_session_timer_profile"] = "PolicyFirewallSessionTimerProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSessionTimerProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingType) +} + +func firewallSessionTimerProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_session_timer_profile_id"] = bindings.NewStringType() + fields["policy_firewall_session_timer_profile"] = bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingType) + fieldNameMap["firewall_session_timer_profile_id"] = "FirewallSessionTimerProfileId" + fieldNameMap["policy_firewall_session_timer_profile"] = "PolicyFirewallSessionTimerProfile" + paramsTypeMap["firewall_session_timer_profile_id"] = bindings.NewStringType() + paramsTypeMap["policy_firewall_session_timer_profile"] = bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingType) + paramsTypeMap["firewallSessionTimerProfileId"] = bindings.NewStringType() + pathParams["firewall_session_timer_profile_id"] = "firewallSessionTimerProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_firewall_session_timer_profile", + "PUT", + "/global-manager/api/v1/global-infra/firewall-session-timer-profiles/{firewallSessionTimerProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FloodProtectionProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FloodProtectionProfilesClient.go new file mode 100644 index 000000000..b232a10eb --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FloodProtectionProfilesClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FloodProtectionProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" +) + +type FloodProtectionProfilesClient interface { + + // API will delete Flood Protection Profile + // + // @param floodProtectionProfileIdParam Flood Protection Profile ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(floodProtectionProfileIdParam string) error + + // API will get Flood Protection Profile + // + // @param floodProtectionProfileIdParam Flood Protection Profile ID (required) + // @return com.vmware.nsx_global_policy.model.FloodProtectionProfile + // The return value will contain all the properties defined in model.FloodProtectionProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(floodProtectionProfileIdParam string) (*data.StructValue, error) + + // API will list all Flood Protection Profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.FloodProtectionProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.FloodProtectionProfileListResult, error) + + // API will create/update Flood Protection Profile + // + // @param floodProtectionProfileIdParam Firewall Flood Protection Profile ID (required) + // @param floodProtectionProfileParam (required) + // The parameter must contain all the properties defined in model.FloodProtectionProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(floodProtectionProfileIdParam string, floodProtectionProfileParam *data.StructValue) error + + // API will update Firewall Flood Protection Profile + // + // @param floodProtectionProfileIdParam Flood Protection Profile ID (required) + // @param floodProtectionProfileParam (required) + // The parameter must contain all the properties defined in model.FloodProtectionProfile. + // @return com.vmware.nsx_global_policy.model.FloodProtectionProfile + // The return value will contain all the properties defined in model.FloodProtectionProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(floodProtectionProfileIdParam string, floodProtectionProfileParam *data.StructValue) (*data.StructValue, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FloodProtectionProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FloodProtectionProfilesTypes.go new file mode 100644 index 000000000..b18caf6e3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FloodProtectionProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FloodProtectionProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func floodProtectionProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["flood_protection_profile_id"] = bindings.NewStringType() + fieldNameMap["flood_protection_profile_id"] = "FloodProtectionProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func floodProtectionProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["flood_protection_profile_id"] = bindings.NewStringType() + fieldNameMap["flood_protection_profile_id"] = "FloodProtectionProfileId" + paramsTypeMap["flood_protection_profile_id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileId"] = bindings.NewStringType() + pathParams["flood_protection_profile_id"] = "floodProtectionProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/flood-protection-profiles/{floodProtectionProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["flood_protection_profile_id"] = bindings.NewStringType() + fieldNameMap["flood_protection_profile_id"] = "FloodProtectionProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.FloodProtectionProfileBindingType),}, bindings.REST) +} + +func floodProtectionProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["flood_protection_profile_id"] = bindings.NewStringType() + fieldNameMap["flood_protection_profile_id"] = "FloodProtectionProfileId" + paramsTypeMap["flood_protection_profile_id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileId"] = bindings.NewStringType() + pathParams["flood_protection_profile_id"] = "floodProtectionProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/flood-protection-profiles/{floodProtectionProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FloodProtectionProfileListResultBindingType) +} + +func floodProtectionProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/flood-protection-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["flood_protection_profile_id"] = bindings.NewStringType() + fields["flood_protection_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.FloodProtectionProfileBindingType),}, bindings.REST) + fieldNameMap["flood_protection_profile_id"] = "FloodProtectionProfileId" + fieldNameMap["flood_protection_profile"] = "FloodProtectionProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func floodProtectionProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["flood_protection_profile_id"] = bindings.NewStringType() + fields["flood_protection_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.FloodProtectionProfileBindingType),}, bindings.REST) + fieldNameMap["flood_protection_profile_id"] = "FloodProtectionProfileId" + fieldNameMap["flood_protection_profile"] = "FloodProtectionProfile" + paramsTypeMap["flood_protection_profile_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.FloodProtectionProfileBindingType),}, bindings.REST) + paramsTypeMap["floodProtectionProfileId"] = bindings.NewStringType() + pathParams["flood_protection_profile_id"] = "floodProtectionProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "flood_protection_profile", + "PATCH", + "/global-manager/api/v1/global-infra/flood-protection-profiles/{floodProtectionProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["flood_protection_profile_id"] = bindings.NewStringType() + fields["flood_protection_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.FloodProtectionProfileBindingType),}, bindings.REST) + fieldNameMap["flood_protection_profile_id"] = "FloodProtectionProfileId" + fieldNameMap["flood_protection_profile"] = "FloodProtectionProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.FloodProtectionProfileBindingType),}, bindings.REST) +} + +func floodProtectionProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["flood_protection_profile_id"] = bindings.NewStringType() + fields["flood_protection_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.FloodProtectionProfileBindingType),}, bindings.REST) + fieldNameMap["flood_protection_profile_id"] = "FloodProtectionProfileId" + fieldNameMap["flood_protection_profile"] = "FloodProtectionProfile" + paramsTypeMap["flood_protection_profile_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.FloodProtectionProfileBindingType),}, bindings.REST) + paramsTypeMap["floodProtectionProfileId"] = bindings.NewStringType() + pathParams["flood_protection_profile_id"] = "floodProtectionProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "flood_protection_profile", + "PUT", + "/global-manager/api/v1/global-infra/flood-protection-profiles/{floodProtectionProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FullSyncStatesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FullSyncStatesClient.go new file mode 100644 index 000000000..7e9329984 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FullSyncStatesClient.go @@ -0,0 +1,45 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FullSyncStates + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type FullSyncStatesClient interface { + + // Get full sync state. + // + // @param fullSyncIdParam (required) + // @return com.vmware.nsx_global_policy.model.FullSyncState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(fullSyncIdParam string) (model.FullSyncState, error) + + // List full sync state. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.FullSyncStateListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.FullSyncStateListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FullSyncStatesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FullSyncStatesTypes.go new file mode 100644 index 000000000..56993701d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/FullSyncStatesTypes.go @@ -0,0 +1,156 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FullSyncStates. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func fullSyncStatesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["full_sync_id"] = bindings.NewStringType() + fieldNameMap["full_sync_id"] = "FullSyncId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func fullSyncStatesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FullSyncStateBindingType) +} + +func fullSyncStatesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["full_sync_id"] = bindings.NewStringType() + fieldNameMap["full_sync_id"] = "FullSyncId" + paramsTypeMap["full_sync_id"] = bindings.NewStringType() + paramsTypeMap["fullSyncId"] = bindings.NewStringType() + pathParams["full_sync_id"] = "fullSyncId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/full-sync-states/{fullSyncId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func fullSyncStatesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func fullSyncStatesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FullSyncStateListResultBindingType) +} + +func fullSyncStatesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/full-sync-states", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GatewayQosProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GatewayQosProfilesClient.go new file mode 100644 index 000000000..c33a8f60f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GatewayQosProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GatewayQosProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GatewayQosProfilesClient interface { + + // Delete QoS profile + // + // @param qosProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(qosProfileIdParam string) error + + // Read gateway QoS profile + // + // @param qosProfileIdParam (required) + // @return com.vmware.nsx_global_policy.model.GatewayQosProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(qosProfileIdParam string) (model.GatewayQosProfile, error) + + // Paginated list of all gateway QoS profle instances + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.GatewayQosProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.GatewayQosProfileListResult, error) + + // If profile with the qos-profile-id is not already present, create a new gateway QoS profile instance. If it already exists, update the gateway QoS profile instance with specified attributes. + // + // @param qosProfileIdParam (required) + // @param gatewayQosProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(qosProfileIdParam string, gatewayQosProfileParam model.GatewayQosProfile) error + + // If profile with the qos-profile-id is not already present, create a new gateway QoS profile instance. If it already exists, replace the gateway QoS profile instance with this object. + // + // @param qosProfileIdParam (required) + // @param gatewayQosProfileParam (required) + // @return com.vmware.nsx_global_policy.model.GatewayQosProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(qosProfileIdParam string, gatewayQosProfileParam model.GatewayQosProfile) (model.GatewayQosProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GatewayQosProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GatewayQosProfilesTypes.go new file mode 100644 index 000000000..842d3b032 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GatewayQosProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GatewayQosProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func gatewayQosProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["qos_profile_id"] = bindings.NewStringType() + fieldNameMap["qos_profile_id"] = "QosProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayQosProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func gatewayQosProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["qos_profile_id"] = bindings.NewStringType() + fieldNameMap["qos_profile_id"] = "QosProfileId" + paramsTypeMap["qos_profile_id"] = bindings.NewStringType() + paramsTypeMap["qosProfileId"] = bindings.NewStringType() + pathParams["qos_profile_id"] = "qosProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/gateway-qos-profiles/{qosProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayQosProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["qos_profile_id"] = bindings.NewStringType() + fieldNameMap["qos_profile_id"] = "QosProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayQosProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayQosProfileBindingType) +} + +func gatewayQosProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["qos_profile_id"] = bindings.NewStringType() + fieldNameMap["qos_profile_id"] = "QosProfileId" + paramsTypeMap["qos_profile_id"] = bindings.NewStringType() + paramsTypeMap["qosProfileId"] = bindings.NewStringType() + pathParams["qos_profile_id"] = "qosProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/gateway-qos-profiles/{qosProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayQosProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayQosProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayQosProfileListResultBindingType) +} + +func gatewayQosProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/gateway-qos-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayQosProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["qos_profile_id"] = bindings.NewStringType() + fields["gateway_qos_profile"] = bindings.NewReferenceType(model.GatewayQosProfileBindingType) + fieldNameMap["qos_profile_id"] = "QosProfileId" + fieldNameMap["gateway_qos_profile"] = "GatewayQosProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayQosProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func gatewayQosProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["qos_profile_id"] = bindings.NewStringType() + fields["gateway_qos_profile"] = bindings.NewReferenceType(model.GatewayQosProfileBindingType) + fieldNameMap["qos_profile_id"] = "QosProfileId" + fieldNameMap["gateway_qos_profile"] = "GatewayQosProfile" + paramsTypeMap["qos_profile_id"] = bindings.NewStringType() + paramsTypeMap["gateway_qos_profile"] = bindings.NewReferenceType(model.GatewayQosProfileBindingType) + paramsTypeMap["qosProfileId"] = bindings.NewStringType() + pathParams["qos_profile_id"] = "qosProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "gateway_qos_profile", + "PATCH", + "/global-manager/api/v1/global-infra/gateway-qos-profiles/{qosProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayQosProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["qos_profile_id"] = bindings.NewStringType() + fields["gateway_qos_profile"] = bindings.NewReferenceType(model.GatewayQosProfileBindingType) + fieldNameMap["qos_profile_id"] = "QosProfileId" + fieldNameMap["gateway_qos_profile"] = "GatewayQosProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayQosProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayQosProfileBindingType) +} + +func gatewayQosProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["qos_profile_id"] = bindings.NewStringType() + fields["gateway_qos_profile"] = bindings.NewReferenceType(model.GatewayQosProfileBindingType) + fieldNameMap["qos_profile_id"] = "QosProfileId" + fieldNameMap["gateway_qos_profile"] = "GatewayQosProfile" + paramsTypeMap["qos_profile_id"] = bindings.NewStringType() + paramsTypeMap["gateway_qos_profile"] = bindings.NewReferenceType(model.GatewayQosProfileBindingType) + paramsTypeMap["qosProfileId"] = bindings.NewStringType() + pathParams["qos_profile_id"] = "qosProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "gateway_qos_profile", + "PUT", + "/global-manager/api/v1/global-infra/gateway-qos-profiles/{qosProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalInfraPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalInfraPackageTypes.go new file mode 100644 index 000000000..b1c253f4e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalInfraPackageTypes.go @@ -0,0 +1,19 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy.global_infra. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + + + + + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagerConfigClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagerConfigClient.go new file mode 100644 index 000000000..ddd058f92 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagerConfigClient.go @@ -0,0 +1,48 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GlobalManagerConfig + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GlobalManagerConfigClient interface { + + // Create or patch a Global Manager Config + // + // @param globalManagerConfigParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(globalManagerConfigParam model.GlobalManagerConfig) error + + // Read a Global Manager config along with sensitive data. For example - rtep_config.ibgp_password + // @return com.vmware.nsx_global_policy.model.GlobalManagerConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Showsensitivedata() (model.GlobalManagerConfig, error) + + // Create or fully replace a Global Manager Config. Revision is optional for creation and required for update. + // + // @param globalManagerConfigParam (required) + // @return com.vmware.nsx_global_policy.model.GlobalManagerConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(globalManagerConfigParam model.GlobalManagerConfig) (model.GlobalManagerConfig, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagerConfigTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagerConfigTypes.go new file mode 100644 index 000000000..64fcbe2a1 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagerConfigTypes.go @@ -0,0 +1,166 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GlobalManagerConfig. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func globalManagerConfigPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_manager_config"] = bindings.NewReferenceType(model.GlobalManagerConfigBindingType) + fieldNameMap["global_manager_config"] = "GlobalManagerConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagerConfigPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func globalManagerConfigPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["global_manager_config"] = bindings.NewReferenceType(model.GlobalManagerConfigBindingType) + fieldNameMap["global_manager_config"] = "GlobalManagerConfig" + paramsTypeMap["global_manager_config"] = bindings.NewReferenceType(model.GlobalManagerConfigBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "global_manager_config", + "PATCH", + "/global-manager/api/v1/global-infra/global-manager-config", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalManagerConfigShowsensitivedataInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagerConfigShowsensitivedataOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GlobalManagerConfigBindingType) +} + +func globalManagerConfigShowsensitivedataRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=show-sensitive-data", + "", + "GET", + "/global-manager/api/v1/global-infra/global-manager-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalManagerConfigUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_manager_config"] = bindings.NewReferenceType(model.GlobalManagerConfigBindingType) + fieldNameMap["global_manager_config"] = "GlobalManagerConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagerConfigUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GlobalManagerConfigBindingType) +} + +func globalManagerConfigUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["global_manager_config"] = bindings.NewReferenceType(model.GlobalManagerConfigBindingType) + fieldNameMap["global_manager_config"] = "GlobalManagerConfig" + paramsTypeMap["global_manager_config"] = bindings.NewReferenceType(model.GlobalManagerConfigBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "global_manager_config", + "PUT", + "/global-manager/api/v1/global-infra/global-manager-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagersClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagersClient.go new file mode 100644 index 000000000..c17c15e55 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagersClient.go @@ -0,0 +1,89 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GlobalManagers + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GlobalManagersClient interface { + + // Switch over from Active to Standby Global Manager. This operation will fail if there is no Standby Global Manager. + // + // @param actionParam Indicates whether it is managed switchover or due to failure (required) + // @return com.vmware.nsx_global_policy.model.GlobalManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(actionParam string) (model.GlobalManager, error) + + // Delete a particular global manager under Infra. Global Manager id 'self' is reserved and can be used for referring to local logged in Global Manager. Example - /infra/global-managers/self + // + // @param globalManagerIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(globalManagerIdParam string) error + + // Retrieve information about a particular configured global manager. Global Manager id 'self' is reserved and can be used for referring to local logged in Global Manager. Example - /infra/global-managers/self + // + // @param globalManagerIdParam (required) + // @return com.vmware.nsx_global_policy.model.GlobalManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(globalManagerIdParam string) (model.GlobalManager, error) + + // List Global Managers under Infra. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.GlobalManagerListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.GlobalManagerListResult, error) + + // Create or patch a Global Manager under Infra. Global Manager id 'self' is reserved and can be used for referring to local logged in Global Manager. Example - /infra/global-managers/self + // + // @param globalManagerIdParam (required) + // @param globalManagerParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(globalManagerIdParam string, globalManagerParam model.GlobalManager) error + + // Create or fully replace Global Manager under Infra. Revision is optional for creation and required for update. Global Manager id 'self' is reserved and can be used for referring to local logged in Global Manager. Example - /infra/global-managers/self + // + // @param globalManagerIdParam (required) + // @param globalManagerParam (required) + // @return com.vmware.nsx_global_policy.model.GlobalManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(globalManagerIdParam string, globalManagerParam model.GlobalManager) (model.GlobalManager, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagersTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagersTypes.go new file mode 100644 index 000000000..81b65abf3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GlobalManagersTypes.go @@ -0,0 +1,369 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GlobalManagers. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``action`` of method GlobalManagers#create. +const GlobalManagers_CREATE_ACTION_MANAGED_SWITCHOVER = "managed_switchover" +// Possible value for ``action`` of method GlobalManagers#create. +const GlobalManagers_CREATE_ACTION_ACTIVE_FAILED = "active_failed" + + + + +func globalManagersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewStringType() + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GlobalManagerBindingType) +} + +func globalManagersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["action"] = bindings.NewStringType() + fieldNameMap["action"] = "Action" + paramsTypeMap["action"] = bindings.NewStringType() + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/global-manager/api/v1/global-infra/global-managers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalManagersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_manager_id"] = bindings.NewStringType() + fieldNameMap["global_manager_id"] = "GlobalManagerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func globalManagersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["global_manager_id"] = bindings.NewStringType() + fieldNameMap["global_manager_id"] = "GlobalManagerId" + paramsTypeMap["global_manager_id"] = bindings.NewStringType() + paramsTypeMap["globalManagerId"] = bindings.NewStringType() + pathParams["global_manager_id"] = "globalManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/global-managers/{globalManagerId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalManagersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_manager_id"] = bindings.NewStringType() + fieldNameMap["global_manager_id"] = "GlobalManagerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GlobalManagerBindingType) +} + +func globalManagersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["global_manager_id"] = bindings.NewStringType() + fieldNameMap["global_manager_id"] = "GlobalManagerId" + paramsTypeMap["global_manager_id"] = bindings.NewStringType() + paramsTypeMap["globalManagerId"] = bindings.NewStringType() + pathParams["global_manager_id"] = "globalManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/global-managers/{globalManagerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalManagersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GlobalManagerListResultBindingType) +} + +func globalManagersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/global-managers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalManagersPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_manager_id"] = bindings.NewStringType() + fields["global_manager"] = bindings.NewReferenceType(model.GlobalManagerBindingType) + fieldNameMap["global_manager_id"] = "GlobalManagerId" + fieldNameMap["global_manager"] = "GlobalManager" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagersPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func globalManagersPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["global_manager_id"] = bindings.NewStringType() + fields["global_manager"] = bindings.NewReferenceType(model.GlobalManagerBindingType) + fieldNameMap["global_manager_id"] = "GlobalManagerId" + fieldNameMap["global_manager"] = "GlobalManager" + paramsTypeMap["global_manager_id"] = bindings.NewStringType() + paramsTypeMap["global_manager"] = bindings.NewReferenceType(model.GlobalManagerBindingType) + paramsTypeMap["globalManagerId"] = bindings.NewStringType() + pathParams["global_manager_id"] = "globalManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "global_manager", + "PATCH", + "/global-manager/api/v1/global-infra/global-managers/{globalManagerId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalManagersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_manager_id"] = bindings.NewStringType() + fields["global_manager"] = bindings.NewReferenceType(model.GlobalManagerBindingType) + fieldNameMap["global_manager_id"] = "GlobalManagerId" + fieldNameMap["global_manager"] = "GlobalManager" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalManagersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GlobalManagerBindingType) +} + +func globalManagersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["global_manager_id"] = bindings.NewStringType() + fields["global_manager"] = bindings.NewReferenceType(model.GlobalManagerBindingType) + fieldNameMap["global_manager_id"] = "GlobalManagerId" + fieldNameMap["global_manager"] = "GlobalManager" + paramsTypeMap["global_manager_id"] = bindings.NewStringType() + paramsTypeMap["global_manager"] = bindings.NewReferenceType(model.GlobalManagerBindingType) + paramsTypeMap["globalManagerId"] = bindings.NewStringType() + pathParams["global_manager_id"] = "globalManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "global_manager", + "PUT", + "/global-manager/api/v1/global-infra/global-managers/{globalManagerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupAssociationsClient.go new file mode 100644 index 000000000..fd809166b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupAssociationsClient.go @@ -0,0 +1,36 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GroupAssociations + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GroupAssociationsClient interface { + + // Get policy groups for which the given object is a member. + // + // @param intentPathParam String path of the intent object (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param enforcementPointPathParam String Path of the enforcement point (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyResourceReferenceForEPListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(intentPathParam string, cursorParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceForEPListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupAssociationsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupAssociationsTypes.go new file mode 100644 index 000000000..1d6329848 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupAssociationsTypes.go @@ -0,0 +1,118 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GroupAssociations. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func groupAssociationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupAssociationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyResourceReferenceForEPListResultBindingType) +} + +func groupAssociationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["intent_path"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["intent_path"] = bindings.NewStringType() + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["intent_path"] = "intent_path" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/group-associations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupServiceAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupServiceAssociationsClient.go new file mode 100644 index 000000000..2d523c65c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupServiceAssociationsClient.go @@ -0,0 +1,35 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GroupServiceAssociations + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GroupServiceAssociationsClient interface { + + // The API returns all the services associated with the given Group. It also returns the services associated with the parent groups of the given group. + // + // @param intentPathParam Path of the entity (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyResourceReferenceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(intentPathParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupServiceAssociationsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupServiceAssociationsTypes.go new file mode 100644 index 000000000..5babbac36 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/GroupServiceAssociationsTypes.go @@ -0,0 +1,112 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GroupServiceAssociations. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func groupServiceAssociationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupServiceAssociationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyResourceReferenceListResultBindingType) +} + +func groupServiceAssociationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["intent_path"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["intent_path"] = bindings.NewStringType() + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["intent_path"] = "intent_path" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/group-service-associations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpAddressGroupAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpAddressGroupAssociationsClient.go new file mode 100644 index 000000000..fe4cf4073 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpAddressGroupAssociationsClient.go @@ -0,0 +1,36 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: IpAddressGroupAssociations + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type IpAddressGroupAssociationsClient interface { + + // Get policy groups for which the given IP address is a member. + // + // @param ipAddressParam IPAddress (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param enforcementPointPathParam String Path of the enforcement point (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyResourceReferenceForEPListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(ipAddressParam string, cursorParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceForEPListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpAddressGroupAssociationsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpAddressGroupAssociationsTypes.go new file mode 100644 index 000000000..c682892cd --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpAddressGroupAssociationsTypes.go @@ -0,0 +1,118 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: IpAddressGroupAssociations. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func ipAddressGroupAssociationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipAddressGroupAssociationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyResourceReferenceForEPListResultBindingType) +} + +func ipAddressGroupAssociationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_address"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["ip_address"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["ip_address"] = "ip_address" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ip-address-group-associations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpDiscoveryProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpDiscoveryProfilesClient.go new file mode 100644 index 000000000..52b0e3bf7 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpDiscoveryProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: IpDiscoveryProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type IpDiscoveryProfilesClient interface { + + // API will delete IP Discovery profile. + // + // @param ipDiscoveryProfileIdParam IP Discovery Profile ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipDiscoveryProfileIdParam string) error + + // API will get IP Discovery profile. + // + // @param ipDiscoveryProfileIdParam IP Discovery Profile ID (required) + // @return com.vmware.nsx_global_policy.model.IPDiscoveryProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipDiscoveryProfileIdParam string) (model.IPDiscoveryProfile, error) + + // API will list all IP Discovery Profiles active in current discovery profile id. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.IPDiscoveryProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPDiscoveryProfileListResult, error) + + // API will create IP Discovery profile. + // + // @param ipDiscoveryProfileIdParam IP Discovery Profile ID (required) + // @param ipDiscoveryProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(ipDiscoveryProfileIdParam string, ipDiscoveryProfileParam model.IPDiscoveryProfile) error + + // API will update IP Discovery profile. + // + // @param ipDiscoveryProfileIdParam IP Discovery Profile ID (required) + // @param ipDiscoveryProfileParam (required) + // @return com.vmware.nsx_global_policy.model.IPDiscoveryProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipDiscoveryProfileIdParam string, ipDiscoveryProfileParam model.IPDiscoveryProfile) (model.IPDiscoveryProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpDiscoveryProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpDiscoveryProfilesTypes.go new file mode 100644 index 000000000..2d7c9e91f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpDiscoveryProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: IpDiscoveryProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func ipDiscoveryProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_discovery_profile_id"] = bindings.NewStringType() + fieldNameMap["ip_discovery_profile_id"] = "IpDiscoveryProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipDiscoveryProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipDiscoveryProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_discovery_profile_id"] = bindings.NewStringType() + fieldNameMap["ip_discovery_profile_id"] = "IpDiscoveryProfileId" + paramsTypeMap["ip_discovery_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipDiscoveryProfileId"] = bindings.NewStringType() + pathParams["ip_discovery_profile_id"] = "ipDiscoveryProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/ip-discovery-profiles/{ipDiscoveryProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipDiscoveryProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_discovery_profile_id"] = bindings.NewStringType() + fieldNameMap["ip_discovery_profile_id"] = "IpDiscoveryProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipDiscoveryProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPDiscoveryProfileBindingType) +} + +func ipDiscoveryProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_discovery_profile_id"] = bindings.NewStringType() + fieldNameMap["ip_discovery_profile_id"] = "IpDiscoveryProfileId" + paramsTypeMap["ip_discovery_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipDiscoveryProfileId"] = bindings.NewStringType() + pathParams["ip_discovery_profile_id"] = "ipDiscoveryProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ip-discovery-profiles/{ipDiscoveryProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipDiscoveryProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipDiscoveryProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPDiscoveryProfileListResultBindingType) +} + +func ipDiscoveryProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ip-discovery-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipDiscoveryProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_discovery_profile_id"] = bindings.NewStringType() + fields["ip_discovery_profile"] = bindings.NewReferenceType(model.IPDiscoveryProfileBindingType) + fieldNameMap["ip_discovery_profile_id"] = "IpDiscoveryProfileId" + fieldNameMap["ip_discovery_profile"] = "IpDiscoveryProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipDiscoveryProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipDiscoveryProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_discovery_profile_id"] = bindings.NewStringType() + fields["ip_discovery_profile"] = bindings.NewReferenceType(model.IPDiscoveryProfileBindingType) + fieldNameMap["ip_discovery_profile_id"] = "IpDiscoveryProfileId" + fieldNameMap["ip_discovery_profile"] = "IpDiscoveryProfile" + paramsTypeMap["ip_discovery_profile_id"] = bindings.NewStringType() + paramsTypeMap["ip_discovery_profile"] = bindings.NewReferenceType(model.IPDiscoveryProfileBindingType) + paramsTypeMap["ipDiscoveryProfileId"] = bindings.NewStringType() + pathParams["ip_discovery_profile_id"] = "ipDiscoveryProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_discovery_profile", + "PATCH", + "/global-manager/api/v1/global-infra/ip-discovery-profiles/{ipDiscoveryProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipDiscoveryProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_discovery_profile_id"] = bindings.NewStringType() + fields["ip_discovery_profile"] = bindings.NewReferenceType(model.IPDiscoveryProfileBindingType) + fieldNameMap["ip_discovery_profile_id"] = "IpDiscoveryProfileId" + fieldNameMap["ip_discovery_profile"] = "IpDiscoveryProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipDiscoveryProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPDiscoveryProfileBindingType) +} + +func ipDiscoveryProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_discovery_profile_id"] = bindings.NewStringType() + fields["ip_discovery_profile"] = bindings.NewReferenceType(model.IPDiscoveryProfileBindingType) + fieldNameMap["ip_discovery_profile_id"] = "IpDiscoveryProfileId" + fieldNameMap["ip_discovery_profile"] = "IpDiscoveryProfile" + paramsTypeMap["ip_discovery_profile_id"] = bindings.NewStringType() + paramsTypeMap["ip_discovery_profile"] = bindings.NewReferenceType(model.IPDiscoveryProfileBindingType) + paramsTypeMap["ipDiscoveryProfileId"] = bindings.NewStringType() + pathParams["ip_discovery_profile_id"] = "ipDiscoveryProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_discovery_profile", + "PUT", + "/global-manager/api/v1/global-infra/ip-discovery-profiles/{ipDiscoveryProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwCollectorProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwCollectorProfilesClient.go new file mode 100644 index 000000000..a4c77e070 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwCollectorProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: IpfixDfwCollectorProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type IpfixDfwCollectorProfilesClient interface { + + // API deletes IPFIX dfw collector profile. Flow forwarding to collector will be stopped. + // + // @param ipfixDfwCollectorProfileIdParam IPFIX dfw collector Profile id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipfixDfwCollectorProfileIdParam string) error + + // API will return details of IPFIX dfw collector profile. If profile does not exist, it will return 404. + // + // @param ipfixDfwCollectorProfileIdParam IPFIX dfw collector profile id (required) + // @return com.vmware.nsx_global_policy.model.IPFIXDFWCollectorProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipfixDfwCollectorProfileIdParam string) (model.IPFIXDFWCollectorProfile, error) + + // API will provide list of all IPFIX dfw collector profiles and their details. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.IPFIXDFWCollectorProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPFIXDFWCollectorProfileListResult, error) + + // Create a new IPFIX dfw collector profile if the IPFIX dfw collector profile with given id does not already exist. If the IPFIX dfw collector profile with the given id already exists, patch with the existing IPFIX dfw collector profile. + // + // @param ipfixDfwCollectorProfileIdParam (required) + // @param iPFIXDFWCollectorProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(ipfixDfwCollectorProfileIdParam string, iPFIXDFWCollectorProfileParam model.IPFIXDFWCollectorProfile) error + + // Create or Replace IPFIX dfw collector profile. IPFIX data will be sent to IPFIX collector port. + // + // @param ipfixDfwCollectorProfileIdParam IPFIX dfw collector profile id (required) + // @param iPFIXDFWCollectorProfileParam (required) + // @return com.vmware.nsx_global_policy.model.IPFIXDFWCollectorProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipfixDfwCollectorProfileIdParam string, iPFIXDFWCollectorProfileParam model.IPFIXDFWCollectorProfile) (model.IPFIXDFWCollectorProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwCollectorProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwCollectorProfilesTypes.go new file mode 100644 index 000000000..8b64251c6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwCollectorProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: IpfixDfwCollectorProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func ipfixDfwCollectorProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_dfw_collector_profile_id"] = "IpfixDfwCollectorProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwCollectorProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixDfwCollectorProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_dfw_collector_profile_id"] = "IpfixDfwCollectorProfileId" + paramsTypeMap["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixDfwCollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_dfw_collector_profile_id"] = "ipfixDfwCollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/ipfix-dfw-collector-profiles/{ipfixDfwCollectorProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixDfwCollectorProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_dfw_collector_profile_id"] = "IpfixDfwCollectorProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwCollectorProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXDFWCollectorProfileBindingType) +} + +func ipfixDfwCollectorProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_dfw_collector_profile_id"] = "IpfixDfwCollectorProfileId" + paramsTypeMap["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixDfwCollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_dfw_collector_profile_id"] = "ipfixDfwCollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipfix-dfw-collector-profiles/{ipfixDfwCollectorProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixDfwCollectorProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwCollectorProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXDFWCollectorProfileListResultBindingType) +} + +func ipfixDfwCollectorProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipfix-dfw-collector-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixDfwCollectorProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + fields["i_PFIXDFW_collector_profile"] = bindings.NewReferenceType(model.IPFIXDFWCollectorProfileBindingType) + fieldNameMap["ipfix_dfw_collector_profile_id"] = "IpfixDfwCollectorProfileId" + fieldNameMap["i_PFIXDFW_collector_profile"] = "IPFIXDFWCollectorProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwCollectorProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixDfwCollectorProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + fields["i_PFIXDFW_collector_profile"] = bindings.NewReferenceType(model.IPFIXDFWCollectorProfileBindingType) + fieldNameMap["ipfix_dfw_collector_profile_id"] = "IpfixDfwCollectorProfileId" + fieldNameMap["i_PFIXDFW_collector_profile"] = "IPFIXDFWCollectorProfile" + paramsTypeMap["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["i_PFIXDFW_collector_profile"] = bindings.NewReferenceType(model.IPFIXDFWCollectorProfileBindingType) + paramsTypeMap["ipfixDfwCollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_dfw_collector_profile_id"] = "ipfixDfwCollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_PFIXDFW_collector_profile", + "PATCH", + "/global-manager/api/v1/global-infra/ipfix-dfw-collector-profiles/{ipfixDfwCollectorProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixDfwCollectorProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + fields["i_PFIXDFW_collector_profile"] = bindings.NewReferenceType(model.IPFIXDFWCollectorProfileBindingType) + fieldNameMap["ipfix_dfw_collector_profile_id"] = "IpfixDfwCollectorProfileId" + fieldNameMap["i_PFIXDFW_collector_profile"] = "IPFIXDFWCollectorProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwCollectorProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXDFWCollectorProfileBindingType) +} + +func ipfixDfwCollectorProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + fields["i_PFIXDFW_collector_profile"] = bindings.NewReferenceType(model.IPFIXDFWCollectorProfileBindingType) + fieldNameMap["ipfix_dfw_collector_profile_id"] = "IpfixDfwCollectorProfileId" + fieldNameMap["i_PFIXDFW_collector_profile"] = "IPFIXDFWCollectorProfile" + paramsTypeMap["ipfix_dfw_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["i_PFIXDFW_collector_profile"] = bindings.NewReferenceType(model.IPFIXDFWCollectorProfileBindingType) + paramsTypeMap["ipfixDfwCollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_dfw_collector_profile_id"] = "ipfixDfwCollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_PFIXDFW_collector_profile", + "PUT", + "/global-manager/api/v1/global-infra/ipfix-dfw-collector-profiles/{ipfixDfwCollectorProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwProfilesClient.go new file mode 100644 index 000000000..55c64789f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: IpfixDfwProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type IpfixDfwProfilesClient interface { + + // API deletes IPFIX DFW Profile. Selected IPFIX Collectors will stop receiving flows. + // + // @param ipfixDfwProfileIdParam IPFIX DFW Profile ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipfixDfwProfileIdParam string) error + + // API will return details of IPFIX DFW profile. + // + // @param ipfixDfwProfileIdParam IPFIX DFW collection id (required) + // @return com.vmware.nsx_global_policy.model.IPFIXDFWProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipfixDfwProfileIdParam string) (model.IPFIXDFWProfile, error) + + // API provides list IPFIX DFW profiles available on selected logical DFW. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.IPFIXDFWProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPFIXDFWProfileListResult, error) + + // Create a new IPFIX DFW profile if the IPFIX DFW profile with given id does not already exist. If the IPFIX DFW profile with the given id already exists, patch with the existing IPFIX DFW profile. + // + // @param ipfixDfwProfileIdParam IPFIX DFW Profile ID (required) + // @param iPFIXDFWProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(ipfixDfwProfileIdParam string, iPFIXDFWProfileParam model.IPFIXDFWProfile) error + + // Create or replace IPFIX DFW profile. Config will start forwarding data to provided IPFIX DFW collector. + // + // @param ipfixDfwProfileIdParam IPFIX DFW Profile ID (required) + // @param iPFIXDFWProfileParam (required) + // @return com.vmware.nsx_global_policy.model.IPFIXDFWProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipfixDfwProfileIdParam string, iPFIXDFWProfileParam model.IPFIXDFWProfile) (model.IPFIXDFWProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwProfilesTypes.go new file mode 100644 index 000000000..37c721cc7 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixDfwProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: IpfixDfwProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func ipfixDfwProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_dfw_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_dfw_profile_id"] = "IpfixDfwProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixDfwProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_dfw_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_dfw_profile_id"] = "IpfixDfwProfileId" + paramsTypeMap["ipfix_dfw_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixDfwProfileId"] = bindings.NewStringType() + pathParams["ipfix_dfw_profile_id"] = "ipfixDfwProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/ipfix-dfw-profiles/{ipfixDfwProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixDfwProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_dfw_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_dfw_profile_id"] = "IpfixDfwProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXDFWProfileBindingType) +} + +func ipfixDfwProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_dfw_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_dfw_profile_id"] = "IpfixDfwProfileId" + paramsTypeMap["ipfix_dfw_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixDfwProfileId"] = bindings.NewStringType() + pathParams["ipfix_dfw_profile_id"] = "ipfixDfwProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipfix-dfw-profiles/{ipfixDfwProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixDfwProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXDFWProfileListResultBindingType) +} + +func ipfixDfwProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipfix-dfw-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixDfwProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_dfw_profile_id"] = bindings.NewStringType() + fields["i_PFIXDFW_profile"] = bindings.NewReferenceType(model.IPFIXDFWProfileBindingType) + fieldNameMap["ipfix_dfw_profile_id"] = "IpfixDfwProfileId" + fieldNameMap["i_PFIXDFW_profile"] = "IPFIXDFWProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixDfwProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_dfw_profile_id"] = bindings.NewStringType() + fields["i_PFIXDFW_profile"] = bindings.NewReferenceType(model.IPFIXDFWProfileBindingType) + fieldNameMap["ipfix_dfw_profile_id"] = "IpfixDfwProfileId" + fieldNameMap["i_PFIXDFW_profile"] = "IPFIXDFWProfile" + paramsTypeMap["ipfix_dfw_profile_id"] = bindings.NewStringType() + paramsTypeMap["i_PFIXDFW_profile"] = bindings.NewReferenceType(model.IPFIXDFWProfileBindingType) + paramsTypeMap["ipfixDfwProfileId"] = bindings.NewStringType() + pathParams["ipfix_dfw_profile_id"] = "ipfixDfwProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_PFIXDFW_profile", + "PATCH", + "/global-manager/api/v1/global-infra/ipfix-dfw-profiles/{ipfixDfwProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixDfwProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_dfw_profile_id"] = bindings.NewStringType() + fields["i_PFIXDFW_profile"] = bindings.NewReferenceType(model.IPFIXDFWProfileBindingType) + fieldNameMap["ipfix_dfw_profile_id"] = "IpfixDfwProfileId" + fieldNameMap["i_PFIXDFW_profile"] = "IPFIXDFWProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixDfwProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXDFWProfileBindingType) +} + +func ipfixDfwProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_dfw_profile_id"] = bindings.NewStringType() + fields["i_PFIXDFW_profile"] = bindings.NewReferenceType(model.IPFIXDFWProfileBindingType) + fieldNameMap["ipfix_dfw_profile_id"] = "IpfixDfwProfileId" + fieldNameMap["i_PFIXDFW_profile"] = "IPFIXDFWProfile" + paramsTypeMap["ipfix_dfw_profile_id"] = bindings.NewStringType() + paramsTypeMap["i_PFIXDFW_profile"] = bindings.NewReferenceType(model.IPFIXDFWProfileBindingType) + paramsTypeMap["ipfixDfwProfileId"] = bindings.NewStringType() + pathParams["ipfix_dfw_profile_id"] = "ipfixDfwProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_PFIXDFW_profile", + "PUT", + "/global-manager/api/v1/global-infra/ipfix-dfw-profiles/{ipfixDfwProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2CollectorProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2CollectorProfilesClient.go new file mode 100644 index 000000000..2abcb3861 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2CollectorProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: IpfixL2CollectorProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type IpfixL2CollectorProfilesClient interface { + + // API deletes IPFIX collector profile. Flow forwarding to collector will be stopped. + // + // @param ipfixL2CollectorProfileIdParam IPFIX collector Profile id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipfixL2CollectorProfileIdParam string) error + + // API will return details of IPFIX collector profile. + // + // @param ipfixL2CollectorProfileIdParam IPFIX collector profile id (required) + // @return com.vmware.nsx_global_policy.model.IPFIXL2CollectorProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipfixL2CollectorProfileIdParam string) (model.IPFIXL2CollectorProfile, error) + + // API will provide list of all IPFIX collector profiles and their details. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.IPFIXL2CollectorProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPFIXL2CollectorProfileListResult, error) + + // Create a new IPFIX collector profile if the IPFIX collector profile with given id does not already exist. If the IPFIX collector profile with the given id already exists, patch with the existing IPFIX collector profile. + // + // @param ipfixL2CollectorProfileIdParam IPFIX collector profile id (required) + // @param iPFIXL2CollectorProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(ipfixL2CollectorProfileIdParam string, iPFIXL2CollectorProfileParam model.IPFIXL2CollectorProfile) error + + // Create or Replace IPFIX collector profile. IPFIX data will be sent to IPFIX collector. + // + // @param ipfixL2CollectorProfileIdParam IPFIX collector profile id (required) + // @param iPFIXL2CollectorProfileParam (required) + // @return com.vmware.nsx_global_policy.model.IPFIXL2CollectorProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipfixL2CollectorProfileIdParam string, iPFIXL2CollectorProfileParam model.IPFIXL2CollectorProfile) (model.IPFIXL2CollectorProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2CollectorProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2CollectorProfilesTypes.go new file mode 100644 index 000000000..a8794e354 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2CollectorProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: IpfixL2CollectorProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func ipfixL2CollectorProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_l2_collector_profile_id"] = "IpfixL2CollectorProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2CollectorProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixL2CollectorProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_l2_collector_profile_id"] = "IpfixL2CollectorProfileId" + paramsTypeMap["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixL2CollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_l2_collector_profile_id"] = "ipfixL2CollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/ipfix-l2-collector-profiles/{ipfixL2CollectorProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixL2CollectorProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_l2_collector_profile_id"] = "IpfixL2CollectorProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2CollectorProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXL2CollectorProfileBindingType) +} + +func ipfixL2CollectorProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_l2_collector_profile_id"] = "IpfixL2CollectorProfileId" + paramsTypeMap["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixL2CollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_l2_collector_profile_id"] = "ipfixL2CollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipfix-l2-collector-profiles/{ipfixL2CollectorProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixL2CollectorProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2CollectorProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXL2CollectorProfileListResultBindingType) +} + +func ipfixL2CollectorProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipfix-l2-collector-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixL2CollectorProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + fields["i_PFIX_l2_collector_profile"] = bindings.NewReferenceType(model.IPFIXL2CollectorProfileBindingType) + fieldNameMap["ipfix_l2_collector_profile_id"] = "IpfixL2CollectorProfileId" + fieldNameMap["i_PFIX_l2_collector_profile"] = "IPFIXL2CollectorProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2CollectorProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixL2CollectorProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + fields["i_PFIX_l2_collector_profile"] = bindings.NewReferenceType(model.IPFIXL2CollectorProfileBindingType) + fieldNameMap["ipfix_l2_collector_profile_id"] = "IpfixL2CollectorProfileId" + fieldNameMap["i_PFIX_l2_collector_profile"] = "IPFIXL2CollectorProfile" + paramsTypeMap["i_PFIX_l2_collector_profile"] = bindings.NewReferenceType(model.IPFIXL2CollectorProfileBindingType) + paramsTypeMap["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixL2CollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_l2_collector_profile_id"] = "ipfixL2CollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_PFIX_l2_collector_profile", + "PATCH", + "/global-manager/api/v1/global-infra/ipfix-l2-collector-profiles/{ipfixL2CollectorProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixL2CollectorProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + fields["i_PFIX_l2_collector_profile"] = bindings.NewReferenceType(model.IPFIXL2CollectorProfileBindingType) + fieldNameMap["ipfix_l2_collector_profile_id"] = "IpfixL2CollectorProfileId" + fieldNameMap["i_PFIX_l2_collector_profile"] = "IPFIXL2CollectorProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2CollectorProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXL2CollectorProfileBindingType) +} + +func ipfixL2CollectorProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + fields["i_PFIX_l2_collector_profile"] = bindings.NewReferenceType(model.IPFIXL2CollectorProfileBindingType) + fieldNameMap["ipfix_l2_collector_profile_id"] = "IpfixL2CollectorProfileId" + fieldNameMap["i_PFIX_l2_collector_profile"] = "IPFIXL2CollectorProfile" + paramsTypeMap["i_PFIX_l2_collector_profile"] = bindings.NewReferenceType(model.IPFIXL2CollectorProfileBindingType) + paramsTypeMap["ipfix_l2_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixL2CollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_l2_collector_profile_id"] = "ipfixL2CollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_PFIX_l2_collector_profile", + "PUT", + "/global-manager/api/v1/global-infra/ipfix-l2-collector-profiles/{ipfixL2CollectorProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2ProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2ProfilesClient.go new file mode 100644 index 000000000..ff1b3b217 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2ProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: IpfixL2Profiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type IpfixL2ProfilesClient interface { + + // API deletes IPFIX L2 Profile. Flow forwarding to selected collector will be stopped. + // + // @param ipfixL2ProfileIdParam IPFIX L2 Profile ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipfixL2ProfileIdParam string) error + + // API will return details of IPFIX L2 profile. + // + // @param ipfixL2ProfileIdParam IPFIX L2 profile id (required) + // @return com.vmware.nsx_global_policy.model.IPFIXL2Profile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipfixL2ProfileIdParam string) (model.IPFIXL2Profile, error) + + // API provides list IPFIX L2 Profiles available on selected logical l2. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.IPFIXL2ProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPFIXL2ProfileListResult, error) + + // Create a new IPFIX L2 profile if the IPFIX L2 profile with given id does not already exist. If the IPFIX L2 profile with the given id already exists, patch with the existing IPFIX L2 profile. + // + // @param ipfixL2ProfileIdParam IPFIX L2 Profile ID (required) + // @param iPFIXL2ProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(ipfixL2ProfileIdParam string, iPFIXL2ProfileParam model.IPFIXL2Profile) error + + // Create or replace IPFIX L2 Profile. Profile is reusable entity. Single profile can attached multiple bindings e.g group, segment and port. + // + // @param ipfixL2ProfileIdParam IPFIX L2 Profile ID (required) + // @param iPFIXL2ProfileParam (required) + // @return com.vmware.nsx_global_policy.model.IPFIXL2Profile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipfixL2ProfileIdParam string, iPFIXL2ProfileParam model.IPFIXL2Profile) (model.IPFIXL2Profile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2ProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2ProfilesTypes.go new file mode 100644 index 000000000..00aceb31a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/IpfixL2ProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: IpfixL2Profiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func ipfixL2ProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_l2_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_l2_profile_id"] = "IpfixL2ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2ProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixL2ProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_l2_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_l2_profile_id"] = "IpfixL2ProfileId" + paramsTypeMap["ipfix_l2_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixL2ProfileId"] = bindings.NewStringType() + pathParams["ipfix_l2_profile_id"] = "ipfixL2ProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/ipfix-l2-profiles/{ipfixL2ProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixL2ProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_l2_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_l2_profile_id"] = "IpfixL2ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2ProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXL2ProfileBindingType) +} + +func ipfixL2ProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_l2_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_l2_profile_id"] = "IpfixL2ProfileId" + paramsTypeMap["ipfix_l2_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixL2ProfileId"] = bindings.NewStringType() + pathParams["ipfix_l2_profile_id"] = "ipfixL2ProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipfix-l2-profiles/{ipfixL2ProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixL2ProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2ProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXL2ProfileListResultBindingType) +} + +func ipfixL2ProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipfix-l2-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixL2ProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_l2_profile_id"] = bindings.NewStringType() + fields["i_PFIX_l2_profile"] = bindings.NewReferenceType(model.IPFIXL2ProfileBindingType) + fieldNameMap["ipfix_l2_profile_id"] = "IpfixL2ProfileId" + fieldNameMap["i_PFIX_l2_profile"] = "IPFIXL2Profile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2ProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixL2ProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_l2_profile_id"] = bindings.NewStringType() + fields["i_PFIX_l2_profile"] = bindings.NewReferenceType(model.IPFIXL2ProfileBindingType) + fieldNameMap["ipfix_l2_profile_id"] = "IpfixL2ProfileId" + fieldNameMap["i_PFIX_l2_profile"] = "IPFIXL2Profile" + paramsTypeMap["ipfix_l2_profile_id"] = bindings.NewStringType() + paramsTypeMap["i_PFIX_l2_profile"] = bindings.NewReferenceType(model.IPFIXL2ProfileBindingType) + paramsTypeMap["ipfixL2ProfileId"] = bindings.NewStringType() + pathParams["ipfix_l2_profile_id"] = "ipfixL2ProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_PFIX_l2_profile", + "PATCH", + "/global-manager/api/v1/global-infra/ipfix-l2-profiles/{ipfixL2ProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixL2ProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_l2_profile_id"] = bindings.NewStringType() + fields["i_PFIX_l2_profile"] = bindings.NewReferenceType(model.IPFIXL2ProfileBindingType) + fieldNameMap["ipfix_l2_profile_id"] = "IpfixL2ProfileId" + fieldNameMap["i_PFIX_l2_profile"] = "IPFIXL2Profile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixL2ProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPFIXL2ProfileBindingType) +} + +func ipfixL2ProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_l2_profile_id"] = bindings.NewStringType() + fields["i_PFIX_l2_profile"] = bindings.NewReferenceType(model.IPFIXL2ProfileBindingType) + fieldNameMap["ipfix_l2_profile_id"] = "IpfixL2ProfileId" + fieldNameMap["i_PFIX_l2_profile"] = "IPFIXL2Profile" + paramsTypeMap["ipfix_l2_profile_id"] = bindings.NewStringType() + paramsTypeMap["i_PFIX_l2_profile"] = bindings.NewReferenceType(model.IPFIXL2ProfileBindingType) + paramsTypeMap["ipfixL2ProfileId"] = bindings.NewStringType() + pathParams["ipfix_l2_profile_id"] = "ipfixL2ProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_PFIX_l2_profile", + "PUT", + "/global-manager/api/v1/global-infra/ipfix-l2-profiles/{ipfixL2ProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6DadProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6DadProfilesClient.go new file mode 100644 index 000000000..dcb1caad9 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6DadProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Ipv6DadProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type Ipv6DadProfilesClient interface { + + // Delete IPv6 DAD profile + // + // @param dadProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(dadProfileIdParam string) error + + // Read IPv6 DAD profile + // + // @param dadProfileIdParam (required) + // @return com.vmware.nsx_global_policy.model.Ipv6DadProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(dadProfileIdParam string) (model.Ipv6DadProfile, error) + + // Paginated list of all IPv6 DAD profile instances + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.Ipv6DadProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Ipv6DadProfileListResult, error) + + // If profile with the dad-profile-id is not already present, create a new IPv6 DAD profile instance. If it already exists, update the IPv6 DAD profile instance with specified attributes. + // + // @param dadProfileIdParam (required) + // @param ipv6DadProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(dadProfileIdParam string, ipv6DadProfileParam model.Ipv6DadProfile) error + + // If profile with the dad-profile-id is not already present, create a new IPv6 DAD profile instance. If it already exists, replace the IPv6 DAD profile instance with this object. + // + // @param dadProfileIdParam (required) + // @param ipv6DadProfileParam (required) + // @return com.vmware.nsx_global_policy.model.Ipv6DadProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(dadProfileIdParam string, ipv6DadProfileParam model.Ipv6DadProfile) (model.Ipv6DadProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6DadProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6DadProfilesTypes.go new file mode 100644 index 000000000..03d8dc81f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6DadProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Ipv6DadProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func ipv6DadProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_profile_id"] = bindings.NewStringType() + fieldNameMap["dad_profile_id"] = "DadProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6DadProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipv6DadProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dad_profile_id"] = bindings.NewStringType() + fieldNameMap["dad_profile_id"] = "DadProfileId" + paramsTypeMap["dad_profile_id"] = bindings.NewStringType() + paramsTypeMap["dadProfileId"] = bindings.NewStringType() + pathParams["dad_profile_id"] = "dadProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/ipv6-dad-profiles/{dadProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6DadProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_profile_id"] = bindings.NewStringType() + fieldNameMap["dad_profile_id"] = "DadProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6DadProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Ipv6DadProfileBindingType) +} + +func ipv6DadProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dad_profile_id"] = bindings.NewStringType() + fieldNameMap["dad_profile_id"] = "DadProfileId" + paramsTypeMap["dad_profile_id"] = bindings.NewStringType() + paramsTypeMap["dadProfileId"] = bindings.NewStringType() + pathParams["dad_profile_id"] = "dadProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipv6-dad-profiles/{dadProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6DadProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6DadProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Ipv6DadProfileListResultBindingType) +} + +func ipv6DadProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipv6-dad-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6DadProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_profile_id"] = bindings.NewStringType() + fields["ipv6_dad_profile"] = bindings.NewReferenceType(model.Ipv6DadProfileBindingType) + fieldNameMap["dad_profile_id"] = "DadProfileId" + fieldNameMap["ipv6_dad_profile"] = "Ipv6DadProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6DadProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipv6DadProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dad_profile_id"] = bindings.NewStringType() + fields["ipv6_dad_profile"] = bindings.NewReferenceType(model.Ipv6DadProfileBindingType) + fieldNameMap["dad_profile_id"] = "DadProfileId" + fieldNameMap["ipv6_dad_profile"] = "Ipv6DadProfile" + paramsTypeMap["dad_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipv6_dad_profile"] = bindings.NewReferenceType(model.Ipv6DadProfileBindingType) + paramsTypeMap["dadProfileId"] = bindings.NewStringType() + pathParams["dad_profile_id"] = "dadProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipv6_dad_profile", + "PATCH", + "/global-manager/api/v1/global-infra/ipv6-dad-profiles/{dadProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6DadProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_profile_id"] = bindings.NewStringType() + fields["ipv6_dad_profile"] = bindings.NewReferenceType(model.Ipv6DadProfileBindingType) + fieldNameMap["dad_profile_id"] = "DadProfileId" + fieldNameMap["ipv6_dad_profile"] = "Ipv6DadProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6DadProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Ipv6DadProfileBindingType) +} + +func ipv6DadProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dad_profile_id"] = bindings.NewStringType() + fields["ipv6_dad_profile"] = bindings.NewReferenceType(model.Ipv6DadProfileBindingType) + fieldNameMap["dad_profile_id"] = "DadProfileId" + fieldNameMap["ipv6_dad_profile"] = "Ipv6DadProfile" + paramsTypeMap["dad_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipv6_dad_profile"] = bindings.NewReferenceType(model.Ipv6DadProfileBindingType) + paramsTypeMap["dadProfileId"] = bindings.NewStringType() + pathParams["dad_profile_id"] = "dadProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipv6_dad_profile", + "PUT", + "/global-manager/api/v1/global-infra/ipv6-dad-profiles/{dadProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6NdraProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6NdraProfilesClient.go new file mode 100644 index 000000000..7ae551061 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6NdraProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Ipv6NdraProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type Ipv6NdraProfilesClient interface { + + // Delete IPv6 NDRA profile + // + // @param ndraProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ndraProfileIdParam string) error + + // Read IPv6 NDRA profile + // + // @param ndraProfileIdParam (required) + // @return com.vmware.nsx_global_policy.model.Ipv6NdraProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ndraProfileIdParam string) (model.Ipv6NdraProfile, error) + + // Paginated list of all IPv6 NDRA profile instances + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.Ipv6NdraProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Ipv6NdraProfileListResult, error) + + // If profile with the ndra-profile-id is not already present, create a new IPv6 NDRA profile instance. If it already exists, update the IPv6 NDRA profile instance with specified attributes. + // + // @param ndraProfileIdParam (required) + // @param ipv6NdraProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(ndraProfileIdParam string, ipv6NdraProfileParam model.Ipv6NdraProfile) error + + // If profile with the ndra-profile-id is not already present, create a new IPv6 NDRA profile instance. If it already exists, replace the IPv6 NDRA profile instance with this object. + // + // @param ndraProfileIdParam (required) + // @param ipv6NdraProfileParam (required) + // @return com.vmware.nsx_global_policy.model.Ipv6NdraProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ndraProfileIdParam string, ipv6NdraProfileParam model.Ipv6NdraProfile) (model.Ipv6NdraProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6NdraProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6NdraProfilesTypes.go new file mode 100644 index 000000000..f23da8514 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Ipv6NdraProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Ipv6NdraProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func ipv6NdraProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ndra_profile_id"] = bindings.NewStringType() + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6NdraProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipv6NdraProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ndra_profile_id"] = bindings.NewStringType() + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + paramsTypeMap["ndra_profile_id"] = bindings.NewStringType() + paramsTypeMap["ndraProfileId"] = bindings.NewStringType() + pathParams["ndra_profile_id"] = "ndraProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/ipv6-ndra-profiles/{ndraProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6NdraProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ndra_profile_id"] = bindings.NewStringType() + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6NdraProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Ipv6NdraProfileBindingType) +} + +func ipv6NdraProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ndra_profile_id"] = bindings.NewStringType() + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + paramsTypeMap["ndra_profile_id"] = bindings.NewStringType() + paramsTypeMap["ndraProfileId"] = bindings.NewStringType() + pathParams["ndra_profile_id"] = "ndraProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipv6-ndra-profiles/{ndraProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6NdraProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6NdraProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Ipv6NdraProfileListResultBindingType) +} + +func ipv6NdraProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/ipv6-ndra-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6NdraProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ndra_profile_id"] = bindings.NewStringType() + fields["ipv6_ndra_profile"] = bindings.NewReferenceType(model.Ipv6NdraProfileBindingType) + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + fieldNameMap["ipv6_ndra_profile"] = "Ipv6NdraProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6NdraProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipv6NdraProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ndra_profile_id"] = bindings.NewStringType() + fields["ipv6_ndra_profile"] = bindings.NewReferenceType(model.Ipv6NdraProfileBindingType) + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + fieldNameMap["ipv6_ndra_profile"] = "Ipv6NdraProfile" + paramsTypeMap["ndra_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipv6_ndra_profile"] = bindings.NewReferenceType(model.Ipv6NdraProfileBindingType) + paramsTypeMap["ndraProfileId"] = bindings.NewStringType() + pathParams["ndra_profile_id"] = "ndraProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipv6_ndra_profile", + "PATCH", + "/global-manager/api/v1/global-infra/ipv6-ndra-profiles/{ndraProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6NdraProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ndra_profile_id"] = bindings.NewStringType() + fields["ipv6_ndra_profile"] = bindings.NewReferenceType(model.Ipv6NdraProfileBindingType) + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + fieldNameMap["ipv6_ndra_profile"] = "Ipv6NdraProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6NdraProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Ipv6NdraProfileBindingType) +} + +func ipv6NdraProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ndra_profile_id"] = bindings.NewStringType() + fields["ipv6_ndra_profile"] = bindings.NewReferenceType(model.Ipv6NdraProfileBindingType) + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + fieldNameMap["ipv6_ndra_profile"] = "Ipv6NdraProfile" + paramsTypeMap["ndra_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipv6_ndra_profile"] = bindings.NewReferenceType(model.Ipv6NdraProfileBindingType) + paramsTypeMap["ndraProfileId"] = bindings.NewStringType() + pathParams["ndra_profile_id"] = "ndraProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipv6_ndra_profile", + "PUT", + "/global-manager/api/v1/global-infra/ipv6-ndra-profiles/{ndraProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/LabelsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/LabelsClient.go new file mode 100644 index 000000000..57b618f6e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/LabelsClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Labels + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type LabelsClient interface { + + // Delete PolicyLabel object + // + // @param labelIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(labelIdParam string) error + + // Read a label. + // + // @param labelIdParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyLabel + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(labelIdParam string) (model.PolicyLabel, error) + + // Paginated list of all labels for infra. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyLabelListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyLabelListResult, error) + + // Create label if not exists, otherwise take the partial updates. Note, once the label is created type attribute can not be changed. + // + // @param labelIdParam (required) + // @param policyLabelParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(labelIdParam string, policyLabelParam model.PolicyLabel) error + + // Create label if not exists, otherwise replaces the existing label. If label already exists then type attribute cannot be changed. + // + // @param labelIdParam (required) + // @param policyLabelParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyLabel + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(labelIdParam string, policyLabelParam model.PolicyLabel) (model.PolicyLabel, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/LabelsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/LabelsTypes.go new file mode 100644 index 000000000..464bb99ee --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/LabelsTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Labels. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func labelsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label_id"] = bindings.NewStringType() + fieldNameMap["label_id"] = "LabelId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func labelsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func labelsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["label_id"] = bindings.NewStringType() + fieldNameMap["label_id"] = "LabelId" + paramsTypeMap["label_id"] = bindings.NewStringType() + paramsTypeMap["labelId"] = bindings.NewStringType() + pathParams["label_id"] = "labelId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/labels/{labelId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func labelsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label_id"] = bindings.NewStringType() + fieldNameMap["label_id"] = "LabelId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func labelsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyLabelBindingType) +} + +func labelsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["label_id"] = bindings.NewStringType() + fieldNameMap["label_id"] = "LabelId" + paramsTypeMap["label_id"] = bindings.NewStringType() + paramsTypeMap["labelId"] = bindings.NewStringType() + pathParams["label_id"] = "labelId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/labels/{labelId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func labelsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func labelsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyLabelListResultBindingType) +} + +func labelsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/labels", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func labelsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label_id"] = bindings.NewStringType() + fields["policy_label"] = bindings.NewReferenceType(model.PolicyLabelBindingType) + fieldNameMap["label_id"] = "LabelId" + fieldNameMap["policy_label"] = "PolicyLabel" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func labelsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func labelsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["label_id"] = bindings.NewStringType() + fields["policy_label"] = bindings.NewReferenceType(model.PolicyLabelBindingType) + fieldNameMap["label_id"] = "LabelId" + fieldNameMap["policy_label"] = "PolicyLabel" + paramsTypeMap["policy_label"] = bindings.NewReferenceType(model.PolicyLabelBindingType) + paramsTypeMap["label_id"] = bindings.NewStringType() + paramsTypeMap["labelId"] = bindings.NewStringType() + pathParams["label_id"] = "labelId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_label", + "PATCH", + "/global-manager/api/v1/global-infra/labels/{labelId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func labelsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label_id"] = bindings.NewStringType() + fields["policy_label"] = bindings.NewReferenceType(model.PolicyLabelBindingType) + fieldNameMap["label_id"] = "LabelId" + fieldNameMap["policy_label"] = "PolicyLabel" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func labelsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyLabelBindingType) +} + +func labelsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["label_id"] = bindings.NewStringType() + fields["policy_label"] = bindings.NewReferenceType(model.PolicyLabelBindingType) + fieldNameMap["label_id"] = "LabelId" + fieldNameMap["policy_label"] = "PolicyLabel" + paramsTypeMap["policy_label"] = bindings.NewReferenceType(model.PolicyLabelBindingType) + paramsTypeMap["label_id"] = bindings.NewStringType() + paramsTypeMap["labelId"] = bindings.NewStringType() + pathParams["label_id"] = "labelId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_label", + "PUT", + "/global-manager/api/v1/global-infra/labels/{labelId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/MacDiscoveryProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/MacDiscoveryProfilesClient.go new file mode 100644 index 000000000..6830b2efd --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/MacDiscoveryProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: MacDiscoveryProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type MacDiscoveryProfilesClient interface { + + // API will delete Mac Discovery profile. + // + // @param macDiscoveryProfileIdParam Mac Discovery Profile ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(macDiscoveryProfileIdParam string) error + + // API will get Mac Discovery profile. + // + // @param macDiscoveryProfileIdParam Mac Discovery Profile ID (required) + // @return com.vmware.nsx_global_policy.model.MacDiscoveryProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(macDiscoveryProfileIdParam string) (model.MacDiscoveryProfile, error) + + // API will list all Mac Discovery Profiles active in current discovery profile id. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.MacDiscoveryProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MacDiscoveryProfileListResult, error) + + // API will create Mac Discovery profile. + // + // @param macDiscoveryProfileIdParam Mac Discovery Profile ID (required) + // @param macDiscoveryProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(macDiscoveryProfileIdParam string, macDiscoveryProfileParam model.MacDiscoveryProfile) error + + // API will update Mac Discovery profile. + // + // @param macDiscoveryProfileIdParam Mac Discovery Profile ID (required) + // @param macDiscoveryProfileParam (required) + // @return com.vmware.nsx_global_policy.model.MacDiscoveryProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(macDiscoveryProfileIdParam string, macDiscoveryProfileParam model.MacDiscoveryProfile) (model.MacDiscoveryProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/MacDiscoveryProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/MacDiscoveryProfilesTypes.go new file mode 100644 index 000000000..1f2ff851a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/MacDiscoveryProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: MacDiscoveryProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func macDiscoveryProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_discovery_profile_id"] = bindings.NewStringType() + fieldNameMap["mac_discovery_profile_id"] = "MacDiscoveryProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macDiscoveryProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func macDiscoveryProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_discovery_profile_id"] = bindings.NewStringType() + fieldNameMap["mac_discovery_profile_id"] = "MacDiscoveryProfileId" + paramsTypeMap["mac_discovery_profile_id"] = bindings.NewStringType() + paramsTypeMap["macDiscoveryProfileId"] = bindings.NewStringType() + pathParams["mac_discovery_profile_id"] = "macDiscoveryProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/mac-discovery-profiles/{macDiscoveryProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func macDiscoveryProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_discovery_profile_id"] = bindings.NewStringType() + fieldNameMap["mac_discovery_profile_id"] = "MacDiscoveryProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macDiscoveryProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MacDiscoveryProfileBindingType) +} + +func macDiscoveryProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_discovery_profile_id"] = bindings.NewStringType() + fieldNameMap["mac_discovery_profile_id"] = "MacDiscoveryProfileId" + paramsTypeMap["mac_discovery_profile_id"] = bindings.NewStringType() + paramsTypeMap["macDiscoveryProfileId"] = bindings.NewStringType() + pathParams["mac_discovery_profile_id"] = "macDiscoveryProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/mac-discovery-profiles/{macDiscoveryProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func macDiscoveryProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macDiscoveryProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MacDiscoveryProfileListResultBindingType) +} + +func macDiscoveryProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/mac-discovery-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func macDiscoveryProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_discovery_profile_id"] = bindings.NewStringType() + fields["mac_discovery_profile"] = bindings.NewReferenceType(model.MacDiscoveryProfileBindingType) + fieldNameMap["mac_discovery_profile_id"] = "MacDiscoveryProfileId" + fieldNameMap["mac_discovery_profile"] = "MacDiscoveryProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macDiscoveryProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func macDiscoveryProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_discovery_profile_id"] = bindings.NewStringType() + fields["mac_discovery_profile"] = bindings.NewReferenceType(model.MacDiscoveryProfileBindingType) + fieldNameMap["mac_discovery_profile_id"] = "MacDiscoveryProfileId" + fieldNameMap["mac_discovery_profile"] = "MacDiscoveryProfile" + paramsTypeMap["mac_discovery_profile_id"] = bindings.NewStringType() + paramsTypeMap["mac_discovery_profile"] = bindings.NewReferenceType(model.MacDiscoveryProfileBindingType) + paramsTypeMap["macDiscoveryProfileId"] = bindings.NewStringType() + pathParams["mac_discovery_profile_id"] = "macDiscoveryProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "mac_discovery_profile", + "PATCH", + "/global-manager/api/v1/global-infra/mac-discovery-profiles/{macDiscoveryProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func macDiscoveryProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_discovery_profile_id"] = bindings.NewStringType() + fields["mac_discovery_profile"] = bindings.NewReferenceType(model.MacDiscoveryProfileBindingType) + fieldNameMap["mac_discovery_profile_id"] = "MacDiscoveryProfileId" + fieldNameMap["mac_discovery_profile"] = "MacDiscoveryProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macDiscoveryProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MacDiscoveryProfileBindingType) +} + +func macDiscoveryProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_discovery_profile_id"] = bindings.NewStringType() + fields["mac_discovery_profile"] = bindings.NewReferenceType(model.MacDiscoveryProfileBindingType) + fieldNameMap["mac_discovery_profile_id"] = "MacDiscoveryProfileId" + fieldNameMap["mac_discovery_profile"] = "MacDiscoveryProfile" + paramsTypeMap["mac_discovery_profile_id"] = bindings.NewStringType() + paramsTypeMap["mac_discovery_profile"] = bindings.NewReferenceType(model.MacDiscoveryProfileBindingType) + paramsTypeMap["macDiscoveryProfileId"] = bindings.NewStringType() + pathParams["mac_discovery_profile_id"] = "macDiscoveryProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "mac_discovery_profile", + "PUT", + "/global-manager/api/v1/global-infra/mac-discovery-profiles/{macDiscoveryProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/OverriddenResourcesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/OverriddenResourcesClient.go new file mode 100644 index 000000000..30a15ef68 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/OverriddenResourcesClient.go @@ -0,0 +1,30 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: OverriddenResources + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type OverriddenResourcesClient interface { + + // List overridden resources + // + // @param intentPathParam Global resource path (optional) + // @param sitePathParam Site path (optional) + // @return com.vmware.nsx_global_policy.model.OverriddenResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(intentPathParam *string, sitePathParam *string) (model.OverriddenResourceListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/OverriddenResourcesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/OverriddenResourcesTypes.go new file mode 100644 index 000000000..bea79355c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/OverriddenResourcesTypes.go @@ -0,0 +1,82 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: OverriddenResources. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func overriddenResourcesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func overriddenResourcesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.OverriddenResourceListResultBindingType) +} + +func overriddenResourcesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["site_path"] = "SitePath" + paramsTypeMap["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["site_path"] = "site_path" + queryParams["intent_path"] = "intent_path" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/overridden-resources", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/PortMirroringProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/PortMirroringProfilesClient.go new file mode 100644 index 000000000..0aa2b5d51 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/PortMirroringProfilesClient.go @@ -0,0 +1,77 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: PortMirroringProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type PortMirroringProfilesClient interface { + + // API will delete port mirroring profile. Mirroring from source to destination ports will be stopped. + // + // @param portMirroringProfileIdParam Port Mirroring Profile Id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(portMirroringProfileIdParam string) error + + // API will return details of port mirroring profile. + // + // @param portMirroringProfileIdParam Port Mirroring Profile Id (required) + // @return com.vmware.nsx_global_policy.model.PortMirroringProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(portMirroringProfileIdParam string) (model.PortMirroringProfile, error) + + // API will list all port mirroring profiles group. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PortMirroringProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PortMirroringProfileListResult, error) + + // Create a new Port Mirroring Profile if the Port Mirroring Profile with given id does not already exist. If the Port Mirroring Profile with the given id already exists, patch with the existing Port Mirroring Profile. Realized entities of this API can be found using the path of monitoring profile binding map that is used to apply this profile. + // + // @param portMirroringProfileIdParam Port Mirroring Profile Id (required) + // @param portMirroringProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(portMirroringProfileIdParam string, portMirroringProfileParam model.PortMirroringProfile) error + + // Create or Replace port mirroring profile. Packets will be mirrored from source group, segment, port to destination group. Realized entities of this API can be found using the path of monitoring profile binding map that is used to apply this profile. + // + // @param portMirroringProfileIdParam Port Mirroring Profiles Id (required) + // @param portMirroringProfileParam (required) + // @return com.vmware.nsx_global_policy.model.PortMirroringProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(portMirroringProfileIdParam string, portMirroringProfileParam model.PortMirroringProfile) (model.PortMirroringProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/PortMirroringProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/PortMirroringProfilesTypes.go new file mode 100644 index 000000000..5dc9fc1c3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/PortMirroringProfilesTypes.go @@ -0,0 +1,310 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: PortMirroringProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func portMirroringProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_mirroring_profile_id"] = bindings.NewStringType() + fieldNameMap["port_mirroring_profile_id"] = "PortMirroringProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func portMirroringProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func portMirroringProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["port_mirroring_profile_id"] = bindings.NewStringType() + fieldNameMap["port_mirroring_profile_id"] = "PortMirroringProfileId" + paramsTypeMap["port_mirroring_profile_id"] = bindings.NewStringType() + paramsTypeMap["portMirroringProfileId"] = bindings.NewStringType() + pathParams["port_mirroring_profile_id"] = "portMirroringProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/port-mirroring-profiles/{portMirroringProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func portMirroringProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_mirroring_profile_id"] = bindings.NewStringType() + fieldNameMap["port_mirroring_profile_id"] = "PortMirroringProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func portMirroringProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PortMirroringProfileBindingType) +} + +func portMirroringProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["port_mirroring_profile_id"] = bindings.NewStringType() + fieldNameMap["port_mirroring_profile_id"] = "PortMirroringProfileId" + paramsTypeMap["port_mirroring_profile_id"] = bindings.NewStringType() + paramsTypeMap["portMirroringProfileId"] = bindings.NewStringType() + pathParams["port_mirroring_profile_id"] = "portMirroringProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/port-mirroring-profiles/{portMirroringProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func portMirroringProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func portMirroringProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PortMirroringProfileListResultBindingType) +} + +func portMirroringProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/port-mirroring-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func portMirroringProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_mirroring_profile_id"] = bindings.NewStringType() + fields["port_mirroring_profile"] = bindings.NewReferenceType(model.PortMirroringProfileBindingType) + fieldNameMap["port_mirroring_profile_id"] = "PortMirroringProfileId" + fieldNameMap["port_mirroring_profile"] = "PortMirroringProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func portMirroringProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func portMirroringProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["port_mirroring_profile_id"] = bindings.NewStringType() + fields["port_mirroring_profile"] = bindings.NewReferenceType(model.PortMirroringProfileBindingType) + fieldNameMap["port_mirroring_profile_id"] = "PortMirroringProfileId" + fieldNameMap["port_mirroring_profile"] = "PortMirroringProfile" + paramsTypeMap["port_mirroring_profile_id"] = bindings.NewStringType() + paramsTypeMap["port_mirroring_profile"] = bindings.NewReferenceType(model.PortMirroringProfileBindingType) + paramsTypeMap["portMirroringProfileId"] = bindings.NewStringType() + pathParams["port_mirroring_profile_id"] = "portMirroringProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "port_mirroring_profile", + "PATCH", + "/global-manager/api/v1/global-infra/port-mirroring-profiles/{portMirroringProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func portMirroringProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_mirroring_profile_id"] = bindings.NewStringType() + fields["port_mirroring_profile"] = bindings.NewReferenceType(model.PortMirroringProfileBindingType) + fieldNameMap["port_mirroring_profile_id"] = "PortMirroringProfileId" + fieldNameMap["port_mirroring_profile"] = "PortMirroringProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func portMirroringProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PortMirroringProfileBindingType) +} + +func portMirroringProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["port_mirroring_profile_id"] = bindings.NewStringType() + fields["port_mirroring_profile"] = bindings.NewReferenceType(model.PortMirroringProfileBindingType) + fieldNameMap["port_mirroring_profile_id"] = "PortMirroringProfileId" + fieldNameMap["port_mirroring_profile"] = "PortMirroringProfile" + paramsTypeMap["port_mirroring_profile_id"] = bindings.NewStringType() + paramsTypeMap["port_mirroring_profile"] = bindings.NewReferenceType(model.PortMirroringProfileBindingType) + paramsTypeMap["portMirroringProfileId"] = bindings.NewStringType() + pathParams["port_mirroring_profile_id"] = "portMirroringProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "port_mirroring_profile", + "PUT", + "/global-manager/api/v1/global-infra/port-mirroring-profiles/{portMirroringProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/QosProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/QosProfilesClient.go new file mode 100644 index 000000000..75caf2e4c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/QosProfilesClient.go @@ -0,0 +1,77 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: QosProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type QosProfilesClient interface { + + // API will delete QoS profile. + // + // @param qosProfileIdParam QoS profile Id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(qosProfileIdParam string) error + + // API will return details of QoS profile. + // + // @param qosProfileIdParam QoS profile Id (required) + // @return com.vmware.nsx_global_policy.model.QoSProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(qosProfileIdParam string) (model.QosProfile, error) + + // API will list all QoS profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.QoSProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.QosProfileListResult, error) + + // Create a new QoS profile if the QoS profile with given id does not already exist. If the QoS profile with the given id already exists, patch with the existing QoS profile. + // + // @param qosProfileIdParam QoS profile Id (required) + // @param qosProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(qosProfileIdParam string, qosProfileParam model.QosProfile) error + + // Create or Replace QoS profile. + // + // @param qosProfileIdParam QoS profile Id (required) + // @param qosProfileParam (required) + // @return com.vmware.nsx_global_policy.model.QoSProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(qosProfileIdParam string, qosProfileParam model.QosProfile) (model.QosProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/QosProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/QosProfilesTypes.go new file mode 100644 index 000000000..61a2f3792 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/QosProfilesTypes.go @@ -0,0 +1,310 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: QosProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func qosProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["qos_profile_id"] = bindings.NewStringType() + fieldNameMap["qos_profile_id"] = "QosProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func qosProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func qosProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["qos_profile_id"] = bindings.NewStringType() + fieldNameMap["qos_profile_id"] = "QosProfileId" + paramsTypeMap["qos_profile_id"] = bindings.NewStringType() + paramsTypeMap["qosProfileId"] = bindings.NewStringType() + pathParams["qos_profile_id"] = "qosProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/qos-profiles/{qosProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func qosProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["qos_profile_id"] = bindings.NewStringType() + fieldNameMap["qos_profile_id"] = "QosProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func qosProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.QosProfileBindingType) +} + +func qosProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["qos_profile_id"] = bindings.NewStringType() + fieldNameMap["qos_profile_id"] = "QosProfileId" + paramsTypeMap["qos_profile_id"] = bindings.NewStringType() + paramsTypeMap["qosProfileId"] = bindings.NewStringType() + pathParams["qos_profile_id"] = "qosProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/qos-profiles/{qosProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func qosProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func qosProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.QosProfileListResultBindingType) +} + +func qosProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/qos-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func qosProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["qos_profile_id"] = bindings.NewStringType() + fields["qos_profile"] = bindings.NewReferenceType(model.QosProfileBindingType) + fieldNameMap["qos_profile_id"] = "QosProfileId" + fieldNameMap["qos_profile"] = "QosProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func qosProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func qosProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["qos_profile_id"] = bindings.NewStringType() + fields["qos_profile"] = bindings.NewReferenceType(model.QosProfileBindingType) + fieldNameMap["qos_profile_id"] = "QosProfileId" + fieldNameMap["qos_profile"] = "QosProfile" + paramsTypeMap["qos_profile_id"] = bindings.NewStringType() + paramsTypeMap["qos_profile"] = bindings.NewReferenceType(model.QosProfileBindingType) + paramsTypeMap["qosProfileId"] = bindings.NewStringType() + pathParams["qos_profile_id"] = "qosProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "qos_profile", + "PATCH", + "/global-manager/api/v1/global-infra/qos-profiles/{qosProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func qosProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["qos_profile_id"] = bindings.NewStringType() + fields["qos_profile"] = bindings.NewReferenceType(model.QosProfileBindingType) + fieldNameMap["qos_profile_id"] = "QosProfileId" + fieldNameMap["qos_profile"] = "QosProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func qosProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.QosProfileBindingType) +} + +func qosProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["qos_profile_id"] = bindings.NewStringType() + fields["qos_profile"] = bindings.NewReferenceType(model.QosProfileBindingType) + fieldNameMap["qos_profile_id"] = "QosProfileId" + fieldNameMap["qos_profile"] = "QosProfile" + paramsTypeMap["qos_profile_id"] = bindings.NewStringType() + paramsTypeMap["qos_profile"] = bindings.NewReferenceType(model.QosProfileBindingType) + paramsTypeMap["qosProfileId"] = bindings.NewStringType() + pathParams["qos_profile_id"] = "qosProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "qos_profile", + "PUT", + "/global-manager/api/v1/global-infra/qos-profiles/{qosProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentSecurityProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentSecurityProfilesClient.go new file mode 100644 index 000000000..f00158a2d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentSecurityProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SegmentSecurityProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SegmentSecurityProfilesClient interface { + + // API will delete segment security profile with the given id. + // + // @param segmentSecurityProfileIdParam Segment security profile id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(segmentSecurityProfileIdParam string) error + + // API will return details of the segment security profile with given id. If the profile does not exist, it will return 404. + // + // @param segmentSecurityProfileIdParam Segment security profile id (required) + // @return com.vmware.nsx_global_policy.model.SegmentSecurityProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(segmentSecurityProfileIdParam string) (model.SegmentSecurityProfile, error) + + // API will list all segment security profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentSecurityProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentSecurityProfileListResult, error) + + // Create a new segment security profile if the segment security profile with given id does not exist. Otherwise, PATCH the existing segment security profile + // + // @param segmentSecurityProfileIdParam Segment security profile id (required) + // @param segmentSecurityProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(segmentSecurityProfileIdParam string, segmentSecurityProfileParam model.SegmentSecurityProfile) error + + // Create or replace a segment security profile + // + // @param segmentSecurityProfileIdParam Segment security profile id (required) + // @param segmentSecurityProfileParam (required) + // @return com.vmware.nsx_global_policy.model.SegmentSecurityProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(segmentSecurityProfileIdParam string, segmentSecurityProfileParam model.SegmentSecurityProfile) (model.SegmentSecurityProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentSecurityProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentSecurityProfilesTypes.go new file mode 100644 index 000000000..cd72ef4d5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentSecurityProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SegmentSecurityProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func segmentSecurityProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_security_profile_id"] = bindings.NewStringType() + fieldNameMap["segment_security_profile_id"] = "SegmentSecurityProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentSecurityProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_security_profile_id"] = bindings.NewStringType() + fieldNameMap["segment_security_profile_id"] = "SegmentSecurityProfileId" + paramsTypeMap["segment_security_profile_id"] = bindings.NewStringType() + paramsTypeMap["segmentSecurityProfileId"] = bindings.NewStringType() + pathParams["segment_security_profile_id"] = "segmentSecurityProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/segment-security-profiles/{segmentSecurityProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentSecurityProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_security_profile_id"] = bindings.NewStringType() + fieldNameMap["segment_security_profile_id"] = "SegmentSecurityProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentSecurityProfileBindingType) +} + +func segmentSecurityProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_security_profile_id"] = bindings.NewStringType() + fieldNameMap["segment_security_profile_id"] = "SegmentSecurityProfileId" + paramsTypeMap["segment_security_profile_id"] = bindings.NewStringType() + paramsTypeMap["segmentSecurityProfileId"] = bindings.NewStringType() + pathParams["segment_security_profile_id"] = "segmentSecurityProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segment-security-profiles/{segmentSecurityProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentSecurityProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentSecurityProfileListResultBindingType) +} + +func segmentSecurityProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segment-security-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentSecurityProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_security_profile_id"] = bindings.NewStringType() + fields["segment_security_profile"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingType) + fieldNameMap["segment_security_profile_id"] = "SegmentSecurityProfileId" + fieldNameMap["segment_security_profile"] = "SegmentSecurityProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentSecurityProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_security_profile_id"] = bindings.NewStringType() + fields["segment_security_profile"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingType) + fieldNameMap["segment_security_profile_id"] = "SegmentSecurityProfileId" + fieldNameMap["segment_security_profile"] = "SegmentSecurityProfile" + paramsTypeMap["segment_security_profile_id"] = bindings.NewStringType() + paramsTypeMap["segment_security_profile"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingType) + paramsTypeMap["segmentSecurityProfileId"] = bindings.NewStringType() + pathParams["segment_security_profile_id"] = "segmentSecurityProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_security_profile", + "PATCH", + "/global-manager/api/v1/global-infra/segment-security-profiles/{segmentSecurityProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentSecurityProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_security_profile_id"] = bindings.NewStringType() + fields["segment_security_profile"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingType) + fieldNameMap["segment_security_profile_id"] = "SegmentSecurityProfileId" + fieldNameMap["segment_security_profile"] = "SegmentSecurityProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentSecurityProfileBindingType) +} + +func segmentSecurityProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_security_profile_id"] = bindings.NewStringType() + fields["segment_security_profile"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingType) + fieldNameMap["segment_security_profile_id"] = "SegmentSecurityProfileId" + fieldNameMap["segment_security_profile"] = "SegmentSecurityProfile" + paramsTypeMap["segment_security_profile_id"] = bindings.NewStringType() + paramsTypeMap["segment_security_profile"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingType) + paramsTypeMap["segmentSecurityProfileId"] = bindings.NewStringType() + pathParams["segment_security_profile_id"] = "segmentSecurityProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_security_profile", + "PUT", + "/global-manager/api/v1/global-infra/segment-security-profiles/{segmentSecurityProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentsClient.go new file mode 100644 index 000000000..a35fcb171 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentsClient.go @@ -0,0 +1,111 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Segments + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SegmentsClient interface { + + // Delete infra segment + // + // @param segmentIdParam Segment ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(segmentIdParam string) error + + // Force delete bypasses validations during segment deletion. This may result in an inconsistent connectivity. + // + // @param segmentIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete0(segmentIdParam string) error + + // Read infra segment + // + // @param segmentIdParam Segment ID (required) + // @return com.vmware.nsx_global_policy.model.Segment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(segmentIdParam string) (model.Segment, error) + + // Paginated list of all segments under infra. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentListResult, error) + + // If segment with the segment-id is not already present, create a new segment. If it already exists, update the segment with specified attributes. + // + // @param segmentIdParam Segment ID (required) + // @param segmentParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(segmentIdParam string, segmentParam model.Segment) error + + // If segment with the segment-id is not already present, create a new segment. If it already exists, update the segment with specified attributes. Force parameter is required when workload connectivity is indirectly impacted with the current update. + // + // @param segmentIdParam Segment ID (required) + // @param segmentParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch0(segmentIdParam string, segmentParam model.Segment) error + + // If segment with the segment-id is not already present, create a new segment. If it already exists, replace the segment with this object. + // + // @param segmentIdParam Segment ID (required) + // @param segmentParam (required) + // @return com.vmware.nsx_global_policy.model.Segment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(segmentIdParam string, segmentParam model.Segment) (model.Segment, error) + + // If segment with the segment-id is not already present, create a new segment. If it already exists, replace the segment with this object. Force parameter is required when workload connectivity is indirectly impacted with the current replacement. + // + // @param segmentIdParam Segment ID (required) + // @param segmentParam (required) + // @return com.vmware.nsx_global_policy.model.Segment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update0(segmentIdParam string, segmentParam model.Segment) (model.Segment, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentsTypes.go new file mode 100644 index 000000000..f8ccba038 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SegmentsTypes.go @@ -0,0 +1,476 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Segments. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func segmentsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/segments/{segmentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsDelete0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsDelete0OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentsDelete0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "force=true", + "", + "DELETE", + "/global-manager/api/v1/global-infra/segments/{segmentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentBindingType) +} + +func segmentsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentListResultBindingType) +} + +func segmentsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment", + "PATCH", + "/global-manager/api/v1/global-infra/segments/{segmentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsPatch0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsPatch0OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentsPatch0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "force=true", + "segment", + "PATCH", + "/global-manager/api/v1/global-infra/segments/{segmentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentBindingType) +} + +func segmentsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment", + "PUT", + "/global-manager/api/v1/global-infra/segments/{segmentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsUpdate0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsUpdate0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentBindingType) +} + +func segmentsUpdate0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "force=true", + "segment", + "PUT", + "/global-manager/api/v1/global-infra/segments/{segmentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ServicesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ServicesClient.go new file mode 100644 index 000000000..7cd945e81 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ServicesClient.go @@ -0,0 +1,79 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Services + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type ServicesClient interface { + + // Delete Service + // + // @param serviceIdParam Service ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string) error + + // Read a service + // + // @param serviceIdParam Service ID (required) + // @return com.vmware.nsx_global_policy.model.Service + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string) (model.Service, error) + + // Paginated list of Services for infra. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param defaultServiceParam Fetch all default services (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.ServiceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, defaultServiceParam *bool, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ServiceListResult, error) + + // Create a new service if a service with the given ID does not already exist. Creates new service entries if populated in the service. If a service with the given ID already exists, patch the service including the nested service entries. + // + // @param serviceIdParam Service ID (required) + // @param serviceParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(serviceIdParam string, serviceParam model.Service) error + + // Create a new service if a service with the given ID does not already exist. Creates new service entries if populated in the service. If a service with the given ID already exists, update the service including the nested service entries. This is a full replace. + // + // @param serviceIdParam Service ID (required) + // @param serviceParam (required) + // @return com.vmware.nsx_global_policy.model.Service + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceIdParam string, serviceParam model.Service) (model.Service, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ServicesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ServicesTypes.go new file mode 100644 index 000000000..95efd0a8f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/ServicesTypes.go @@ -0,0 +1,322 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Services. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func servicesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func servicesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/services/{serviceId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceBindingType) +} + +func servicesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/services/{serviceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["default_service"] = "DefaultService" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceListResultBindingType) +} + +func servicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["default_service"] = "DefaultService" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["default_service"] = "default_service" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/services", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service"] = bindings.NewReferenceType(model.ServiceBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service"] = "Service" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func servicesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service"] = bindings.NewReferenceType(model.ServiceBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service"] = "Service" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service"] = bindings.NewReferenceType(model.ServiceBindingType) + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service", + "PATCH", + "/global-manager/api/v1/global-infra/services/{serviceId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service"] = bindings.NewReferenceType(model.ServiceBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service"] = "Service" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceBindingType) +} + +func servicesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service"] = bindings.NewReferenceType(model.ServiceBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service"] = "Service" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service"] = bindings.NewReferenceType(model.ServiceBindingType) + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service", + "PUT", + "/global-manager/api/v1/global-infra/services/{serviceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SitesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SitesClient.go new file mode 100644 index 000000000..7aa418d7b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SitesClient.go @@ -0,0 +1,79 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Sites + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SitesClient interface { + + // Delete a site under Infra. + // + // @param siteIdParam (required) + // @param forceParam (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(siteIdParam string, forceParam *bool) error + + // Read a site under Infra. + // + // @param siteIdParam (required) + // @return com.vmware.nsx_global_policy.model.Site + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(siteIdParam string) (model.Site, error) + + // List Sites under Infra. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SiteListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SiteListResult, error) + + // Create or patch Site under Infra. + // + // @param siteIdParam (required) + // @param siteParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(siteIdParam string, siteParam model.Site) error + + // Create or fully replace a Site under Infra. Revision is optional for creation and required for update. + // + // @param siteIdParam (required) + // @param siteParam (required) + // @return com.vmware.nsx_global_policy.model.Site + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(siteIdParam string, siteParam model.Site) (model.Site, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SitesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SitesTypes.go new file mode 100644 index 000000000..c9b9f9792 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SitesTypes.go @@ -0,0 +1,322 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Sites. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func sitesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sitesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["site_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["site_id"] = bindings.NewStringType() + paramsTypeMap["siteId"] = bindings.NewStringType() + pathParams["site_id"] = "siteId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/sites/{siteId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sitesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_id"] = bindings.NewStringType() + fieldNameMap["site_id"] = "SiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SiteBindingType) +} + +func sitesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["site_id"] = bindings.NewStringType() + fieldNameMap["site_id"] = "SiteId" + paramsTypeMap["site_id"] = bindings.NewStringType() + paramsTypeMap["siteId"] = bindings.NewStringType() + pathParams["site_id"] = "siteId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/sites/{siteId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sitesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SiteListResultBindingType) +} + +func sitesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/sites", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sitesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_id"] = bindings.NewStringType() + fields["site"] = bindings.NewReferenceType(model.SiteBindingType) + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["site"] = "Site" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sitesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["site_id"] = bindings.NewStringType() + fields["site"] = bindings.NewReferenceType(model.SiteBindingType) + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["site"] = "Site" + paramsTypeMap["site_id"] = bindings.NewStringType() + paramsTypeMap["site"] = bindings.NewReferenceType(model.SiteBindingType) + paramsTypeMap["siteId"] = bindings.NewStringType() + pathParams["site_id"] = "siteId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "site", + "PATCH", + "/global-manager/api/v1/global-infra/sites/{siteId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sitesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_id"] = bindings.NewStringType() + fields["site"] = bindings.NewReferenceType(model.SiteBindingType) + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["site"] = "Site" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SiteBindingType) +} + +func sitesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["site_id"] = bindings.NewStringType() + fields["site"] = bindings.NewReferenceType(model.SiteBindingType) + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["site"] = "Site" + paramsTypeMap["site_id"] = bindings.NewStringType() + paramsTypeMap["site"] = bindings.NewReferenceType(model.SiteBindingType) + paramsTypeMap["siteId"] = bindings.NewStringType() + pathParams["site_id"] = "siteId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "site", + "PUT", + "/global-manager/api/v1/global-infra/sites/{siteId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpanClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpanClient.go new file mode 100644 index 000000000..abe205016 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpanClient.go @@ -0,0 +1,30 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Span + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SpanClient interface { + + // Get span for an entity with specified path. + // + // @param intentPathParam String Path of the intent object (required) + // @param sitePathParam Policy Path of the site (optional) + // @return com.vmware.nsx_global_policy.model.Span + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(intentPathParam string, sitePathParam *string) (model.Span, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpanTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpanTypes.go new file mode 100644 index 000000000..bede1f81e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpanTypes.go @@ -0,0 +1,82 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Span. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func spanGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewStringType() + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func spanGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SpanBindingType) +} + +func spanGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["intent_path"] = bindings.NewStringType() + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["site_path"] = "SitePath" + paramsTypeMap["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["intent_path"] = bindings.NewStringType() + queryParams["site_path"] = "site_path" + queryParams["intent_path"] = "intent_path" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/span", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpoofguardProfilesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpoofguardProfilesClient.go new file mode 100644 index 000000000..43623bbf5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpoofguardProfilesClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SpoofguardProfiles + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SpoofguardProfilesClient interface { + + // API will delete SpoofGuard profile with the given id. + // + // @param spoofguardProfileIdParam SpoofGuard profile id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(spoofguardProfileIdParam string) error + + // API will return details of the SpoofGuard profile with given id. If the profile does not exist, it will return 404. + // + // @param spoofguardProfileIdParam SpoofGuard profile id (required) + // @return com.vmware.nsx_global_policy.model.SpoofGuardProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(spoofguardProfileIdParam string) (model.SpoofGuardProfile, error) + + // API will list all SpoofGuard profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SpoofGuardProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SpoofGuardProfileListResult, error) + + // Create a new SpoofGuard profile if the SpoofGuard profile with the given id does not exist. Otherwise, patch with the existing SpoofGuard profile. + // + // @param spoofguardProfileIdParam SpoofGuard profile id (required) + // @param spoofGuardProfileParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(spoofguardProfileIdParam string, spoofGuardProfileParam model.SpoofGuardProfile) error + + // API will create or replace SpoofGuard profile. + // + // @param spoofguardProfileIdParam SpoofGuard profile id (required) + // @param spoofGuardProfileParam (required) + // @return com.vmware.nsx_global_policy.model.SpoofGuardProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(spoofguardProfileIdParam string, spoofGuardProfileParam model.SpoofGuardProfile) (model.SpoofGuardProfile, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpoofguardProfilesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpoofguardProfilesTypes.go new file mode 100644 index 000000000..5fbdd0b6c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/SpoofguardProfilesTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SpoofguardProfiles. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func spoofguardProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["spoofguard_profile_id"] = bindings.NewStringType() + fieldNameMap["spoofguard_profile_id"] = "SpoofguardProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func spoofguardProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func spoofguardProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["spoofguard_profile_id"] = bindings.NewStringType() + fieldNameMap["spoofguard_profile_id"] = "SpoofguardProfileId" + paramsTypeMap["spoofguard_profile_id"] = bindings.NewStringType() + paramsTypeMap["spoofguardProfileId"] = bindings.NewStringType() + pathParams["spoofguard_profile_id"] = "spoofguardProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/spoofguard-profiles/{spoofguardProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func spoofguardProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["spoofguard_profile_id"] = bindings.NewStringType() + fieldNameMap["spoofguard_profile_id"] = "SpoofguardProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func spoofguardProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SpoofGuardProfileBindingType) +} + +func spoofguardProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["spoofguard_profile_id"] = bindings.NewStringType() + fieldNameMap["spoofguard_profile_id"] = "SpoofguardProfileId" + paramsTypeMap["spoofguard_profile_id"] = bindings.NewStringType() + paramsTypeMap["spoofguardProfileId"] = bindings.NewStringType() + pathParams["spoofguard_profile_id"] = "spoofguardProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/spoofguard-profiles/{spoofguardProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func spoofguardProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func spoofguardProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SpoofGuardProfileListResultBindingType) +} + +func spoofguardProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/spoofguard-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func spoofguardProfilesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["spoofguard_profile_id"] = bindings.NewStringType() + fields["spoof_guard_profile"] = bindings.NewReferenceType(model.SpoofGuardProfileBindingType) + fieldNameMap["spoofguard_profile_id"] = "SpoofguardProfileId" + fieldNameMap["spoof_guard_profile"] = "SpoofGuardProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func spoofguardProfilesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func spoofguardProfilesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["spoofguard_profile_id"] = bindings.NewStringType() + fields["spoof_guard_profile"] = bindings.NewReferenceType(model.SpoofGuardProfileBindingType) + fieldNameMap["spoofguard_profile_id"] = "SpoofguardProfileId" + fieldNameMap["spoof_guard_profile"] = "SpoofGuardProfile" + paramsTypeMap["spoof_guard_profile"] = bindings.NewReferenceType(model.SpoofGuardProfileBindingType) + paramsTypeMap["spoofguard_profile_id"] = bindings.NewStringType() + paramsTypeMap["spoofguardProfileId"] = bindings.NewStringType() + pathParams["spoofguard_profile_id"] = "spoofguardProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "spoof_guard_profile", + "PATCH", + "/global-manager/api/v1/global-infra/spoofguard-profiles/{spoofguardProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func spoofguardProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["spoofguard_profile_id"] = bindings.NewStringType() + fields["spoof_guard_profile"] = bindings.NewReferenceType(model.SpoofGuardProfileBindingType) + fieldNameMap["spoofguard_profile_id"] = "SpoofguardProfileId" + fieldNameMap["spoof_guard_profile"] = "SpoofGuardProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func spoofguardProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SpoofGuardProfileBindingType) +} + +func spoofguardProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["spoofguard_profile_id"] = bindings.NewStringType() + fields["spoof_guard_profile"] = bindings.NewReferenceType(model.SpoofGuardProfileBindingType) + fieldNameMap["spoofguard_profile_id"] = "SpoofguardProfileId" + fieldNameMap["spoof_guard_profile"] = "SpoofGuardProfile" + paramsTypeMap["spoof_guard_profile"] = bindings.NewReferenceType(model.SpoofGuardProfileBindingType) + paramsTypeMap["spoofguard_profile_id"] = bindings.NewStringType() + paramsTypeMap["spoofguardProfileId"] = bindings.NewStringType() + pathParams["spoofguard_profile_id"] = "spoofguardProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "spoof_guard_profile", + "PUT", + "/global-manager/api/v1/global-infra/spoofguard-profiles/{spoofguardProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/TagsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/TagsClient.go new file mode 100644 index 000000000..9608727d6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/TagsClient.go @@ -0,0 +1,37 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Tags + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type TagsClient interface { + + // Returns paginated list of all unique tags. Supports filtering by scope, tag and source from which tags are synched. Supports starts with, equals and contains operators on scope and tag values. To filter tags by starts with on scope or tag, use '\*' as prefix before the value. To filter tags by ends with on scope or tag, use '\*' as suffix after the value. To filter tags by contain on scope or tag, use '\*' as prefix and suffix on the value. Below special characters in the filter value needs to be escaped with hex values. - Character '&' needs to be escaped as '%26' - Character '[' needs to be escaped as '%5B' - Character ']' needs to be escaped as '%5D' - Character '+' needs to be escaped as '%2B' - Character '#' needs to be escaped as '%23' + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param scopeParam Tag scope (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Source from which tags are synced. (optional) + // @param tagParam Tag value (optional) + // @return com.vmware.nsx_global_policy.model.TagInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, scopeParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, tagParam *string) (model.TagInfoListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/TagsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/TagsTypes.go new file mode 100644 index 000000000..a36305471 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/TagsTypes.go @@ -0,0 +1,132 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Tags. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``source`` of method Tags#list. +const Tags_LIST_SOURCE_AMAZON = "Amazon" +// Possible value for ``source`` of method Tags#list. +const Tags_LIST_SOURCE_AZURE = "Azure" +// Possible value for ``source`` of method Tags#list. +const Tags_LIST_SOURCE_NSX = "NSX" +// Possible value for ``source`` of method Tags#list. +const Tags_LIST_SOURCE_ANY = "ANY" + + + + +func tagsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope"] = "Scope" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["tag"] = "Tag" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tagsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TagInfoListResultBindingType) +} + +func tagsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope"] = "Scope" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["tag"] = "Tag" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["scope"] = "scope" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["tag"] = "tag" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tags", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier0sClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier0sClient.go new file mode 100644 index 000000000..d4c7d7a62 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier0sClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Tier0s + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type Tier0sClient interface { + + // Delete Tier-0 + // + // @param tier0IdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string) error + + // Read Tier-0 + // + // @param tier0IdParam (required) + // @return com.vmware.nsx_global_policy.model.Tier0 + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string) (model.Tier0, error) + + // Paginated list of all Tier-0s + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.Tier0ListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier0ListResult, error) + + // If a Tier-0 with the tier-0-id is not already present, create a new Tier-0. If it already exists, update the Tier-0 for specified attributes. + // + // @param tier0IdParam (required) + // @param tier0Param (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, tier0Param model.Tier0) error + + // If a Tier-0 with the tier-0-id is not already present, create a new Tier-0. If it already exists, replace the Tier-0 instance with the new object. + // + // @param tier0IdParam (required) + // @param tier0Param (required) + // @return com.vmware.nsx_global_policy.model.Tier0 + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, tier0Param model.Tier0) (model.Tier0, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier0sTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier0sTypes.go new file mode 100644 index 000000000..ac6ec2874 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier0sTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Tier0s. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func tier0sDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier0sDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func tier0sDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func tier0sGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier0sGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier0BindingType) +} + +func tier0sGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func tier0sListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier0sListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier0ListResultBindingType) +} + +func tier0sListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func tier0sPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["tier0"] = bindings.NewReferenceType(model.Tier0BindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["tier0"] = "Tier0" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier0sPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func tier0sPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["tier0"] = bindings.NewReferenceType(model.Tier0BindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["tier0"] = "Tier0" + paramsTypeMap["tier0"] = bindings.NewReferenceType(model.Tier0BindingType) + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tier0", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func tier0sUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["tier0"] = bindings.NewReferenceType(model.Tier0BindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["tier0"] = "Tier0" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier0sUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier0BindingType) +} + +func tier0sUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["tier0"] = bindings.NewReferenceType(model.Tier0BindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["tier0"] = "Tier0" + paramsTypeMap["tier0"] = bindings.NewReferenceType(model.Tier0BindingType) + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tier0", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier1sClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier1sClient.go new file mode 100644 index 000000000..52c75f140 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier1sClient.go @@ -0,0 +1,78 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Tier1s + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type Tier1sClient interface { + + // Delete Tier-1 configuration + // + // @param tier1IdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier1IdParam string) error + + // Read Tier-1 configuration + // + // @param tier1IdParam (required) + // @return com.vmware.nsx_global_policy.model.Tier1 + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier1IdParam string) (model.Tier1, error) + + // Paginated list of all Tier-1 instances + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.Tier1ListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier1ListResult, error) + + // If Tier-1 with the tier-1-id is not already present, create a new Tier-1 instance. If it already exists, update the tier-1 instance with specified attributes. + // + // @param tier1IdParam (required) + // @param tier1Param (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier1IdParam string, tier1Param model.Tier1) error + + // If Tier-1 with the tier-1-id is not already present, create a new Tier-1 instance. If it already exists, replace the Tier-1 instance with this object. + // + // @param tier1IdParam (required) + // @param tier1Param (required) + // @return com.vmware.nsx_global_policy.model.Tier1 + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier1IdParam string, tier1Param model.Tier1) (model.Tier1, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier1sTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier1sTypes.go new file mode 100644 index 000000000..53df14da9 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/Tier1sTypes.go @@ -0,0 +1,316 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Tier1s. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func tier1sDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier1sDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func tier1sDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func tier1sGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier1sGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier1BindingType) +} + +func tier1sGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func tier1sListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier1sListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier1ListResultBindingType) +} + +func tier1sListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func tier1sPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["tier1"] = bindings.NewReferenceType(model.Tier1BindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["tier1"] = "Tier1" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier1sPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func tier1sPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["tier1"] = bindings.NewReferenceType(model.Tier1BindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["tier1"] = "Tier1" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1"] = bindings.NewReferenceType(model.Tier1BindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tier1", + "PATCH", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func tier1sUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["tier1"] = bindings.NewReferenceType(model.Tier1BindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["tier1"] = "Tier1" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tier1sUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier1BindingType) +} + +func tier1sUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["tier1"] = bindings.NewReferenceType(model.Tier1BindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["tier1"] = "Tier1" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1"] = bindings.NewReferenceType(model.Tier1BindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tier1", + "PUT", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/UpgradeSummaryClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/UpgradeSummaryClient.go new file mode 100644 index 000000000..73c375ae4 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/UpgradeSummaryClient.go @@ -0,0 +1,34 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: UpgradeSummary + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type UpgradeSummaryClient interface { + + // API will return high level summary of Upgrade across various sites. + // + // @param currentVersionParam Filter on site current_version (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.FederationUpgradeSummaryListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(currentVersionParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.FederationUpgradeSummaryListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/UpgradeSummaryTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/UpgradeSummaryTypes.go new file mode 100644 index 000000000..678041b23 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/UpgradeSummaryTypes.go @@ -0,0 +1,106 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: UpgradeSummary. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func upgradeSummaryListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_version"] = "CurrentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeSummaryListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FederationUpgradeSummaryListResultBindingType) +} + +func upgradeSummaryListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_version"] = "CurrentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["current_version"] = "current_version" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/upgrade-summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualMachineGroupAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualMachineGroupAssociationsClient.go new file mode 100644 index 000000000..32e272661 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualMachineGroupAssociationsClient.go @@ -0,0 +1,36 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: VirtualMachineGroupAssociations + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type VirtualMachineGroupAssociationsClient interface { + + // Get policy groups for which the given VM is a member. + // + // @param vmExternalIdParam Virtual machine external ID (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param enforcementPointPathParam String Path of the enforcement point (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyResourceReferenceForEPListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(vmExternalIdParam string, cursorParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceForEPListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualMachineGroupAssociationsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualMachineGroupAssociationsTypes.go new file mode 100644 index 000000000..3d0c3692c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualMachineGroupAssociationsTypes.go @@ -0,0 +1,118 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: VirtualMachineGroupAssociations. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func virtualMachineGroupAssociationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["vm_external_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_external_id"] = "VmExternalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualMachineGroupAssociationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyResourceReferenceForEPListResultBindingType) +} + +func virtualMachineGroupAssociationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["vm_external_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_external_id"] = "VmExternalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["vm_external_id"] = bindings.NewStringType() + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["vm_external_id"] = "vm_external_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/virtual-machine-group-associations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualNetworkInterfaceGroupAssociationsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualNetworkInterfaceGroupAssociationsClient.go new file mode 100644 index 000000000..7b2a54620 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualNetworkInterfaceGroupAssociationsClient.go @@ -0,0 +1,36 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: VirtualNetworkInterfaceGroupAssociations + * Used by client-side stubs. + */ + +package global_infra + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type VirtualNetworkInterfaceGroupAssociationsClient interface { + + // Get policy groups for which the given VIF is a member. + // + // @param vifExternalIdParam Virtual network interface external ID (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param enforcementPointPathParam String Path of the enforcement point (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyResourceReferenceForEPListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(vifExternalIdParam string, cursorParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyResourceReferenceForEPListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualNetworkInterfaceGroupAssociationsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualNetworkInterfaceGroupAssociationsTypes.go new file mode 100644 index 000000000..ab2b25dfd --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/VirtualNetworkInterfaceGroupAssociationsTypes.go @@ -0,0 +1,118 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: VirtualNetworkInterfaceGroupAssociations. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package global_infra + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func virtualNetworkInterfaceGroupAssociationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["vif_external_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vif_external_id"] = "VifExternalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualNetworkInterfaceGroupAssociationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyResourceReferenceForEPListResultBindingType) +} + +func virtualNetworkInterfaceGroupAssociationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["vif_external_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vif_external_id"] = "VifExternalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["vif_external_id"] = bindings.NewStringType() + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["vif_external_id"] = "vif_external_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/virtual-network-interface-group-associations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultDomainDeploymentMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultDomainDeploymentMapsClient.go new file mode 100644 index 000000000..2092f18e8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultDomainDeploymentMapsClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: DomainDeploymentMaps + * Functions that implement the generated DomainDeploymentMapsClient interface + */ + + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDomainDeploymentMapsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDomainDeploymentMapsClient(connector client.Connector) *DefaultDomainDeploymentMapsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.domains.domain_deployment_maps" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDomainDeploymentMapsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDomainDeploymentMapsClient) Delete(domainIdParam string, domainDeploymentMapIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(domainDeploymentMapsDeleteInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("DomainDeploymentMapId", domainDeploymentMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainDeploymentMapsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDomainDeploymentMapsClient) Get(domainIdParam string, domainDeploymentMapIdParam string) (model.DomainDeploymentMap, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(domainDeploymentMapsGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("DomainDeploymentMapId", domainDeploymentMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DomainDeploymentMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainDeploymentMapsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DomainDeploymentMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainDeploymentMapsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DomainDeploymentMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDomainDeploymentMapsClient) List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DomainDeploymentMapListResult, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(domainDeploymentMapsListInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DomainDeploymentMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainDeploymentMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DomainDeploymentMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainDeploymentMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DomainDeploymentMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDomainDeploymentMapsClient) Patch(domainIdParam string, domainDeploymentMapIdParam string, domainDeploymentMapParam model.DomainDeploymentMap) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(domainDeploymentMapsPatchInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("DomainDeploymentMapId", domainDeploymentMapIdParam) + sv.AddStructField("DomainDeploymentMap", domainDeploymentMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainDeploymentMapsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDomainDeploymentMapsClient) Update(domainIdParam string, domainDeploymentMapIdParam string, domainDeploymentMapParam model.DomainDeploymentMap) (model.DomainDeploymentMap, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(domainDeploymentMapsUpdateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("DomainDeploymentMapId", domainDeploymentMapIdParam) + sv.AddStructField("DomainDeploymentMap", domainDeploymentMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DomainDeploymentMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainDeploymentMapsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DomainDeploymentMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainDeploymentMapsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DomainDeploymentMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDomainDeploymentMapsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDomainDeploymentMapsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDomainDeploymentMapsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDomainDeploymentMapsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDomainDeploymentMapsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDomainDeploymentMapsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(domainDeploymentMapsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDomainDeploymentMapsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultFirewallFloodProtectionProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultFirewallFloodProtectionProfileBindingMapsClient.go new file mode 100644 index 000000000..9b7202ce5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultFirewallFloodProtectionProfileBindingMapsClient.go @@ -0,0 +1,182 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FirewallFloodProtectionProfileBindingMaps + * Functions that implement the generated FirewallFloodProtectionProfileBindingMapsClient interface + */ + + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFirewallFloodProtectionProfileBindingMapsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFirewallFloodProtectionProfileBindingMapsClient(connector client.Connector) *DefaultFirewallFloodProtectionProfileBindingMapsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.domains.firewall_flood_protection_profile_binding_maps" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFirewallFloodProtectionProfileBindingMapsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + return &fIface +} + +func (fIface *DefaultFirewallFloodProtectionProfileBindingMapsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyFirewallFloodProtectionProfileBindingMapListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(firewallFloodProtectionProfileBindingMapsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyFirewallFloodProtectionProfileBindingMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallFloodProtectionProfileBindingMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyFirewallFloodProtectionProfileBindingMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), firewallFloodProtectionProfileBindingMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyFirewallFloodProtectionProfileBindingMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFirewallFloodProtectionProfileBindingMapsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFirewallFloodProtectionProfileBindingMapsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallFloodProtectionProfileBindingMapsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallFloodProtectionProfileBindingMapsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallFloodProtectionProfileBindingMapsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallFloodProtectionProfileBindingMapsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallFloodProtectionProfileBindingMapsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallFloodProtectionProfileBindingMapsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallFloodProtectionProfileBindingMapsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallFloodProtectionProfileBindingMapsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallFloodProtectionProfileBindingMapsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultFirewallSessionTimerProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultFirewallSessionTimerProfileBindingMapsClient.go new file mode 100644 index 000000000..58ee611ff --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultFirewallSessionTimerProfileBindingMapsClient.go @@ -0,0 +1,182 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FirewallSessionTimerProfileBindingMaps + * Functions that implement the generated FirewallSessionTimerProfileBindingMapsClient interface + */ + + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFirewallSessionTimerProfileBindingMapsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFirewallSessionTimerProfileBindingMapsClient(connector client.Connector) *DefaultFirewallSessionTimerProfileBindingMapsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.domains.firewall_session_timer_profile_binding_maps" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFirewallSessionTimerProfileBindingMapsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + return &fIface +} + +func (fIface *DefaultFirewallSessionTimerProfileBindingMapsClient) List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyFirewallSessionTimerProfileBindingMapListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(firewallSessionTimerProfileBindingMapsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyFirewallSessionTimerProfileBindingMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := firewallSessionTimerProfileBindingMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyFirewallSessionTimerProfileBindingMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), firewallSessionTimerProfileBindingMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyFirewallSessionTimerProfileBindingMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFirewallSessionTimerProfileBindingMapsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFirewallSessionTimerProfileBindingMapsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfileBindingMapsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(firewallSessionTimerProfileBindingMapsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfileBindingMapsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfileBindingMapsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfileBindingMapsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfileBindingMapsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfileBindingMapsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfileBindingMapsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFirewallSessionTimerProfileBindingMapsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultForwardingPoliciesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultForwardingPoliciesClient.go new file mode 100644 index 000000000..633e418de --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultForwardingPoliciesClient.go @@ -0,0 +1,282 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: ForwardingPolicies + * Functions that implement the generated ForwardingPoliciesClient interface + */ + + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultForwardingPoliciesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultForwardingPoliciesClient(connector client.Connector) *DefaultForwardingPoliciesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.domains.forwarding_policies" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultForwardingPoliciesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["get"] = fIface.getMethodDefinition() + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + return &fIface +} + +func (fIface *DefaultForwardingPoliciesClient) Get(domainIdParam string, forwardingPolicyIdParam string) (model.ForwardingPolicy, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(forwardingPoliciesGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("ForwardingPolicyId", forwardingPolicyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ForwardingPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardingPoliciesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.ForwardingPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardingPoliciesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ForwardingPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultForwardingPoliciesClient) List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includeRuleCountParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ForwardingPolicyListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(forwardingPoliciesListInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludeRuleCount", includeRuleCountParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ForwardingPolicyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardingPoliciesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.ForwardingPolicyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardingPoliciesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ForwardingPolicyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultForwardingPoliciesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultForwardingPoliciesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(forwardingPoliciesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(forwardingPoliciesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultForwardingPoliciesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(forwardingPoliciesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(forwardingPoliciesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingPoliciesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultGatewayPoliciesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultGatewayPoliciesClient.go new file mode 100644 index 000000000..95a9ed102 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultGatewayPoliciesClient.go @@ -0,0 +1,667 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GatewayPolicies + * Functions that implement the generated GatewayPoliciesClient interface + */ + + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGatewayPoliciesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGatewayPoliciesClient(connector client.Connector) *DefaultGatewayPoliciesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.domains.gateway_policies" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "revise"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGatewayPoliciesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["delete"] = gIface.deleteMethodDefinition() + gIface.methodNameToDefMap["get"] = gIface.getMethodDefinition() + gIface.methodNameToDefMap["list"] = gIface.listMethodDefinition() + gIface.methodNameToDefMap["patch"] = gIface.patchMethodDefinition() + gIface.methodNameToDefMap["revise"] = gIface.reviseMethodDefinition() + gIface.methodNameToDefMap["update"] = gIface.updateMethodDefinition() + return &gIface +} + +func (gIface *DefaultGatewayPoliciesClient) Delete(domainIdParam string, gatewayPolicyIdParam string) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(gatewayPoliciesDeleteInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GatewayPolicyId", gatewayPolicyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayPoliciesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGatewayPoliciesClient) Get(domainIdParam string, gatewayPolicyIdParam string) (model.GatewayPolicy, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(gatewayPoliciesGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GatewayPolicyId", gatewayPolicyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayPoliciesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayPoliciesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGatewayPoliciesClient) List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includeRuleCountParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.GatewayPolicyListResult, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(gatewayPoliciesListInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludeRuleCount", includeRuleCountParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayPolicyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayPoliciesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayPolicyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayPoliciesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayPolicyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGatewayPoliciesClient) Patch(domainIdParam string, gatewayPolicyIdParam string, gatewayPolicyParam model.GatewayPolicy) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(gatewayPoliciesPatchInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GatewayPolicyId", gatewayPolicyIdParam) + sv.AddStructField("GatewayPolicy", gatewayPolicyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayPoliciesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGatewayPoliciesClient) Revise(domainIdParam string, gatewayPolicyIdParam string, gatewayPolicyParam model.GatewayPolicy, anchorPathParam *string, operationParam *string) (model.GatewayPolicy, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "revise") + sv := bindings.NewStructValueBuilder(gatewayPoliciesReviseInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GatewayPolicyId", gatewayPolicyIdParam) + sv.AddStructField("GatewayPolicy", gatewayPolicyParam) + sv.AddStructField("AnchorPath", anchorPathParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayPoliciesReviseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayPoliciesReviseOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGatewayPoliciesClient) Update(domainIdParam string, gatewayPolicyIdParam string, gatewayPolicyParam model.GatewayPolicy) (model.GatewayPolicy, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(gatewayPoliciesUpdateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GatewayPolicyId", gatewayPolicyIdParam) + sv.AddStructField("GatewayPolicy", gatewayPolicyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayPoliciesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayPoliciesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGatewayPoliciesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGatewayPoliciesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayPoliciesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayPoliciesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayPoliciesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayPoliciesClient) reviseMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesReviseInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesReviseOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.revise method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.revise method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "revise") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.revise method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.revise method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.revise method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.revise method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.revise method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGatewayPoliciesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayPoliciesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayPoliciesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultGroupsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultGroupsClient.go new file mode 100644 index 000000000..753f88054 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultGroupsClient.go @@ -0,0 +1,568 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Groups + * Functions that implement the generated GroupsClient interface + */ + + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGroupsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGroupsClient(connector client.Connector) *DefaultGroupsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.domains.groups" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGroupsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["delete"] = gIface.deleteMethodDefinition() + gIface.methodNameToDefMap["get"] = gIface.getMethodDefinition() + gIface.methodNameToDefMap["list"] = gIface.listMethodDefinition() + gIface.methodNameToDefMap["patch"] = gIface.patchMethodDefinition() + gIface.methodNameToDefMap["update"] = gIface.updateMethodDefinition() + return &gIface +} + +func (gIface *DefaultGroupsClient) Delete(domainIdParam string, groupIdParam string, failIfSubtreeExistsParam *bool, forceParam *bool) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(groupsDeleteInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("FailIfSubtreeExists", failIfSubtreeExistsParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGroupsClient) Get(domainIdParam string, groupIdParam string) (model.Group, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(groupsGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GroupId", groupIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Group + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Group + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Group), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGroupsClient) List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, memberTypesParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.GroupListResult, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(groupsListInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("MemberTypes", memberTypesParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GroupListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GroupListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GroupListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *DefaultGroupsClient) Patch(domainIdParam string, groupIdParam string, groupParam model.Group) error { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(groupsPatchInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("Group", groupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (gIface *DefaultGroupsClient) Update(domainIdParam string, groupIdParam string, groupParam model.Group) (model.Group, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(groupsUpdateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("Group", groupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Group + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Group + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Group), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGroupsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGroupsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(groupsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(groupsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGroupsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(groupsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(groupsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGroupsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(groupsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(groupsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGroupsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(groupsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(groupsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (gIface *DefaultGroupsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(groupsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(groupsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGroupsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultSecurityPoliciesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultSecurityPoliciesClient.go new file mode 100644 index 000000000..5ea20f3d8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DefaultSecurityPoliciesClient.go @@ -0,0 +1,667 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SecurityPolicies + * Functions that implement the generated SecurityPoliciesClient interface + */ + + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSecurityPoliciesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSecurityPoliciesClient(connector client.Connector) *DefaultSecurityPoliciesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.domains.security_policies" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "revise"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSecurityPoliciesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["revise"] = sIface.reviseMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSecurityPoliciesClient) Delete(domainIdParam string, securityPolicyIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(securityPoliciesDeleteInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("SecurityPolicyId", securityPolicyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := securityPoliciesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSecurityPoliciesClient) Get(domainIdParam string, securityPolicyIdParam string) (model.SecurityPolicy, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(securityPoliciesGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("SecurityPolicyId", securityPolicyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SecurityPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := securityPoliciesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SecurityPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), securityPoliciesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SecurityPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSecurityPoliciesClient) List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includeRuleCountParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SecurityPolicyListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(securityPoliciesListInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludeRuleCount", includeRuleCountParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SecurityPolicyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := securityPoliciesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SecurityPolicyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), securityPoliciesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SecurityPolicyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSecurityPoliciesClient) Patch(domainIdParam string, securityPolicyIdParam string, securityPolicyParam model.SecurityPolicy) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(securityPoliciesPatchInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("SecurityPolicyId", securityPolicyIdParam) + sv.AddStructField("SecurityPolicy", securityPolicyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := securityPoliciesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSecurityPoliciesClient) Revise(domainIdParam string, securityPolicyIdParam string, securityPolicyParam model.SecurityPolicy, anchorPathParam *string, operationParam *string) (model.SecurityPolicy, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "revise") + sv := bindings.NewStructValueBuilder(securityPoliciesReviseInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("SecurityPolicyId", securityPolicyIdParam) + sv.AddStructField("SecurityPolicy", securityPolicyParam) + sv.AddStructField("AnchorPath", anchorPathParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SecurityPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := securityPoliciesReviseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SecurityPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), securityPoliciesReviseOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SecurityPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSecurityPoliciesClient) Update(domainIdParam string, securityPolicyIdParam string, securityPolicyParam model.SecurityPolicy) (model.SecurityPolicy, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(securityPoliciesUpdateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("SecurityPolicyId", securityPolicyIdParam) + sv.AddStructField("SecurityPolicy", securityPolicyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SecurityPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := securityPoliciesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SecurityPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), securityPoliciesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SecurityPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSecurityPoliciesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSecurityPoliciesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(securityPoliciesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(securityPoliciesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSecurityPoliciesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(securityPoliciesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(securityPoliciesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSecurityPoliciesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(securityPoliciesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(securityPoliciesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSecurityPoliciesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(securityPoliciesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(securityPoliciesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSecurityPoliciesClient) reviseMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(securityPoliciesReviseInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(securityPoliciesReviseOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.revise method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.revise method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "revise") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.revise method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.revise method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.revise method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.revise method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.revise method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSecurityPoliciesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(securityPoliciesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(securityPoliciesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSecurityPoliciesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainDeploymentMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainDeploymentMapsClient.go new file mode 100644 index 000000000..6420c62b1 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainDeploymentMapsClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: DomainDeploymentMaps + * Used by client-side stubs. + */ + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DomainDeploymentMapsClient interface { + + // Delete Domain Deployment Map + // + // @param domainIdParam (required) + // @param domainDeploymentMapIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(domainIdParam string, domainDeploymentMapIdParam string) error + + // Read a Domain Deployment Map + // + // @param domainIdParam (required) + // @param domainDeploymentMapIdParam (required) + // @return com.vmware.nsx_global_policy.model.DomainDeploymentMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string, domainDeploymentMapIdParam string) (model.DomainDeploymentMap, error) + + // Paginated list of all Domain Deployment Entries for infra. + // + // @param domainIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.DomainDeploymentMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DomainDeploymentMapListResult, error) + + // If the passed Domain Deployment Map does not already exist, create a new Domain Deployment Map. If it already exist, patch it. + // + // @param domainIdParam (required) + // @param domainDeploymentMapIdParam (required) + // @param domainDeploymentMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(domainIdParam string, domainDeploymentMapIdParam string, domainDeploymentMapParam model.DomainDeploymentMap) error + + // If the passed Domain Deployment Map does not already exist, create a new Domain Deployment Map. If it already exist, replace it. + // + // @param domainIdParam (required) + // @param domainDeploymentMapIdParam (required) + // @param domainDeploymentMapParam (required) + // @return com.vmware.nsx_global_policy.model.DomainDeploymentMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(domainIdParam string, domainDeploymentMapIdParam string, domainDeploymentMapParam model.DomainDeploymentMap) (model.DomainDeploymentMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainDeploymentMapsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainDeploymentMapsTypes.go new file mode 100644 index 000000000..f48a5dda3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainDeploymentMapsTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: DomainDeploymentMaps. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package domains + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func domainDeploymentMapsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["domain_deployment_map_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain_deployment_map_id"] = "DomainDeploymentMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainDeploymentMapsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func domainDeploymentMapsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["domain_deployment_map_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain_deployment_map_id"] = "DomainDeploymentMapId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domain_deployment_map_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["domainDeploymentMapId"] = bindings.NewStringType() + pathParams["domain_deployment_map_id"] = "domainDeploymentMapId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/domains/{domainId}/domain-deployment-maps/{domainDeploymentMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainDeploymentMapsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["domain_deployment_map_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain_deployment_map_id"] = "DomainDeploymentMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainDeploymentMapsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DomainDeploymentMapBindingType) +} + +func domainDeploymentMapsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["domain_deployment_map_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain_deployment_map_id"] = "DomainDeploymentMapId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domain_deployment_map_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["domainDeploymentMapId"] = bindings.NewStringType() + pathParams["domain_deployment_map_id"] = "domainDeploymentMapId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/domain-deployment-maps/{domainDeploymentMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainDeploymentMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainDeploymentMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DomainDeploymentMapListResultBindingType) +} + +func domainDeploymentMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/domain-deployment-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainDeploymentMapsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["domain_deployment_map_id"] = bindings.NewStringType() + fields["domain_deployment_map"] = bindings.NewReferenceType(model.DomainDeploymentMapBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain_deployment_map_id"] = "DomainDeploymentMapId" + fieldNameMap["domain_deployment_map"] = "DomainDeploymentMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainDeploymentMapsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func domainDeploymentMapsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["domain_deployment_map_id"] = bindings.NewStringType() + fields["domain_deployment_map"] = bindings.NewReferenceType(model.DomainDeploymentMapBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain_deployment_map_id"] = "DomainDeploymentMapId" + fieldNameMap["domain_deployment_map"] = "DomainDeploymentMap" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domain_deployment_map_id"] = bindings.NewStringType() + paramsTypeMap["domain_deployment_map"] = bindings.NewReferenceType(model.DomainDeploymentMapBindingType) + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["domainDeploymentMapId"] = bindings.NewStringType() + pathParams["domain_deployment_map_id"] = "domainDeploymentMapId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "domain_deployment_map", + "PATCH", + "/global-manager/api/v1/global-infra/domains/{domainId}/domain-deployment-maps/{domainDeploymentMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainDeploymentMapsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["domain_deployment_map_id"] = bindings.NewStringType() + fields["domain_deployment_map"] = bindings.NewReferenceType(model.DomainDeploymentMapBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain_deployment_map_id"] = "DomainDeploymentMapId" + fieldNameMap["domain_deployment_map"] = "DomainDeploymentMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainDeploymentMapsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DomainDeploymentMapBindingType) +} + +func domainDeploymentMapsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["domain_deployment_map_id"] = bindings.NewStringType() + fields["domain_deployment_map"] = bindings.NewReferenceType(model.DomainDeploymentMapBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["domain_deployment_map_id"] = "DomainDeploymentMapId" + fieldNameMap["domain_deployment_map"] = "DomainDeploymentMap" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domain_deployment_map_id"] = bindings.NewStringType() + paramsTypeMap["domain_deployment_map"] = bindings.NewReferenceType(model.DomainDeploymentMapBindingType) + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["domainDeploymentMapId"] = bindings.NewStringType() + pathParams["domain_deployment_map_id"] = "domainDeploymentMapId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "domain_deployment_map", + "PUT", + "/global-manager/api/v1/global-infra/domains/{domainId}/domain-deployment-maps/{domainDeploymentMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainsPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainsPackageTypes.go new file mode 100644 index 000000000..2b88d32a0 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/DomainsPackageTypes.go @@ -0,0 +1,19 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy.global_infra.domains. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package domains + + + + + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallFloodProtectionProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallFloodProtectionProfileBindingMapsClient.go new file mode 100644 index 000000000..2aa69ab60 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallFloodProtectionProfileBindingMapsClient.go @@ -0,0 +1,34 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FirewallFloodProtectionProfileBindingMaps + * Used by client-side stubs. + */ + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type FirewallFloodProtectionProfileBindingMapsClient interface { + + // API will list all Firewall Flood Protection Profile Binding Maps across all domains. This API returns the binding maps order by the sequence number. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyFirewallFloodProtectionProfileBindingMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyFirewallFloodProtectionProfileBindingMapListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallFloodProtectionProfileBindingMapsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallFloodProtectionProfileBindingMapsTypes.go new file mode 100644 index 000000000..869cf75d3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallFloodProtectionProfileBindingMapsTypes.go @@ -0,0 +1,106 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FirewallFloodProtectionProfileBindingMaps. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package domains + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func firewallFloodProtectionProfileBindingMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallFloodProtectionProfileBindingMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyFirewallFloodProtectionProfileBindingMapListResultBindingType) +} + +func firewallFloodProtectionProfileBindingMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/firewall-flood-protection-profile-binding-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallSessionTimerProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallSessionTimerProfileBindingMapsClient.go new file mode 100644 index 000000000..a8352fcd2 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallSessionTimerProfileBindingMapsClient.go @@ -0,0 +1,34 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FirewallSessionTimerProfileBindingMaps + * Used by client-side stubs. + */ + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type FirewallSessionTimerProfileBindingMapsClient interface { + + // API will list all Firewall Session Timer Profile Binding Maps across all domains. This API returns the binding maps order by the sequence number. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyFirewallSessionTimerProfileBindingMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyFirewallSessionTimerProfileBindingMapListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallSessionTimerProfileBindingMapsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallSessionTimerProfileBindingMapsTypes.go new file mode 100644 index 000000000..2da58a5ec --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/FirewallSessionTimerProfileBindingMapsTypes.go @@ -0,0 +1,106 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FirewallSessionTimerProfileBindingMaps. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package domains + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func firewallSessionTimerProfileBindingMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func firewallSessionTimerProfileBindingMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyFirewallSessionTimerProfileBindingMapListResultBindingType) +} + +func firewallSessionTimerProfileBindingMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/firewall-session-timer-profile-binding-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/ForwardingPoliciesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/ForwardingPoliciesClient.go new file mode 100644 index 000000000..d1a860b78 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/ForwardingPoliciesClient.go @@ -0,0 +1,48 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: ForwardingPolicies + * Used by client-side stubs. + */ + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type ForwardingPoliciesClient interface { + + // Read forwarding policy. + // + // @param domainIdParam Domain id (required) + // @param forwardingPolicyIdParam Forwarding map id (required) + // @return com.vmware.nsx_global_policy.model.ForwardingPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string, forwardingPolicyIdParam string) (model.ForwardingPolicy, error) + + // List all forwarding policies for the given domain ordered by precedence. + // + // @param domainIdParam Domain id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includeRuleCountParam Include the count of rules in policy (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.ForwardingPolicyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includeRuleCountParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ForwardingPolicyListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/ForwardingPoliciesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/ForwardingPoliciesTypes.go new file mode 100644 index 000000000..f4aa60b79 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/ForwardingPoliciesTypes.go @@ -0,0 +1,176 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: ForwardingPolicies. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package domains + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func forwardingPoliciesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["forwarding_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["forwarding_policy_id"] = "ForwardingPolicyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardingPoliciesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ForwardingPolicyBindingType) +} + +func forwardingPoliciesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["forwarding_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["forwarding_policy_id"] = "ForwardingPolicyId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["forwarding_policy_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["forwardingPolicyId"] = bindings.NewStringType() + pathParams["forwarding_policy_id"] = "forwardingPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/forwarding-policies/{forwardingPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func forwardingPoliciesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["include_rule_count"] = "IncludeRuleCount" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardingPoliciesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ForwardingPolicyListResultBindingType) +} + +func forwardingPoliciesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["include_rule_count"] = "IncludeRuleCount" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["cursor"] = "cursor" + queryParams["include_rule_count"] = "include_rule_count" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/forwarding-policies", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GatewayPoliciesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GatewayPoliciesClient.go new file mode 100644 index 000000000..5461a84bf --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GatewayPoliciesClient.go @@ -0,0 +1,99 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GatewayPolicies + * Used by client-side stubs. + */ + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GatewayPoliciesClient interface { + + // Delete GatewayPolicy + // + // @param domainIdParam (required) + // @param gatewayPolicyIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(domainIdParam string, gatewayPolicyIdParam string) error + + // Read gateway policy for a domain. + // + // @param domainIdParam (required) + // @param gatewayPolicyIdParam (required) + // @return com.vmware.nsx_global_policy.model.GatewayPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string, gatewayPolicyIdParam string) (model.GatewayPolicy, error) + + // List all gateway policies for specified Domain. + // + // @param domainIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includeRuleCountParam Include the count of rules in policy (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.GatewayPolicyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includeRuleCountParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.GatewayPolicyListResult, error) + + // Update the gateway policy for a domain. This is a full replace. All the rules are replaced. + // + // @param domainIdParam (required) + // @param gatewayPolicyIdParam (required) + // @param gatewayPolicyParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(domainIdParam string, gatewayPolicyIdParam string, gatewayPolicyParam model.GatewayPolicy) error + + // This is used to set a precedence of a gateway policy w.r.t others. + // + // @param domainIdParam (required) + // @param gatewayPolicyIdParam (required) + // @param gatewayPolicyParam (required) + // @param anchorPathParam The security policy/rule path if operation is 'insert_after' or 'insert_before' (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx_global_policy.model.GatewayPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Revise(domainIdParam string, gatewayPolicyIdParam string, gatewayPolicyParam model.GatewayPolicy, anchorPathParam *string, operationParam *string) (model.GatewayPolicy, error) + + // Update the gateway policy for a domain. This is a full replace. All the rules are replaced. + // + // @param domainIdParam (required) + // @param gatewayPolicyIdParam (required) + // @param gatewayPolicyParam (required) + // @return com.vmware.nsx_global_policy.model.GatewayPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(domainIdParam string, gatewayPolicyIdParam string, gatewayPolicyParam model.GatewayPolicy) (model.GatewayPolicy, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GatewayPoliciesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GatewayPoliciesTypes.go new file mode 100644 index 000000000..efd474c7a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GatewayPoliciesTypes.go @@ -0,0 +1,439 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GatewayPolicies. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package domains + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``operation`` of method GatewayPolicies#revise. +const GatewayPolicies_REVISE_OPERATION_TOP = "insert_top" +// Possible value for ``operation`` of method GatewayPolicies#revise. +const GatewayPolicies_REVISE_OPERATION_BOTTOM = "insert_bottom" +// Possible value for ``operation`` of method GatewayPolicies#revise. +const GatewayPolicies_REVISE_OPERATION_AFTER = "insert_after" +// Possible value for ``operation`` of method GatewayPolicies#revise. +const GatewayPolicies_REVISE_OPERATION_BEFORE = "insert_before" + + + + +func gatewayPoliciesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayPoliciesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func gatewayPoliciesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["gateway_policy_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["gatewayPolicyId"] = bindings.NewStringType() + pathParams["gateway_policy_id"] = "gatewayPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/domains/{domainId}/gateway-policies/{gatewayPolicyId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayPoliciesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayPoliciesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayPolicyBindingType) +} + +func gatewayPoliciesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["gateway_policy_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["gatewayPolicyId"] = bindings.NewStringType() + pathParams["gateway_policy_id"] = "gatewayPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/gateway-policies/{gatewayPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayPoliciesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["include_rule_count"] = "IncludeRuleCount" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayPoliciesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayPolicyListResultBindingType) +} + +func gatewayPoliciesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["include_rule_count"] = "IncludeRuleCount" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["cursor"] = "cursor" + queryParams["include_rule_count"] = "include_rule_count" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/gateway-policies", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayPoliciesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fields["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + fieldNameMap["gateway_policy"] = "GatewayPolicy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayPoliciesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func gatewayPoliciesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fields["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + fieldNameMap["gateway_policy"] = "GatewayPolicy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["gateway_policy_id"] = bindings.NewStringType() + paramsTypeMap["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["gatewayPolicyId"] = bindings.NewStringType() + pathParams["gateway_policy_id"] = "gatewayPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "gateway_policy", + "PATCH", + "/global-manager/api/v1/global-infra/domains/{domainId}/gateway-policies/{gatewayPolicyId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayPoliciesReviseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fields["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + fields["anchor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + fieldNameMap["gateway_policy"] = "GatewayPolicy" + fieldNameMap["anchor_path"] = "AnchorPath" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayPoliciesReviseOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayPolicyBindingType) +} + +func gatewayPoliciesReviseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fields["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + fields["anchor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + fieldNameMap["gateway_policy"] = "GatewayPolicy" + fieldNameMap["anchor_path"] = "AnchorPath" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["anchor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["gateway_policy_id"] = bindings.NewStringType() + paramsTypeMap["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["gatewayPolicyId"] = bindings.NewStringType() + pathParams["gateway_policy_id"] = "gatewayPolicyId" + pathParams["domain_id"] = "domainId" + queryParams["anchor_path"] = "anchor_path" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=revise", + "gateway_policy", + "POST", + "/global-manager/api/v1/global-infra/domains/{domainId}/gateway-policies/{gatewayPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func gatewayPoliciesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fields["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + fieldNameMap["gateway_policy"] = "GatewayPolicy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayPoliciesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayPolicyBindingType) +} + +func gatewayPoliciesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["gateway_policy_id"] = bindings.NewStringType() + fields["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["gateway_policy_id"] = "GatewayPolicyId" + fieldNameMap["gateway_policy"] = "GatewayPolicy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["gateway_policy_id"] = bindings.NewStringType() + paramsTypeMap["gateway_policy"] = bindings.NewReferenceType(model.GatewayPolicyBindingType) + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["gatewayPolicyId"] = bindings.NewStringType() + pathParams["gateway_policy_id"] = "gatewayPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "gateway_policy", + "PUT", + "/global-manager/api/v1/global-infra/domains/{domainId}/gateway-policies/{gatewayPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GroupsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GroupsClient.go new file mode 100644 index 000000000..8283a9f45 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GroupsClient.go @@ -0,0 +1,86 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Groups + * Used by client-side stubs. + */ + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GroupsClient interface { + + // Delete Group + // + // @param domainIdParam Domain ID (required) + // @param groupIdParam Group ID (required) + // @param failIfSubtreeExistsParam Do not delete if the group subtree has any entities (optional, default to false) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(domainIdParam string, groupIdParam string, failIfSubtreeExistsParam *bool, forceParam *bool) error + + // Read group + // + // @param domainIdParam Domain ID (required) + // @param groupIdParam Group ID (required) + // @return com.vmware.nsx_global_policy.model.Group + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string, groupIdParam string) (model.Group, error) + + // List Groups for a domain. Groups can be filtered using member_types query parameter, which returns the groups that contains the specified member types. Multiple member types can be provided as comma separated values. The API also return groups having member type that are subset of provided member_types. + // + // @param domainIdParam Domain ID (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param memberTypesParam Comma Seperated Member types (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.GroupListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, memberTypesParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.GroupListResult, error) + + // If a group with the group-id is not already present, create a new group. If it already exists, patch the group. + // + // @param domainIdParam Domain ID (required) + // @param groupIdParam Group ID (required) + // @param groupParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(domainIdParam string, groupIdParam string, groupParam model.Group) error + + // If a group with the group-id is not already present, create a new group. If it already exists, update the group. Avoid creating groups with multiple MACAddressExpression and IPAddressExpression. In future releases, group will be restricted to contain a single MACAddressExpression and IPAddressExpression along with other expressions. To group IPAddresses or MACAddresses, use nested groups instead of multiple IPAddressExpressions/MACAddressExpression. + // + // @param domainIdParam Domain ID (required) + // @param groupIdParam Group ID (required) + // @param groupParam (required) + // @return com.vmware.nsx_global_policy.model.Group + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(domainIdParam string, groupIdParam string, groupParam model.Group) (model.Group, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GroupsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GroupsTypes.go new file mode 100644 index 000000000..5d8be6966 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/GroupsTypes.go @@ -0,0 +1,369 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Groups. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package domains + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func groupsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fields["fail_if_subtree_exists"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["fail_if_subtree_exists"] = "FailIfSubtreeExists" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func groupsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fields["fail_if_subtree_exists"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["fail_if_subtree_exists"] = "FailIfSubtreeExists" + fieldNameMap["force"] = "Force" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["fail_if_subtree_exists"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + pathParams["domain_id"] = "domainId" + queryParams["force"] = "force" + queryParams["fail_if_subtree_exists"] = "fail_if_subtree_exists" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/domains/{domainId}/groups/{groupId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func groupsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GroupBindingType) +} + +func groupsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/groups/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func groupsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["member_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["member_types"] = "MemberTypes" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GroupListResultBindingType) +} + +func groupsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["member_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["member_types"] = "MemberTypes" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["member_types"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["member_types"] = "member_types" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/groups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func groupsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fields["group"] = bindings.NewReferenceType(model.GroupBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["group"] = "Group" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func groupsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fields["group"] = bindings.NewReferenceType(model.GroupBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["group"] = "Group" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["group"] = bindings.NewReferenceType(model.GroupBindingType) + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "group", + "PATCH", + "/global-manager/api/v1/global-infra/domains/{domainId}/groups/{groupId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func groupsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fields["group"] = bindings.NewReferenceType(model.GroupBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["group"] = "Group" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GroupBindingType) +} + +func groupsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fields["group"] = bindings.NewReferenceType(model.GroupBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["group"] = "Group" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["group"] = bindings.NewReferenceType(model.GroupBindingType) + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "group", + "PUT", + "/global-manager/api/v1/global-infra/domains/{domainId}/groups/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/SecurityPoliciesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/SecurityPoliciesClient.go new file mode 100644 index 000000000..bd311f8e8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/SecurityPoliciesClient.go @@ -0,0 +1,99 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SecurityPolicies + * Used by client-side stubs. + */ + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SecurityPoliciesClient interface { + + // Deletes the security policy along with all the rules + // + // @param domainIdParam (required) + // @param securityPolicyIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(domainIdParam string, securityPolicyIdParam string) error + + // Read security policy for a domain. + // + // @param domainIdParam (required) + // @param securityPolicyIdParam (required) + // @return com.vmware.nsx_global_policy.model.SecurityPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string, securityPolicyIdParam string) (model.SecurityPolicy, error) + + // List all security policies for a domain. + // + // @param domainIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includeRuleCountParam Include the count of rules in policy (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SecurityPolicyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(domainIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includeRuleCountParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SecurityPolicyListResult, error) + + // Patch the security policy for a domain. If a security policy for the given security-policy-id is not present, the object will get created and if it is present it will be updated. This is a full replace + // + // @param domainIdParam (required) + // @param securityPolicyIdParam (required) + // @param securityPolicyParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(domainIdParam string, securityPolicyIdParam string, securityPolicyParam model.SecurityPolicy) error + + // This is used to set a precedence of a security policy w.r.t others. + // + // @param domainIdParam (required) + // @param securityPolicyIdParam (required) + // @param securityPolicyParam (required) + // @param anchorPathParam The security policy/rule path if operation is 'insert_after' or 'insert_before' (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx_global_policy.model.SecurityPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Revise(domainIdParam string, securityPolicyIdParam string, securityPolicyParam model.SecurityPolicy, anchorPathParam *string, operationParam *string) (model.SecurityPolicy, error) + + // Create or Update the security policy for a domain. This is a full replace. All the rules are replaced. + // + // @param domainIdParam (required) + // @param securityPolicyIdParam (required) + // @param securityPolicyParam (required) + // @return com.vmware.nsx_global_policy.model.SecurityPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(domainIdParam string, securityPolicyIdParam string, securityPolicyParam model.SecurityPolicy) (model.SecurityPolicy, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/SecurityPoliciesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/SecurityPoliciesTypes.go new file mode 100644 index 000000000..7e772f091 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains/SecurityPoliciesTypes.go @@ -0,0 +1,439 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SecurityPolicies. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package domains + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``operation`` of method SecurityPolicies#revise. +const SecurityPolicies_REVISE_OPERATION_TOP = "insert_top" +// Possible value for ``operation`` of method SecurityPolicies#revise. +const SecurityPolicies_REVISE_OPERATION_BOTTOM = "insert_bottom" +// Possible value for ``operation`` of method SecurityPolicies#revise. +const SecurityPolicies_REVISE_OPERATION_AFTER = "insert_after" +// Possible value for ``operation`` of method SecurityPolicies#revise. +const SecurityPolicies_REVISE_OPERATION_BEFORE = "insert_before" + + + + +func securityPoliciesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func securityPoliciesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func securityPoliciesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["security_policy_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["securityPolicyId"] = bindings.NewStringType() + pathParams["security_policy_id"] = "securityPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/domains/{domainId}/security-policies/{securityPolicyId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func securityPoliciesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func securityPoliciesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SecurityPolicyBindingType) +} + +func securityPoliciesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["security_policy_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["securityPolicyId"] = bindings.NewStringType() + pathParams["security_policy_id"] = "securityPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/security-policies/{securityPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func securityPoliciesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["include_rule_count"] = "IncludeRuleCount" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func securityPoliciesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SecurityPolicyListResultBindingType) +} + +func securityPoliciesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["include_rule_count"] = "IncludeRuleCount" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["include_rule_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["cursor"] = "cursor" + queryParams["include_rule_count"] = "include_rule_count" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/domains/{domainId}/security-policies", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func securityPoliciesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fields["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + fieldNameMap["security_policy"] = "SecurityPolicy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func securityPoliciesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func securityPoliciesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fields["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + fieldNameMap["security_policy"] = "SecurityPolicy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + paramsTypeMap["security_policy_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["securityPolicyId"] = bindings.NewStringType() + pathParams["security_policy_id"] = "securityPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "security_policy", + "PATCH", + "/global-manager/api/v1/global-infra/domains/{domainId}/security-policies/{securityPolicyId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func securityPoliciesReviseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fields["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + fields["anchor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + fieldNameMap["security_policy"] = "SecurityPolicy" + fieldNameMap["anchor_path"] = "AnchorPath" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func securityPoliciesReviseOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SecurityPolicyBindingType) +} + +func securityPoliciesReviseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fields["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + fields["anchor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + fieldNameMap["security_policy"] = "SecurityPolicy" + fieldNameMap["anchor_path"] = "AnchorPath" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + paramsTypeMap["anchor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["security_policy_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["securityPolicyId"] = bindings.NewStringType() + pathParams["security_policy_id"] = "securityPolicyId" + pathParams["domain_id"] = "domainId" + queryParams["anchor_path"] = "anchor_path" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=revise", + "security_policy", + "POST", + "/global-manager/api/v1/global-infra/domains/{domainId}/security-policies/{securityPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func securityPoliciesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fields["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + fieldNameMap["security_policy"] = "SecurityPolicy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func securityPoliciesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SecurityPolicyBindingType) +} + +func securityPoliciesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["security_policy_id"] = bindings.NewStringType() + fields["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["security_policy_id"] = "SecurityPolicyId" + fieldNameMap["security_policy"] = "SecurityPolicy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["security_policy"] = bindings.NewReferenceType(model.SecurityPolicyBindingType) + paramsTypeMap["security_policy_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["securityPolicyId"] = bindings.NewStringType() + pathParams["security_policy_id"] = "securityPolicyId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "security_policy", + "PUT", + "/global-manager/api/v1/global-infra/domains/{domainId}/security-policies/{securityPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/AlarmsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/AlarmsClient.go new file mode 100644 index 000000000..82acdeace --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/AlarmsClient.go @@ -0,0 +1,33 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Alarms + * Used by client-side stubs. + */ + +package realized_state + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type AlarmsClient interface { + + // Paginated list of all alarms. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PolicyAlarmResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyAlarmResourceListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/AlarmsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/AlarmsTypes.go new file mode 100644 index 000000000..2da78dd45 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/AlarmsTypes.go @@ -0,0 +1,100 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Alarms. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package realized_state + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func alarmsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func alarmsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyAlarmResourceListResultBindingType) +} + +func alarmsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/realized-state/alarms", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultAlarmsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultAlarmsClient.go new file mode 100644 index 000000000..0ad5e46ae --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultAlarmsClient.go @@ -0,0 +1,181 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Alarms + * Functions that implement the generated AlarmsClient interface + */ + + +package realized_state + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultAlarmsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultAlarmsClient(connector client.Connector) *DefaultAlarmsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.realized_state.alarms" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + aIface := DefaultAlarmsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + aIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + aIface.methodNameToDefMap["list"] = aIface.listMethodDefinition() + return &aIface +} + +func (aIface *DefaultAlarmsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PolicyAlarmResourceListResult, error) { + typeConverter := aIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(aIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(alarmsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyAlarmResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := alarmsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := aIface.connector.NewExecutionContext() + methodResult := aIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyAlarmResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), alarmsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyAlarmResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (aIface *DefaultAlarmsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := aIface.connector.GetApiProvider().Invoke(aIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (aIface *DefaultAlarmsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(aIface.interfaceName) + typeConverter := aIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(alarmsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(alarmsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultAlarmsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultAlarmsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + aIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultAlarmsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + aIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultAlarmsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + aIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultAlarmsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + aIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultAlarmsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + aIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultAlarmsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultRealizedEntitiesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultRealizedEntitiesClient.go new file mode 100644 index 000000000..744d2e1c3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultRealizedEntitiesClient.go @@ -0,0 +1,178 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: RealizedEntities + * Functions that implement the generated RealizedEntitiesClient interface + */ + + +package realized_state + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultRealizedEntitiesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultRealizedEntitiesClient(connector client.Connector) *DefaultRealizedEntitiesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.realized_state.realized_entities" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + rIface := DefaultRealizedEntitiesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + rIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + rIface.methodNameToDefMap["list"] = rIface.listMethodDefinition() + return &rIface +} + +func (rIface *DefaultRealizedEntitiesClient) List(intentPathParam string, sitePathParam *string) (model.GenericPolicyRealizedResourceListResult, error) { + typeConverter := rIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(rIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(realizedEntitiesListInputType(), typeConverter) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("SitePath", sitePathParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GenericPolicyRealizedResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := realizedEntitiesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := rIface.connector.NewExecutionContext() + methodResult := rIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GenericPolicyRealizedResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), realizedEntitiesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GenericPolicyRealizedResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (rIface *DefaultRealizedEntitiesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := rIface.connector.GetApiProvider().Invoke(rIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (rIface *DefaultRealizedEntitiesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(rIface.interfaceName) + typeConverter := rIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(realizedEntitiesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(realizedEntitiesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntitiesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntitiesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + rIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntitiesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntitiesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntitiesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntitiesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntitiesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultRealizedEntityClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultRealizedEntityClient.go new file mode 100644 index 000000000..8d49e47b9 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultRealizedEntityClient.go @@ -0,0 +1,171 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: RealizedEntity + * Functions that implement the generated RealizedEntityClient interface + */ + + +package realized_state + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultRealizedEntityClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultRealizedEntityClient(connector client.Connector) *DefaultRealizedEntityClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.realized_state.realized_entity" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "refresh"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + rIface := DefaultRealizedEntityClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + rIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + rIface.methodNameToDefMap["refresh"] = rIface.refreshMethodDefinition() + return &rIface +} + +func (rIface *DefaultRealizedEntityClient) Refresh(intentPathParam string, enforcementPointPathParam *string) error { + typeConverter := rIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(rIface.interfaceIdentifier, "refresh") + sv := bindings.NewStructValueBuilder(realizedEntityRefreshInputType(), typeConverter) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := realizedEntityRefreshRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := rIface.connector.NewExecutionContext() + methodResult := rIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + + +func (rIface *DefaultRealizedEntityClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := rIface.connector.GetApiProvider().Invoke(rIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (rIface *DefaultRealizedEntityClient) refreshMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(rIface.interfaceName) + typeConverter := rIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(realizedEntityRefreshInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(realizedEntityRefreshOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntityClient.refresh method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntityClient.refresh method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "refresh") + errorDefinitions := make([]data.ErrorDefinition, 0) + rIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntityClient.refresh method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntityClient.refresh method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntityClient.refresh method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntityClient.refresh method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRealizedEntityClient.refresh method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultStatusClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultStatusClient.go new file mode 100644 index 000000000..e4bed99a7 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/DefaultStatusClient.go @@ -0,0 +1,179 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Status + * Functions that implement the generated StatusClient interface + */ + + +package realized_state + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultStatusClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultStatusClient(connector client.Connector) *DefaultStatusClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.realized_state.status" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultStatusClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + return &sIface +} + +func (sIface *DefaultStatusClient) Get(intentPathParam string, includeEnforcedStatusParam *bool, sitePathParam *string) (model.ConsolidatedRealizedStatus, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("IncludeEnforcedStatus", includeEnforcedStatusParam) + sv.AddStructField("SitePath", sitePathParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConsolidatedRealizedStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.ConsolidatedRealizedStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConsolidatedRealizedStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultStatusClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultStatusClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(statusGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(statusGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatusClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatusClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatusClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatusClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatusClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatusClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatusClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntitiesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntitiesClient.go new file mode 100644 index 000000000..7a8fb3359 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntitiesClient.go @@ -0,0 +1,30 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: RealizedEntities + * Used by client-side stubs. + */ + +package realized_state + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type RealizedEntitiesClient interface { + + // Get list of realized entities associated with intent object, specified by path in query parameter + // + // @param intentPathParam String Path of the intent object (required) + // @param sitePathParam Policy Path of the site (optional) + // @return com.vmware.nsx_global_policy.model.GenericPolicyRealizedResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(intentPathParam string, sitePathParam *string) (model.GenericPolicyRealizedResourceListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntitiesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntitiesTypes.go new file mode 100644 index 000000000..85d668bf6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntitiesTypes.go @@ -0,0 +1,82 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: RealizedEntities. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package realized_state + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func realizedEntitiesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewStringType() + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func realizedEntitiesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GenericPolicyRealizedResourceListResultBindingType) +} + +func realizedEntitiesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["intent_path"] = bindings.NewStringType() + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["site_path"] = "SitePath" + paramsTypeMap["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["intent_path"] = bindings.NewStringType() + queryParams["site_path"] = "site_path" + queryParams["intent_path"] = "intent_path" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/realized-state/realized-entities", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntityClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntityClient.go new file mode 100644 index 000000000..e409416be --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntityClient.go @@ -0,0 +1,26 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: RealizedEntity + * Used by client-side stubs. + */ + +package realized_state + + +type RealizedEntityClient interface { + + // Refresh the status and statistics of all realized entities associated with given intent path synchronously. The vmw-async: True HTTP header cannot be used with this API. + // + // @param intentPathParam String Path of the intent object (required) + // @param enforcementPointPathParam String Path of the enforcement point (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Refresh(intentPathParam string, enforcementPointPathParam *string) error +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntityTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntityTypes.go new file mode 100644 index 000000000..53379a27e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedEntityTypes.go @@ -0,0 +1,81 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: RealizedEntity. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package realized_state + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func realizedEntityRefreshInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewStringType() + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func realizedEntityRefreshOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func realizedEntityRefreshRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["intent_path"] = bindings.NewStringType() + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["intent_path"] = bindings.NewStringType() + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["intent_path"] = "intent_path" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=refresh", + "", + "POST", + "/global-manager/api/v1/global-infra/realized-state/realized-entity", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedStatePackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedStatePackageTypes.go new file mode 100644 index 000000000..b76ce7757 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/RealizedStatePackageTypes.go @@ -0,0 +1,19 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy.global_infra.realized_state. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package realized_state + + + + + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/StatusClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/StatusClient.go new file mode 100644 index 000000000..b161364ad --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/StatusClient.go @@ -0,0 +1,31 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Status + * Used by client-side stubs. + */ + +package realized_state + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type StatusClient interface { + + // + // + // @param intentPathParam Policy Path of the intent object (required) + // @param includeEnforcedStatusParam Include Enforced Status Flag (optional, default to false) + // @param sitePathParam Policy Path of the site from where the realization status needs to be fetched (optional) + // @return com.vmware.nsx_global_policy.model.ConsolidatedRealizedStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(intentPathParam string, includeEnforcedStatusParam *bool, sitePathParam *string) (model.ConsolidatedRealizedStatus, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/StatusTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/StatusTypes.go new file mode 100644 index 000000000..88b416b4d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state/StatusTypes.go @@ -0,0 +1,88 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Status. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package realized_state + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewStringType() + fields["include_enforced_status"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["include_enforced_status"] = "IncludeEnforcedStatus" + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConsolidatedRealizedStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["intent_path"] = bindings.NewStringType() + fields["include_enforced_status"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["include_enforced_status"] = "IncludeEnforcedStatus" + fieldNameMap["site_path"] = "SitePath" + paramsTypeMap["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_enforced_status"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["intent_path"] = bindings.NewStringType() + queryParams["site_path"] = "site_path" + queryParams["intent_path"] = "intent_path" + queryParams["include_enforced_status"] = "include_enforced_status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/realized-state/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/ArpTableClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/ArpTableClient.go new file mode 100644 index 000000000..9565a8c4c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/ArpTableClient.go @@ -0,0 +1,36 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: ArpTable + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type ArpTableClient interface { + + // Returns ARP table (IPv4) or Neighbor Discovery table (IPv6) for the interface (downlink) attaching segment to tier-0/tier-1 gateway, on a edge node specified in edge_path parameter. The edge_path parameter is mandatory. + // + // @param segmentIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param edgePathParam Policy path of edge node (optional) + // @param enforcementPointPathParam Enforcement point path (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.InterfaceArpTable + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(segmentIdParam string, cursorParam *string, edgePathParam *string, enforcementPointPathParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.InterfaceArpTable, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/ArpTableTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/ArpTableTypes.go new file mode 100644 index 000000000..24d124535 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/ArpTableTypes.go @@ -0,0 +1,119 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: ArpTable. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func arpTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func arpTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InterfaceArpTableBindingType) +} + +func arpTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["edge_path"] = "edge_path" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/arp-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultArpTableClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultArpTableClient.go new file mode 100644 index 000000000..12402511f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultArpTableClient.go @@ -0,0 +1,184 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: ArpTable + * Functions that implement the generated ArpTableClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultArpTableClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultArpTableClient(connector client.Connector) *DefaultArpTableClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.arp_table" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + aIface := DefaultArpTableClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + aIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + aIface.methodNameToDefMap["list"] = aIface.listMethodDefinition() + return &aIface +} + +func (aIface *DefaultArpTableClient) List(segmentIdParam string, cursorParam *string, edgePathParam *string, enforcementPointPathParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.InterfaceArpTable, error) { + typeConverter := aIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(aIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(arpTableListInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EdgePath", edgePathParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InterfaceArpTable + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := arpTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := aIface.connector.NewExecutionContext() + methodResult := aIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.InterfaceArpTable + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), arpTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InterfaceArpTable), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (aIface *DefaultArpTableClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := aIface.connector.GetApiProvider().Invoke(aIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (aIface *DefaultArpTableClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(aIface.interfaceName) + typeConverter := aIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(arpTableListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(arpTableListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultArpTableClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultArpTableClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + aIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultArpTableClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + aIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultArpTableClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + aIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultArpTableClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + aIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultArpTableClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + aIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultArpTableClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultDhcpStaticBindingConfigsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultDhcpStaticBindingConfigsClient.go new file mode 100644 index 000000000..609981d56 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultDhcpStaticBindingConfigsClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: DhcpStaticBindingConfigs + * Functions that implement the generated DhcpStaticBindingConfigsClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDhcpStaticBindingConfigsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDhcpStaticBindingConfigsClient(connector client.Connector) *DefaultDhcpStaticBindingConfigsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.dhcp_static_binding_configs" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDhcpStaticBindingConfigsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) Delete(segmentIdParam string, bindingIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(dhcpStaticBindingConfigsDeleteInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("BindingId", bindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpStaticBindingConfigsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) Get(segmentIdParam string, bindingIdParam string) (*data.StructValue, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(dhcpStaticBindingConfigsGetInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("BindingId", bindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpStaticBindingConfigsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpStaticBindingConfigsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) List(segmentIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpStaticBindingConfigListResult, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(dhcpStaticBindingConfigsListInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpStaticBindingConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpStaticBindingConfigsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.DhcpStaticBindingConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpStaticBindingConfigsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpStaticBindingConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) Patch(segmentIdParam string, bindingIdParam string, dhcpStaticBindingConfigParam *data.StructValue) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(dhcpStaticBindingConfigsPatchInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("BindingId", bindingIdParam) + sv.AddStructField("DhcpStaticBindingConfig", dhcpStaticBindingConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpStaticBindingConfigsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) Update(segmentIdParam string, bindingIdParam string, dhcpStaticBindingConfigParam *data.StructValue) (*data.StructValue, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(dhcpStaticBindingConfigsUpdateInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("BindingId", bindingIdParam) + sv.AddStructField("DhcpStaticBindingConfig", dhcpStaticBindingConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dhcpStaticBindingConfigsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dhcpStaticBindingConfigsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDhcpStaticBindingConfigsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDhcpStaticBindingConfigsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDhcpStaticBindingConfigsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dhcpStaticBindingConfigsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDhcpStaticBindingConfigsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultPortsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultPortsClient.go new file mode 100644 index 000000000..e0b4721e8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultPortsClient.go @@ -0,0 +1,281 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Ports + * Functions that implement the generated PortsClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultPortsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultPortsClient(connector client.Connector) *DefaultPortsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.ports" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + pIface := DefaultPortsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + pIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + pIface.methodNameToDefMap["get"] = pIface.getMethodDefinition() + pIface.methodNameToDefMap["list"] = pIface.listMethodDefinition() + return &pIface +} + +func (pIface *DefaultPortsClient) Get(segmentIdParam string, portIdParam string) (model.SegmentPort, error) { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(portsGetInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("PortId", portIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentPort + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := portsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentPort + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), portsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentPort), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *DefaultPortsClient) List(segmentIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentPortListResult, error) { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(portsListInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentPortListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := portsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentPortListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), portsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentPortListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (pIface *DefaultPortsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := pIface.connector.GetApiProvider().Invoke(pIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (pIface *DefaultPortsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(portsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(portsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPortsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(portsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(portsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPortsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentDiscoveryProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentDiscoveryProfileBindingMapsClient.go new file mode 100644 index 000000000..11468b69d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentDiscoveryProfileBindingMapsClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SegmentDiscoveryProfileBindingMaps + * Functions that implement the generated SegmentDiscoveryProfileBindingMapsClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSegmentDiscoveryProfileBindingMapsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSegmentDiscoveryProfileBindingMapsClient(connector client.Connector) *DefaultSegmentDiscoveryProfileBindingMapsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.segment_discovery_profile_binding_maps" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSegmentDiscoveryProfileBindingMapsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) Delete(infraSegmentIdParam string, segmentDiscoveryProfileBindingMapIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(segmentDiscoveryProfileBindingMapsDeleteInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("SegmentDiscoveryProfileBindingMapId", segmentDiscoveryProfileBindingMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentDiscoveryProfileBindingMapsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) Get(infraSegmentIdParam string, segmentDiscoveryProfileBindingMapIdParam string) (model.SegmentDiscoveryProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(segmentDiscoveryProfileBindingMapsGetInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("SegmentDiscoveryProfileBindingMapId", segmentDiscoveryProfileBindingMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentDiscoveryProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentDiscoveryProfileBindingMapsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentDiscoveryProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentDiscoveryProfileBindingMapsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentDiscoveryProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) List(infraSegmentIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentDiscoveryProfileBindingMapListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(segmentDiscoveryProfileBindingMapsListInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentDiscoveryProfileBindingMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentDiscoveryProfileBindingMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentDiscoveryProfileBindingMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentDiscoveryProfileBindingMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentDiscoveryProfileBindingMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) Patch(infraSegmentIdParam string, segmentDiscoveryProfileBindingMapIdParam string, segmentDiscoveryProfileBindingMapParam model.SegmentDiscoveryProfileBindingMap) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(segmentDiscoveryProfileBindingMapsPatchInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("SegmentDiscoveryProfileBindingMapId", segmentDiscoveryProfileBindingMapIdParam) + sv.AddStructField("SegmentDiscoveryProfileBindingMap", segmentDiscoveryProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentDiscoveryProfileBindingMapsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) Update(infraSegmentIdParam string, segmentDiscoveryProfileBindingMapIdParam string, segmentDiscoveryProfileBindingMapParam model.SegmentDiscoveryProfileBindingMap) (model.SegmentDiscoveryProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(segmentDiscoveryProfileBindingMapsUpdateInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("SegmentDiscoveryProfileBindingMapId", segmentDiscoveryProfileBindingMapIdParam) + sv.AddStructField("SegmentDiscoveryProfileBindingMap", segmentDiscoveryProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentDiscoveryProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentDiscoveryProfileBindingMapsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentDiscoveryProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentDiscoveryProfileBindingMapsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentDiscoveryProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentDiscoveryProfileBindingMapsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentDiscoveryProfileBindingMapsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentDiscoveryProfileBindingMapsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentMonitoringProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentMonitoringProfileBindingMapsClient.go new file mode 100644 index 000000000..fe7f18655 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentMonitoringProfileBindingMapsClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SegmentMonitoringProfileBindingMaps + * Functions that implement the generated SegmentMonitoringProfileBindingMapsClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSegmentMonitoringProfileBindingMapsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSegmentMonitoringProfileBindingMapsClient(connector client.Connector) *DefaultSegmentMonitoringProfileBindingMapsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.segment_monitoring_profile_binding_maps" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSegmentMonitoringProfileBindingMapsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) Delete(infraSegmentIdParam string, segmentMonitoringProfileBindingMapIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(segmentMonitoringProfileBindingMapsDeleteInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("SegmentMonitoringProfileBindingMapId", segmentMonitoringProfileBindingMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentMonitoringProfileBindingMapsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) Get(infraSegmentIdParam string, segmentMonitoringProfileBindingMapIdParam string) (model.SegmentMonitoringProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(segmentMonitoringProfileBindingMapsGetInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("SegmentMonitoringProfileBindingMapId", segmentMonitoringProfileBindingMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentMonitoringProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentMonitoringProfileBindingMapsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentMonitoringProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentMonitoringProfileBindingMapsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentMonitoringProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) List(infraSegmentIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentMonitoringProfileBindingMapListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(segmentMonitoringProfileBindingMapsListInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentMonitoringProfileBindingMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentMonitoringProfileBindingMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentMonitoringProfileBindingMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentMonitoringProfileBindingMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentMonitoringProfileBindingMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) Patch(infraSegmentIdParam string, segmentMonitoringProfileBindingMapIdParam string, segmentMonitoringProfileBindingMapParam model.SegmentMonitoringProfileBindingMap) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(segmentMonitoringProfileBindingMapsPatchInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("SegmentMonitoringProfileBindingMapId", segmentMonitoringProfileBindingMapIdParam) + sv.AddStructField("SegmentMonitoringProfileBindingMap", segmentMonitoringProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentMonitoringProfileBindingMapsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) Update(infraSegmentIdParam string, segmentMonitoringProfileBindingMapIdParam string, segmentMonitoringProfileBindingMapParam model.SegmentMonitoringProfileBindingMap) (model.SegmentMonitoringProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(segmentMonitoringProfileBindingMapsUpdateInputType(), typeConverter) + sv.AddStructField("InfraSegmentId", infraSegmentIdParam) + sv.AddStructField("SegmentMonitoringProfileBindingMapId", segmentMonitoringProfileBindingMapIdParam) + sv.AddStructField("SegmentMonitoringProfileBindingMap", segmentMonitoringProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentMonitoringProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentMonitoringProfileBindingMapsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentMonitoringProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentMonitoringProfileBindingMapsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentMonitoringProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentMonitoringProfileBindingMapsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentMonitoringProfileBindingMapsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentMonitoringProfileBindingMapsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentQosProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentQosProfileBindingMapsClient.go new file mode 100644 index 000000000..62942b5a3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentQosProfileBindingMapsClient.go @@ -0,0 +1,564 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SegmentQosProfileBindingMaps + * Functions that implement the generated SegmentQosProfileBindingMapsClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSegmentQosProfileBindingMapsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSegmentQosProfileBindingMapsClient(connector client.Connector) *DefaultSegmentQosProfileBindingMapsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.segment_qos_profile_binding_maps" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSegmentQosProfileBindingMapsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) Delete(segmentIdParam string, segmentQosProfileBindingMapIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(segmentQosProfileBindingMapsDeleteInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("SegmentQosProfileBindingMapId", segmentQosProfileBindingMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentQosProfileBindingMapsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) Get(segmentIdParam string, segmentQosProfileBindingMapIdParam string) (model.SegmentQosProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(segmentQosProfileBindingMapsGetInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("SegmentQosProfileBindingMapId", segmentQosProfileBindingMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentQosProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentQosProfileBindingMapsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentQosProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentQosProfileBindingMapsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentQosProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) List(segmentIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentQosProfileBindingMapListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(segmentQosProfileBindingMapsListInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentQosProfileBindingMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentQosProfileBindingMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentQosProfileBindingMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentQosProfileBindingMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentQosProfileBindingMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) Patch(segmentIdParam string, segmentQosProfileBindingMapIdParam string, segmentQosProfileBindingMapParam model.SegmentQosProfileBindingMap) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(segmentQosProfileBindingMapsPatchInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("SegmentQosProfileBindingMapId", segmentQosProfileBindingMapIdParam) + sv.AddStructField("SegmentQosProfileBindingMap", segmentQosProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentQosProfileBindingMapsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) Update(segmentIdParam string, segmentQosProfileBindingMapIdParam string, segmentQosProfileBindingMapParam model.SegmentQosProfileBindingMap) (model.SegmentQosProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(segmentQosProfileBindingMapsUpdateInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("SegmentQosProfileBindingMapId", segmentQosProfileBindingMapIdParam) + sv.AddStructField("SegmentQosProfileBindingMap", segmentQosProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentQosProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentQosProfileBindingMapsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentQosProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentQosProfileBindingMapsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentQosProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentQosProfileBindingMapsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentQosProfileBindingMapsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentQosProfileBindingMapsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentSecurityProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentSecurityProfileBindingMapsClient.go new file mode 100644 index 000000000..3186e4fec --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultSegmentSecurityProfileBindingMapsClient.go @@ -0,0 +1,564 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SegmentSecurityProfileBindingMaps + * Functions that implement the generated SegmentSecurityProfileBindingMapsClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSegmentSecurityProfileBindingMapsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSegmentSecurityProfileBindingMapsClient(connector client.Connector) *DefaultSegmentSecurityProfileBindingMapsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.segment_security_profile_binding_maps" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSegmentSecurityProfileBindingMapsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) Delete(segmentIdParam string, segmentSecurityProfileBindingMapIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(segmentSecurityProfileBindingMapsDeleteInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("SegmentSecurityProfileBindingMapId", segmentSecurityProfileBindingMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfileBindingMapsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) Get(segmentIdParam string, segmentSecurityProfileBindingMapIdParam string) (model.SegmentSecurityProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(segmentSecurityProfileBindingMapsGetInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("SegmentSecurityProfileBindingMapId", segmentSecurityProfileBindingMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentSecurityProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfileBindingMapsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentSecurityProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentSecurityProfileBindingMapsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentSecurityProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) List(segmentIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentSecurityProfileBindingMapListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(segmentSecurityProfileBindingMapsListInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentSecurityProfileBindingMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfileBindingMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentSecurityProfileBindingMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentSecurityProfileBindingMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentSecurityProfileBindingMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) Patch(segmentIdParam string, segmentSecurityProfileBindingMapIdParam string, segmentSecurityProfileBindingMapParam model.SegmentSecurityProfileBindingMap) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(segmentSecurityProfileBindingMapsPatchInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("SegmentSecurityProfileBindingMapId", segmentSecurityProfileBindingMapIdParam) + sv.AddStructField("SegmentSecurityProfileBindingMap", segmentSecurityProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfileBindingMapsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) Update(segmentIdParam string, segmentSecurityProfileBindingMapIdParam string, segmentSecurityProfileBindingMapParam model.SegmentSecurityProfileBindingMap) (model.SegmentSecurityProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(segmentSecurityProfileBindingMapsUpdateInputType(), typeConverter) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("SegmentSecurityProfileBindingMapId", segmentSecurityProfileBindingMapIdParam) + sv.AddStructField("SegmentSecurityProfileBindingMap", segmentSecurityProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentSecurityProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentSecurityProfileBindingMapsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentSecurityProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentSecurityProfileBindingMapsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentSecurityProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentSecurityProfileBindingMapsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentSecurityProfileBindingMapsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentSecurityProfileBindingMapsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultStateClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultStateClient.go new file mode 100644 index 000000000..c540da94d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultStateClient.go @@ -0,0 +1,185 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: State + * Functions that implement the generated StateClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultStateClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultStateClient(connector client.Connector) *DefaultStateClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.state" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultStateClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + return &sIface +} + +func (sIface *DefaultStateClient) Get(segmentsIdParam string, cursorParam *string, edgePathParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentConfigurationState, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("SegmentsId", segmentsIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EdgePath", edgePathParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentConfigurationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentConfigurationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentConfigurationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultStateClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultStateClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(stateGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(stateGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultStatisticsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultStatisticsClient.go new file mode 100644 index 000000000..cf02a2698 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DefaultStatisticsClient.go @@ -0,0 +1,185 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Statistics + * Functions that implement the generated StatisticsClient interface + */ + + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultStatisticsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultStatisticsClient(connector client.Connector) *DefaultStatisticsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.segments.statistics" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultStatisticsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + return &sIface +} + +func (sIface *DefaultStatisticsClient) Get(segmentsIdParam string, cursorParam *string, edgePathParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("SegmentsId", segmentsIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EdgePath", edgePathParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultStatisticsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultStatisticsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(statisticsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(statisticsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatisticsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatisticsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatisticsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatisticsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatisticsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatisticsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStatisticsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DhcpStaticBindingConfigsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DhcpStaticBindingConfigsClient.go new file mode 100644 index 000000000..afeac5be3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DhcpStaticBindingConfigsClient.go @@ -0,0 +1,88 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: DhcpStaticBindingConfigs + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" +) + +type DhcpStaticBindingConfigsClient interface { + + // Delete DHCP static binding + // + // @param segmentIdParam (required) + // @param bindingIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(segmentIdParam string, bindingIdParam string) error + + // Read DHCP static binding + // + // @param segmentIdParam (required) + // @param bindingIdParam (required) + // @return com.vmware.nsx_global_policy.model.DhcpStaticBindingConfig + // The return value will contain all the properties defined in model.DhcpStaticBindingConfig. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(segmentIdParam string, bindingIdParam string) (*data.StructValue, error) + + // Paginated list of all DHCP static binding instances + // + // @param segmentIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.DhcpStaticBindingConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(segmentIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpStaticBindingConfigListResult, error) + + // If binding with the binding-id is not already present, create a new DHCP static binding instance. If it already exists, replace the existing DHCP static binding instance with specified attributes. + // + // @param segmentIdParam (required) + // @param bindingIdParam (required) + // @param dhcpStaticBindingConfigParam (required) + // The parameter must contain all the properties defined in model.DhcpStaticBindingConfig. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(segmentIdParam string, bindingIdParam string, dhcpStaticBindingConfigParam *data.StructValue) error + + // If binding with the binding-id is not already present, create a new DHCP static binding instance. If it already exists, replace the existing DHCP static binding instance with this object. + // + // @param segmentIdParam (required) + // @param bindingIdParam (required) + // @param dhcpStaticBindingConfigParam (required) + // The parameter must contain all the properties defined in model.DhcpStaticBindingConfig. + // @return com.vmware.nsx_global_policy.model.DhcpStaticBindingConfig + // The return value will contain all the properties defined in model.DhcpStaticBindingConfig. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(segmentIdParam string, bindingIdParam string, dhcpStaticBindingConfigParam *data.StructValue) (*data.StructValue, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DhcpStaticBindingConfigsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DhcpStaticBindingConfigsTypes.go new file mode 100644 index 000000000..4e67cbb3b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/DhcpStaticBindingConfigsTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: DhcpStaticBindingConfigs. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func dhcpStaticBindingConfigsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["binding_id"] = "BindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpStaticBindingConfigsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dhcpStaticBindingConfigsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["binding_id"] = "BindingId" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["binding_id"] = "bindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/segments/{segmentId}/dhcp-static-binding-configs/{bindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpStaticBindingConfigsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["binding_id"] = "BindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpStaticBindingConfigsGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DhcpStaticBindingConfigBindingType),}, bindings.REST) +} + +func dhcpStaticBindingConfigsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["binding_id"] = "BindingId" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["binding_id"] = "bindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/dhcp-static-binding-configs/{bindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpStaticBindingConfigsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpStaticBindingConfigsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpStaticBindingConfigListResultBindingType) +} + +func dhcpStaticBindingConfigsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/dhcp-static-binding-configs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpStaticBindingConfigsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["dhcp_static_binding_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DhcpStaticBindingConfigBindingType),}, bindings.REST) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["dhcp_static_binding_config"] = "DhcpStaticBindingConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpStaticBindingConfigsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dhcpStaticBindingConfigsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["dhcp_static_binding_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DhcpStaticBindingConfigBindingType),}, bindings.REST) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["dhcp_static_binding_config"] = "DhcpStaticBindingConfig" + paramsTypeMap["dhcp_static_binding_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DhcpStaticBindingConfigBindingType),}, bindings.REST) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["binding_id"] = "bindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_static_binding_config", + "PATCH", + "/global-manager/api/v1/global-infra/segments/{segmentId}/dhcp-static-binding-configs/{bindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dhcpStaticBindingConfigsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["dhcp_static_binding_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DhcpStaticBindingConfigBindingType),}, bindings.REST) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["dhcp_static_binding_config"] = "DhcpStaticBindingConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dhcpStaticBindingConfigsUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DhcpStaticBindingConfigBindingType),}, bindings.REST) +} + +func dhcpStaticBindingConfigsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["dhcp_static_binding_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DhcpStaticBindingConfigBindingType),}, bindings.REST) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["dhcp_static_binding_config"] = "DhcpStaticBindingConfig" + paramsTypeMap["dhcp_static_binding_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DhcpStaticBindingConfigBindingType),}, bindings.REST) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["binding_id"] = "bindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_static_binding_config", + "PUT", + "/global-manager/api/v1/global-infra/segments/{segmentId}/dhcp-static-binding-configs/{bindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/PortsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/PortsClient.go new file mode 100644 index 000000000..1ea758896 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/PortsClient.go @@ -0,0 +1,47 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Ports + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type PortsClient interface { + + // Get detail information on an infra segment port by giving ID. + // + // @param segmentIdParam (required) + // @param portIdParam (required) + // @return com.vmware.nsx_global_policy.model.SegmentPort + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(segmentIdParam string, portIdParam string) (model.SegmentPort, error) + + // List all the ports for an infra. + // + // @param segmentIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentPortListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(segmentIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentPortListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/PortsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/PortsTypes.go new file mode 100644 index 000000000..4c390139e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/PortsTypes.go @@ -0,0 +1,170 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Ports. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func portsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["port_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["port_id"] = "PortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func portsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentPortBindingType) +} + +func portsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["port_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["port_id"] = "PortId" + paramsTypeMap["port_id"] = bindings.NewStringType() + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["portId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["port_id"] = "portId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/ports/{portId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func portsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func portsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentPortListResultBindingType) +} + +func portsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/ports", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentDiscoveryProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentDiscoveryProfileBindingMapsClient.go new file mode 100644 index 000000000..a46f7321e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentDiscoveryProfileBindingMapsClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SegmentDiscoveryProfileBindingMaps + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SegmentDiscoveryProfileBindingMapsClient interface { + + // API will delete Segment Discovery Profile Binding Profile + // + // @param infraSegmentIdParam Infra Segment ID (required) + // @param segmentDiscoveryProfileBindingMapIdParam Segment Discovery Profile Binding Map ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(infraSegmentIdParam string, segmentDiscoveryProfileBindingMapIdParam string) error + + // API will get Infra Segment Discovery Profile Binding Map + // + // @param infraSegmentIdParam Infra Segment ID (required) + // @param segmentDiscoveryProfileBindingMapIdParam Segment Discovery Profile Binding Map ID (required) + // @return com.vmware.nsx_global_policy.model.SegmentDiscoveryProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(infraSegmentIdParam string, segmentDiscoveryProfileBindingMapIdParam string) (model.SegmentDiscoveryProfileBindingMap, error) + + // API will list all Infra Segment Discovery Profile Binding Maps in current segment id. + // + // @param infraSegmentIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentDiscoveryProfileBindingMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(infraSegmentIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentDiscoveryProfileBindingMapListResult, error) + + // API will create Infra Segment Discovery Profile Binding Map + // + // @param infraSegmentIdParam Infra Segment ID (required) + // @param segmentDiscoveryProfileBindingMapIdParam Segment Discovery Profile Binding Map ID (required) + // @param segmentDiscoveryProfileBindingMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(infraSegmentIdParam string, segmentDiscoveryProfileBindingMapIdParam string, segmentDiscoveryProfileBindingMapParam model.SegmentDiscoveryProfileBindingMap) error + + // API will update Infra Segment Discovery Profile Binding Map + // + // @param infraSegmentIdParam Infra Segment ID (required) + // @param segmentDiscoveryProfileBindingMapIdParam Segment Discovery Profile Binding Map ID (required) + // @param segmentDiscoveryProfileBindingMapParam (required) + // @return com.vmware.nsx_global_policy.model.SegmentDiscoveryProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(infraSegmentIdParam string, segmentDiscoveryProfileBindingMapIdParam string, segmentDiscoveryProfileBindingMapParam model.SegmentDiscoveryProfileBindingMap) (model.SegmentDiscoveryProfileBindingMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentDiscoveryProfileBindingMapsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentDiscoveryProfileBindingMapsTypes.go new file mode 100644 index 000000000..996452878 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentDiscoveryProfileBindingMapsTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SegmentDiscoveryProfileBindingMaps. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func segmentDiscoveryProfileBindingMapsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_discovery_profile_binding_map_id"] = "SegmentDiscoveryProfileBindingMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentDiscoveryProfileBindingMapsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentDiscoveryProfileBindingMapsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_discovery_profile_binding_map_id"] = "SegmentDiscoveryProfileBindingMapId" + paramsTypeMap["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + paramsTypeMap["segmentDiscoveryProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_discovery_profile_binding_map_id"] = "segmentDiscoveryProfileBindingMapId" + pathParams["infra_segment_id"] = "infraSegmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-discovery-profile-binding-maps/{segmentDiscoveryProfileBindingMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentDiscoveryProfileBindingMapsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_discovery_profile_binding_map_id"] = "SegmentDiscoveryProfileBindingMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentDiscoveryProfileBindingMapsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapBindingType) +} + +func segmentDiscoveryProfileBindingMapsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_discovery_profile_binding_map_id"] = "SegmentDiscoveryProfileBindingMapId" + paramsTypeMap["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + paramsTypeMap["segmentDiscoveryProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_discovery_profile_binding_map_id"] = "segmentDiscoveryProfileBindingMapId" + pathParams["infra_segment_id"] = "infraSegmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-discovery-profile-binding-maps/{segmentDiscoveryProfileBindingMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentDiscoveryProfileBindingMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentDiscoveryProfileBindingMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapListResultBindingType) +} + +func segmentDiscoveryProfileBindingMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + pathParams["infra_segment_id"] = "infraSegmentId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-discovery-profile-binding-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentDiscoveryProfileBindingMapsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map"] = bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapBindingType) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_discovery_profile_binding_map_id"] = "SegmentDiscoveryProfileBindingMapId" + fieldNameMap["segment_discovery_profile_binding_map"] = "SegmentDiscoveryProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentDiscoveryProfileBindingMapsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentDiscoveryProfileBindingMapsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map"] = bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapBindingType) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_discovery_profile_binding_map_id"] = "SegmentDiscoveryProfileBindingMapId" + fieldNameMap["segment_discovery_profile_binding_map"] = "SegmentDiscoveryProfileBindingMap" + paramsTypeMap["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["segment_discovery_profile_binding_map"] = bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapBindingType) + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + paramsTypeMap["segmentDiscoveryProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_discovery_profile_binding_map_id"] = "segmentDiscoveryProfileBindingMapId" + pathParams["infra_segment_id"] = "infraSegmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_discovery_profile_binding_map", + "PATCH", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-discovery-profile-binding-maps/{segmentDiscoveryProfileBindingMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentDiscoveryProfileBindingMapsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map"] = bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapBindingType) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_discovery_profile_binding_map_id"] = "SegmentDiscoveryProfileBindingMapId" + fieldNameMap["segment_discovery_profile_binding_map"] = "SegmentDiscoveryProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentDiscoveryProfileBindingMapsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapBindingType) +} + +func segmentDiscoveryProfileBindingMapsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_discovery_profile_binding_map"] = bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapBindingType) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_discovery_profile_binding_map_id"] = "SegmentDiscoveryProfileBindingMapId" + fieldNameMap["segment_discovery_profile_binding_map"] = "SegmentDiscoveryProfileBindingMap" + paramsTypeMap["segment_discovery_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["segment_discovery_profile_binding_map"] = bindings.NewReferenceType(model.SegmentDiscoveryProfileBindingMapBindingType) + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + paramsTypeMap["segmentDiscoveryProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_discovery_profile_binding_map_id"] = "segmentDiscoveryProfileBindingMapId" + pathParams["infra_segment_id"] = "infraSegmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_discovery_profile_binding_map", + "PUT", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-discovery-profile-binding-maps/{segmentDiscoveryProfileBindingMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentMonitoringProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentMonitoringProfileBindingMapsClient.go new file mode 100644 index 000000000..76651dbc3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentMonitoringProfileBindingMapsClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SegmentMonitoringProfileBindingMaps + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SegmentMonitoringProfileBindingMapsClient interface { + + // API will delete Infra Segment Monitoring Profile Binding Profile. + // + // @param infraSegmentIdParam Infra Segment ID (required) + // @param segmentMonitoringProfileBindingMapIdParam Segment Monitoring Profile Binding Map ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(infraSegmentIdParam string, segmentMonitoringProfileBindingMapIdParam string) error + + // API will get Infra Segment Monitoring Profile Binding Map. + // + // @param infraSegmentIdParam Infra Segment ID (required) + // @param segmentMonitoringProfileBindingMapIdParam Segment Monitoring Profile Binding Map ID (required) + // @return com.vmware.nsx_global_policy.model.SegmentMonitoringProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(infraSegmentIdParam string, segmentMonitoringProfileBindingMapIdParam string) (model.SegmentMonitoringProfileBindingMap, error) + + // API will list all Infra Segment Monitoring Profile Binding Maps in current segment id. + // + // @param infraSegmentIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentMonitoringProfileBindingMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(infraSegmentIdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentMonitoringProfileBindingMapListResult, error) + + // API will create infra segment monitoring profile binding map. + // + // @param infraSegmentIdParam Infra Segment ID (required) + // @param segmentMonitoringProfileBindingMapIdParam Segment Monitoring Profile Binding Map ID (required) + // @param segmentMonitoringProfileBindingMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(infraSegmentIdParam string, segmentMonitoringProfileBindingMapIdParam string, segmentMonitoringProfileBindingMapParam model.SegmentMonitoringProfileBindingMap) error + + // API will update Infra Segment Monitoring Profile Binding Map. + // + // @param infraSegmentIdParam Infra Segment ID (required) + // @param segmentMonitoringProfileBindingMapIdParam Segment Monitoring Profile Binding Map ID (required) + // @param segmentMonitoringProfileBindingMapParam (required) + // @return com.vmware.nsx_global_policy.model.SegmentMonitoringProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(infraSegmentIdParam string, segmentMonitoringProfileBindingMapIdParam string, segmentMonitoringProfileBindingMapParam model.SegmentMonitoringProfileBindingMap) (model.SegmentMonitoringProfileBindingMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentMonitoringProfileBindingMapsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentMonitoringProfileBindingMapsTypes.go new file mode 100644 index 000000000..7978abfd2 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentMonitoringProfileBindingMapsTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SegmentMonitoringProfileBindingMaps. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func segmentMonitoringProfileBindingMapsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_monitoring_profile_binding_map_id"] = "SegmentMonitoringProfileBindingMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentMonitoringProfileBindingMapsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentMonitoringProfileBindingMapsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_monitoring_profile_binding_map_id"] = "SegmentMonitoringProfileBindingMapId" + paramsTypeMap["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + paramsTypeMap["segmentMonitoringProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_monitoring_profile_binding_map_id"] = "segmentMonitoringProfileBindingMapId" + pathParams["infra_segment_id"] = "infraSegmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-monitoring-profile-binding-maps/{segmentMonitoringProfileBindingMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentMonitoringProfileBindingMapsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_monitoring_profile_binding_map_id"] = "SegmentMonitoringProfileBindingMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentMonitoringProfileBindingMapsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapBindingType) +} + +func segmentMonitoringProfileBindingMapsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_monitoring_profile_binding_map_id"] = "SegmentMonitoringProfileBindingMapId" + paramsTypeMap["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + paramsTypeMap["segmentMonitoringProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_monitoring_profile_binding_map_id"] = "segmentMonitoringProfileBindingMapId" + pathParams["infra_segment_id"] = "infraSegmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-monitoring-profile-binding-maps/{segmentMonitoringProfileBindingMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentMonitoringProfileBindingMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentMonitoringProfileBindingMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapListResultBindingType) +} + +func segmentMonitoringProfileBindingMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + pathParams["infra_segment_id"] = "infraSegmentId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-monitoring-profile-binding-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentMonitoringProfileBindingMapsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map"] = bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapBindingType) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_monitoring_profile_binding_map_id"] = "SegmentMonitoringProfileBindingMapId" + fieldNameMap["segment_monitoring_profile_binding_map"] = "SegmentMonitoringProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentMonitoringProfileBindingMapsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentMonitoringProfileBindingMapsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map"] = bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapBindingType) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_monitoring_profile_binding_map_id"] = "SegmentMonitoringProfileBindingMapId" + fieldNameMap["segment_monitoring_profile_binding_map"] = "SegmentMonitoringProfileBindingMap" + paramsTypeMap["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segment_monitoring_profile_binding_map"] = bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapBindingType) + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + paramsTypeMap["segmentMonitoringProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_monitoring_profile_binding_map_id"] = "segmentMonitoringProfileBindingMapId" + pathParams["infra_segment_id"] = "infraSegmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_monitoring_profile_binding_map", + "PATCH", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-monitoring-profile-binding-maps/{segmentMonitoringProfileBindingMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentMonitoringProfileBindingMapsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map"] = bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapBindingType) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_monitoring_profile_binding_map_id"] = "SegmentMonitoringProfileBindingMapId" + fieldNameMap["segment_monitoring_profile_binding_map"] = "SegmentMonitoringProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentMonitoringProfileBindingMapsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapBindingType) +} + +func segmentMonitoringProfileBindingMapsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["infra_segment_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_monitoring_profile_binding_map"] = bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapBindingType) + fieldNameMap["infra_segment_id"] = "InfraSegmentId" + fieldNameMap["segment_monitoring_profile_binding_map_id"] = "SegmentMonitoringProfileBindingMapId" + fieldNameMap["segment_monitoring_profile_binding_map"] = "SegmentMonitoringProfileBindingMap" + paramsTypeMap["segment_monitoring_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segment_monitoring_profile_binding_map"] = bindings.NewReferenceType(model.SegmentMonitoringProfileBindingMapBindingType) + paramsTypeMap["infra_segment_id"] = bindings.NewStringType() + paramsTypeMap["infraSegmentId"] = bindings.NewStringType() + paramsTypeMap["segmentMonitoringProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_monitoring_profile_binding_map_id"] = "segmentMonitoringProfileBindingMapId" + pathParams["infra_segment_id"] = "infraSegmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_monitoring_profile_binding_map", + "PUT", + "/global-manager/api/v1/global-infra/segments/{infraSegmentId}/segment-monitoring-profile-binding-maps/{segmentMonitoringProfileBindingMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentQosProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentQosProfileBindingMapsClient.go new file mode 100644 index 000000000..40b407e3e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentQosProfileBindingMapsClient.go @@ -0,0 +1,82 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SegmentQosProfileBindingMaps + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SegmentQosProfileBindingMapsClient interface { + + // API will delete Segment QoS Profile Binding Profile. + // + // @param segmentIdParam Segment ID (required) + // @param segmentQosProfileBindingMapIdParam Segment QoS Profile Binding Map ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(segmentIdParam string, segmentQosProfileBindingMapIdParam string) error + + // API will get Segment QoS Profile Binding Map. + // + // @param segmentIdParam Segment ID (required) + // @param segmentQosProfileBindingMapIdParam Segment QoS Profile Binding Map ID (required) + // @return com.vmware.nsx_global_policy.model.SegmentQoSProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(segmentIdParam string, segmentQosProfileBindingMapIdParam string) (model.SegmentQosProfileBindingMap, error) + + // API will list all Segment QoS Profile Binding Maps in current segment id. + // + // @param segmentIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentQoSProfileBindingMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(segmentIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentQosProfileBindingMapListResult, error) + + // API will create segment QoS profile binding map. + // + // @param segmentIdParam Segment ID (required) + // @param segmentQosProfileBindingMapIdParam Segment QoS Profile Binding Map ID (required) + // @param segmentQosProfileBindingMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(segmentIdParam string, segmentQosProfileBindingMapIdParam string, segmentQosProfileBindingMapParam model.SegmentQosProfileBindingMap) error + + // API will update Segment QoS Profile Binding Map. + // + // @param segmentIdParam Segment ID (required) + // @param segmentQosProfileBindingMapIdParam Segment QoS Profile Binding Map ID (required) + // @param segmentQosProfileBindingMapParam (required) + // @return com.vmware.nsx_global_policy.model.SegmentQoSProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(segmentIdParam string, segmentQosProfileBindingMapIdParam string, segmentQosProfileBindingMapParam model.SegmentQosProfileBindingMap) (model.SegmentQosProfileBindingMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentQosProfileBindingMapsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentQosProfileBindingMapsTypes.go new file mode 100644 index 000000000..f91bf9d7f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentQosProfileBindingMapsTypes.go @@ -0,0 +1,345 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SegmentQosProfileBindingMaps. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func segmentQosProfileBindingMapsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_qos_profile_binding_map_id"] = "SegmentQosProfileBindingMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentQosProfileBindingMapsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentQosProfileBindingMapsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_qos_profile_binding_map_id"] = "SegmentQosProfileBindingMapId" + paramsTypeMap["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["segmentQosProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["segment_qos_profile_binding_map_id"] = "segmentQosProfileBindingMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-qos-profile-binding-maps/{segmentQosProfileBindingMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentQosProfileBindingMapsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_qos_profile_binding_map_id"] = "SegmentQosProfileBindingMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentQosProfileBindingMapsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentQosProfileBindingMapBindingType) +} + +func segmentQosProfileBindingMapsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_qos_profile_binding_map_id"] = "SegmentQosProfileBindingMapId" + paramsTypeMap["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["segmentQosProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["segment_qos_profile_binding_map_id"] = "segmentQosProfileBindingMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-qos-profile-binding-maps/{segmentQosProfileBindingMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentQosProfileBindingMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentQosProfileBindingMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentQosProfileBindingMapListResultBindingType) +} + +func segmentQosProfileBindingMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-qos-profile-binding-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentQosProfileBindingMapsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map"] = bindings.NewReferenceType(model.SegmentQosProfileBindingMapBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_qos_profile_binding_map_id"] = "SegmentQosProfileBindingMapId" + fieldNameMap["segment_qos_profile_binding_map"] = "SegmentQosProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentQosProfileBindingMapsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentQosProfileBindingMapsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map"] = bindings.NewReferenceType(model.SegmentQosProfileBindingMapBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_qos_profile_binding_map_id"] = "SegmentQosProfileBindingMapId" + fieldNameMap["segment_qos_profile_binding_map"] = "SegmentQosProfileBindingMap" + paramsTypeMap["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segment_qos_profile_binding_map"] = bindings.NewReferenceType(model.SegmentQosProfileBindingMapBindingType) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["segmentQosProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["segment_qos_profile_binding_map_id"] = "segmentQosProfileBindingMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_qos_profile_binding_map", + "PATCH", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-qos-profile-binding-maps/{segmentQosProfileBindingMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentQosProfileBindingMapsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map"] = bindings.NewReferenceType(model.SegmentQosProfileBindingMapBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_qos_profile_binding_map_id"] = "SegmentQosProfileBindingMapId" + fieldNameMap["segment_qos_profile_binding_map"] = "SegmentQosProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentQosProfileBindingMapsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentQosProfileBindingMapBindingType) +} + +func segmentQosProfileBindingMapsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_qos_profile_binding_map"] = bindings.NewReferenceType(model.SegmentQosProfileBindingMapBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_qos_profile_binding_map_id"] = "SegmentQosProfileBindingMapId" + fieldNameMap["segment_qos_profile_binding_map"] = "SegmentQosProfileBindingMap" + paramsTypeMap["segment_qos_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segment_qos_profile_binding_map"] = bindings.NewReferenceType(model.SegmentQosProfileBindingMapBindingType) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["segmentQosProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["segment_qos_profile_binding_map_id"] = "segmentQosProfileBindingMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_qos_profile_binding_map", + "PUT", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-qos-profile-binding-maps/{segmentQosProfileBindingMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentSecurityProfileBindingMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentSecurityProfileBindingMapsClient.go new file mode 100644 index 000000000..a4d58a1a9 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentSecurityProfileBindingMapsClient.go @@ -0,0 +1,82 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SegmentSecurityProfileBindingMaps + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SegmentSecurityProfileBindingMapsClient interface { + + // API will delete segment security profile binding map. + // + // @param segmentIdParam segment id (required) + // @param segmentSecurityProfileBindingMapIdParam segment security profile binding map id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(segmentIdParam string, segmentSecurityProfileBindingMapIdParam string) error + + // API will return details of the segment security profile binding map. If the binding map does not exist, it will return 404. + // + // @param segmentIdParam segment id (required) + // @param segmentSecurityProfileBindingMapIdParam segment security profile binding map id (required) + // @return com.vmware.nsx_global_policy.model.SegmentSecurityProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(segmentIdParam string, segmentSecurityProfileBindingMapIdParam string) (model.SegmentSecurityProfileBindingMap, error) + + // API will list all segment security profile binding maps. + // + // @param segmentIdParam segment id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentSecurityProfileBindingMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(segmentIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentSecurityProfileBindingMapListResult, error) + + // Create a new segment security profile binding map if the given security profile binding map does not exist. Otherwise, patch the existing segment security profile binding map. + // + // @param segmentIdParam segment id (required) + // @param segmentSecurityProfileBindingMapIdParam segment security profile binding map id (required) + // @param segmentSecurityProfileBindingMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(segmentIdParam string, segmentSecurityProfileBindingMapIdParam string, segmentSecurityProfileBindingMapParam model.SegmentSecurityProfileBindingMap) error + + // API will create or replace segment security profile binding map. + // + // @param segmentIdParam segment id (required) + // @param segmentSecurityProfileBindingMapIdParam segment security profile binding map id (required) + // @param segmentSecurityProfileBindingMapParam (required) + // @return com.vmware.nsx_global_policy.model.SegmentSecurityProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(segmentIdParam string, segmentSecurityProfileBindingMapIdParam string, segmentSecurityProfileBindingMapParam model.SegmentSecurityProfileBindingMap) (model.SegmentSecurityProfileBindingMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentSecurityProfileBindingMapsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentSecurityProfileBindingMapsTypes.go new file mode 100644 index 000000000..850cd7e92 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentSecurityProfileBindingMapsTypes.go @@ -0,0 +1,345 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SegmentSecurityProfileBindingMaps. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func segmentSecurityProfileBindingMapsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_security_profile_binding_map_id"] = "SegmentSecurityProfileBindingMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfileBindingMapsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentSecurityProfileBindingMapsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_security_profile_binding_map_id"] = "SegmentSecurityProfileBindingMapId" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment_security_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["segmentSecurityProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["segment_security_profile_binding_map_id"] = "segmentSecurityProfileBindingMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-security-profile-binding-maps/{segmentSecurityProfileBindingMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentSecurityProfileBindingMapsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_security_profile_binding_map_id"] = "SegmentSecurityProfileBindingMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfileBindingMapsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapBindingType) +} + +func segmentSecurityProfileBindingMapsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map_id"] = bindings.NewStringType() + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_security_profile_binding_map_id"] = "SegmentSecurityProfileBindingMapId" + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment_security_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["segmentSecurityProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["segment_security_profile_binding_map_id"] = "segmentSecurityProfileBindingMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-security-profile-binding-maps/{segmentSecurityProfileBindingMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentSecurityProfileBindingMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfileBindingMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapListResultBindingType) +} + +func segmentSecurityProfileBindingMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-security-profile-binding-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentSecurityProfileBindingMapsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_security_profile_binding_map_id"] = "SegmentSecurityProfileBindingMapId" + fieldNameMap["segment_security_profile_binding_map"] = "SegmentSecurityProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfileBindingMapsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentSecurityProfileBindingMapsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_security_profile_binding_map_id"] = "SegmentSecurityProfileBindingMapId" + fieldNameMap["segment_security_profile_binding_map"] = "SegmentSecurityProfileBindingMap" + paramsTypeMap["segment_security_profile_binding_map"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapBindingType) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment_security_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["segmentSecurityProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["segment_security_profile_binding_map_id"] = "segmentSecurityProfileBindingMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_security_profile_binding_map", + "PATCH", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-security-profile-binding-maps/{segmentSecurityProfileBindingMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentSecurityProfileBindingMapsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_security_profile_binding_map_id"] = "SegmentSecurityProfileBindingMapId" + fieldNameMap["segment_security_profile_binding_map"] = "SegmentSecurityProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentSecurityProfileBindingMapsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapBindingType) +} + +func segmentSecurityProfileBindingMapsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segment_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map_id"] = bindings.NewStringType() + fields["segment_security_profile_binding_map"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapBindingType) + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment_security_profile_binding_map_id"] = "SegmentSecurityProfileBindingMapId" + fieldNameMap["segment_security_profile_binding_map"] = "SegmentSecurityProfileBindingMap" + paramsTypeMap["segment_security_profile_binding_map"] = bindings.NewReferenceType(model.SegmentSecurityProfileBindingMapBindingType) + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment_security_profile_binding_map_id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + paramsTypeMap["segmentSecurityProfileBindingMapId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["segment_security_profile_binding_map_id"] = "segmentSecurityProfileBindingMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment_security_profile_binding_map", + "PUT", + "/global-manager/api/v1/global-infra/segments/{segmentId}/segment-security-profile-binding-maps/{segmentSecurityProfileBindingMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentsPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentsPackageTypes.go new file mode 100644 index 000000000..a0abbbf9c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/SegmentsPackageTypes.go @@ -0,0 +1,19 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy.global_infra.segments. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + + + + + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StateClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StateClient.go new file mode 100644 index 000000000..9d5bd8ab6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StateClient.go @@ -0,0 +1,37 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: State + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type StateClient interface { + + // Get infra segment state information. + // + // @param segmentsIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param edgePathParam Policy path of edge node (optional) + // @param enforcementPointPathParam String Path of the enforcement point (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentConfigurationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(segmentsIdParam string, cursorParam *string, edgePathParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentConfigurationState, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StateTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StateTypes.go new file mode 100644 index 000000000..cba64a7be --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StateTypes.go @@ -0,0 +1,125 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: State. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segments_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segments_id"] = "SegmentsId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentConfigurationStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segments_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segments_id"] = "SegmentsId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["segments_id"] = bindings.NewStringType() + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segmentsId"] = bindings.NewStringType() + pathParams["segments_id"] = "segmentsId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["edge_path"] = "edge_path" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentsId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StatisticsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StatisticsClient.go new file mode 100644 index 000000000..f86e44b2c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StatisticsClient.go @@ -0,0 +1,37 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Statistics + * Used by client-side stubs. + */ + +package segments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type StatisticsClient interface { + + // Get infra segment statistics information. + // + // @param segmentsIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param edgePathParam Policy path of edge node (optional) + // @param enforcementPointPathParam String Path of the enforcement point (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(segmentsIdParam string, cursorParam *string, edgePathParam *string, enforcementPointPathParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentStatistics, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StatisticsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StatisticsTypes.go new file mode 100644 index 000000000..1582fafc4 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments/StatisticsTypes.go @@ -0,0 +1,125 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Statistics. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package segments + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segments_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segments_id"] = "SegmentsId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["segments_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segments_id"] = "SegmentsId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["segments_id"] = bindings.NewStringType() + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["segmentsId"] = bindings.NewStringType() + pathParams["segments_id"] = "segmentsId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["edge_path"] = "edge_path" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/segments/{segmentsId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/CommunityListsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/CommunityListsClient.go new file mode 100644 index 000000000..d89fa3d0e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/CommunityListsClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: CommunityLists + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type CommunityListsClient interface { + + // Delete a BGP community list + // + // @param tier0IdParam (required) + // @param communityListIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string, communityListIdParam string) error + + // Read a BGP community list + // + // @param tier0IdParam (required) + // @param communityListIdParam (required) + // @return com.vmware.nsx_global_policy.model.CommunityList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string, communityListIdParam string) (model.CommunityList, error) + + // Paginated list of all community lists under a tier-0 + // + // @param tier0IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.CommunityListListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.CommunityListListResult, error) + + // If a community list with the community-list-id is not already present, create a new community list. If it already exists, update the community list for specified attributes. + // + // @param tier0IdParam (required) + // @param communityListIdParam (required) + // @param communityListParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, communityListIdParam string, communityListParam model.CommunityList) error + + // If a community list with the community-list-id is not already present, create a new community list. If it already exists, replace the community list instance with the new object. + // + // @param tier0IdParam (required) + // @param communityListIdParam (required) + // @param communityListParam (required) + // @return com.vmware.nsx_global_policy.model.CommunityList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, communityListIdParam string, communityListParam model.CommunityList) (model.CommunityList, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/CommunityListsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/CommunityListsTypes.go new file mode 100644 index 000000000..421395970 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/CommunityListsTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: CommunityLists. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func communityListsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["community_list_id"] = "CommunityListId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func communityListsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["community_list_id"] = "CommunityListId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["community_list_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["communityListId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["community_list_id"] = "communityListId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/community-lists/{communityListId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func communityListsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["community_list_id"] = "CommunityListId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CommunityListBindingType) +} + +func communityListsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["community_list_id"] = "CommunityListId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["community_list_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["communityListId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["community_list_id"] = "communityListId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/community-lists/{communityListId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func communityListsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CommunityListListResultBindingType) +} + +func communityListsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/community-lists", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func communityListsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fields["community_list"] = bindings.NewReferenceType(model.CommunityListBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["community_list_id"] = "CommunityListId" + fieldNameMap["community_list"] = "CommunityList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func communityListsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fields["community_list"] = bindings.NewReferenceType(model.CommunityListBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["community_list_id"] = "CommunityListId" + fieldNameMap["community_list"] = "CommunityList" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["community_list_id"] = bindings.NewStringType() + paramsTypeMap["community_list"] = bindings.NewReferenceType(model.CommunityListBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["communityListId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["community_list_id"] = "communityListId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "community_list", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/community-lists/{communityListId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func communityListsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fields["community_list"] = bindings.NewReferenceType(model.CommunityListBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["community_list_id"] = "CommunityListId" + fieldNameMap["community_list"] = "CommunityList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CommunityListBindingType) +} + +func communityListsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fields["community_list"] = bindings.NewReferenceType(model.CommunityListBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["community_list_id"] = "CommunityListId" + fieldNameMap["community_list"] = "CommunityList" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["community_list_id"] = bindings.NewStringType() + paramsTypeMap["community_list"] = bindings.NewReferenceType(model.CommunityListBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["communityListId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["community_list_id"] = "communityListId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "community_list", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/community-lists/{communityListId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultCommunityListsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultCommunityListsClient.go new file mode 100644 index 000000000..a6efb6596 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultCommunityListsClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: CommunityLists + * Functions that implement the generated CommunityListsClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultCommunityListsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultCommunityListsClient(connector client.Connector) *DefaultCommunityListsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.community_lists" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + cIface := DefaultCommunityListsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + cIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + cIface.methodNameToDefMap["delete"] = cIface.deleteMethodDefinition() + cIface.methodNameToDefMap["get"] = cIface.getMethodDefinition() + cIface.methodNameToDefMap["list"] = cIface.listMethodDefinition() + cIface.methodNameToDefMap["patch"] = cIface.patchMethodDefinition() + cIface.methodNameToDefMap["update"] = cIface.updateMethodDefinition() + return &cIface +} + +func (cIface *DefaultCommunityListsClient) Delete(tier0IdParam string, communityListIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(communityListsDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("CommunityListId", communityListIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultCommunityListsClient) Get(tier0IdParam string, communityListIdParam string) (model.CommunityList, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(communityListsGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("CommunityListId", communityListIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CommunityList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.CommunityList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), communityListsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CommunityList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultCommunityListsClient) List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.CommunityListListResult, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(communityListsListInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CommunityListListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.CommunityListListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), communityListsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CommunityListListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *DefaultCommunityListsClient) Patch(tier0IdParam string, communityListIdParam string, communityListParam model.CommunityList) error { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(communityListsPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("CommunityListId", communityListIdParam) + sv.AddStructField("CommunityList", communityListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *DefaultCommunityListsClient) Update(tier0IdParam string, communityListIdParam string, communityListParam model.CommunityList) (model.CommunityList, error) { + typeConverter := cIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(cIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(communityListsUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("CommunityListId", communityListIdParam) + sv.AddStructField("CommunityList", communityListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CommunityList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := cIface.connector.NewExecutionContext() + methodResult := cIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.CommunityList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), communityListsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CommunityList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (cIface *DefaultCommunityListsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := cIface.connector.GetApiProvider().Invoke(cIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (cIface *DefaultCommunityListsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(communityListsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(communityListsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCommunityListsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(communityListsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(communityListsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCommunityListsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(communityListsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(communityListsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCommunityListsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(communityListsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(communityListsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (cIface *DefaultCommunityListsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(cIface.interfaceName) + typeConverter := cIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(communityListsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(communityListsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + cIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + cIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultCommunityListsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultDnsForwarderClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultDnsForwarderClient.go new file mode 100644 index 000000000..7a7b2fb2c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultDnsForwarderClient.go @@ -0,0 +1,551 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: DnsForwarder + * Functions that implement the generated DnsForwarderClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDnsForwarderClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDnsForwarderClient(connector client.Connector) *DefaultDnsForwarderClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.dns_forwarder" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "create"), + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDnsForwarderClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["create"] = dIface.createMethodDefinition() + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDnsForwarderClient) Create(tier0IdParam string, actionParam string, enforcementPointPathParam *string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "create") + sv := bindings.NewStructValueBuilder(dnsForwarderCreateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Action", actionParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderClient) Delete(tier0IdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(dnsForwarderDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderClient) Get(tier0IdParam string) (model.PolicyDnsForwarder, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(dnsForwarderGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDnsForwarder + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDnsForwarder + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsForwarderGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDnsForwarder), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderClient) Patch(tier0IdParam string, policyDnsForwarderParam model.PolicyDnsForwarder) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(dnsForwarderPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("PolicyDnsForwarder", policyDnsForwarderParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderClient) Update(tier0IdParam string, policyDnsForwarderParam model.PolicyDnsForwarder) (model.PolicyDnsForwarder, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(dnsForwarderUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("PolicyDnsForwarder", policyDnsForwarderParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDnsForwarder + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDnsForwarder + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsForwarderUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDnsForwarder), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDnsForwarderClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDnsForwarderClient) createMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderCreateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderCreateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "create") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultFloodProtectionProfileBindingsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultFloodProtectionProfileBindingsClient.go new file mode 100644 index 000000000..16725ac22 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultFloodProtectionProfileBindingsClient.go @@ -0,0 +1,462 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FloodProtectionProfileBindings + * Functions that implement the generated FloodProtectionProfileBindingsClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFloodProtectionProfileBindingsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFloodProtectionProfileBindingsClient(connector client.Connector) *DefaultFloodProtectionProfileBindingsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.flood_protection_profile_bindings" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFloodProtectionProfileBindingsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["delete"] = fIface.deleteMethodDefinition() + fIface.methodNameToDefMap["get"] = fIface.getMethodDefinition() + fIface.methodNameToDefMap["patch"] = fIface.patchMethodDefinition() + fIface.methodNameToDefMap["update"] = fIface.updateMethodDefinition() + return &fIface +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Delete(tier0IdParam string, floodProtectionProfileBindingIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(floodProtectionProfileBindingsDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("FloodProtectionProfileBindingId", floodProtectionProfileBindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfileBindingsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Get(tier0IdParam string, floodProtectionProfileBindingIdParam string) (model.FloodProtectionProfileBindingMap, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(floodProtectionProfileBindingsGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("FloodProtectionProfileBindingId", floodProtectionProfileBindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FloodProtectionProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfileBindingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FloodProtectionProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), floodProtectionProfileBindingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FloodProtectionProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Patch(tier0IdParam string, floodProtectionProfileBindingIdParam string, floodProtectionProfileBindingMapParam model.FloodProtectionProfileBindingMap) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(floodProtectionProfileBindingsPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("FloodProtectionProfileBindingId", floodProtectionProfileBindingIdParam) + sv.AddStructField("FloodProtectionProfileBindingMap", floodProtectionProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfileBindingsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Update(tier0IdParam string, floodProtectionProfileBindingIdParam string, floodProtectionProfileBindingMapParam model.FloodProtectionProfileBindingMap) (model.FloodProtectionProfileBindingMap, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(floodProtectionProfileBindingsUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("FloodProtectionProfileBindingId", floodProtectionProfileBindingIdParam) + sv.AddStructField("FloodProtectionProfileBindingMap", floodProtectionProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FloodProtectionProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfileBindingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FloodProtectionProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), floodProtectionProfileBindingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FloodProtectionProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFloodProtectionProfileBindingsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultForwardingTableClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultForwardingTableClient.go new file mode 100644 index 000000000..72e141610 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultForwardingTableClient.go @@ -0,0 +1,187 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: ForwardingTable + * Functions that implement the generated ForwardingTableClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultForwardingTableClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultForwardingTableClient(connector client.Connector) *DefaultForwardingTableClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.forwarding_table" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultForwardingTableClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + return &fIface +} + +func (fIface *DefaultForwardingTableClient) List(tier0IdParam string, cursorParam *string, edgeIdParam *string, edgePathParam *string, enforcementPointPathParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, routeSourceParam *string, sortAscendingParam *bool, sortByParam *string) (model.RoutingTableListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(forwardingTableListInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EdgeId", edgeIdParam) + sv.AddStructField("EdgePath", edgePathParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NetworkPrefix", networkPrefixParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("RouteSource", routeSourceParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoutingTableListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardingTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.RoutingTableListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardingTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoutingTableListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultForwardingTableClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultForwardingTableClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(forwardingTableListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(forwardingTableListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultGatewayFirewallClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultGatewayFirewallClient.go new file mode 100644 index 000000000..7790a402c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultGatewayFirewallClient.go @@ -0,0 +1,177 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GatewayFirewall + * Functions that implement the generated GatewayFirewallClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGatewayFirewallClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGatewayFirewallClient(connector client.Connector) *DefaultGatewayFirewallClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.gateway_firewall" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGatewayFirewallClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["list"] = gIface.listMethodDefinition() + return &gIface +} + +func (gIface *DefaultGatewayFirewallClient) List(tier0IdParam string) (model.GatewayPolicyListResult, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(gatewayFirewallListInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayPolicyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayFirewallListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayPolicyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayFirewallListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayPolicyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGatewayFirewallClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGatewayFirewallClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayFirewallListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayFirewallListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultLocaleServicesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultLocaleServicesClient.go new file mode 100644 index 000000000..fb90368b3 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultLocaleServicesClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: LocaleServices + * Functions that implement the generated LocaleServicesClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultLocaleServicesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultLocaleServicesClient(connector client.Connector) *DefaultLocaleServicesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.locale_services" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + lIface := DefaultLocaleServicesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + lIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + lIface.methodNameToDefMap["delete"] = lIface.deleteMethodDefinition() + lIface.methodNameToDefMap["get"] = lIface.getMethodDefinition() + lIface.methodNameToDefMap["list"] = lIface.listMethodDefinition() + lIface.methodNameToDefMap["patch"] = lIface.patchMethodDefinition() + lIface.methodNameToDefMap["update"] = lIface.updateMethodDefinition() + return &lIface +} + +func (lIface *DefaultLocaleServicesClient) Delete(tier0IdParam string, localeServicesIdParam string) error { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(localeServicesDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("LocaleServicesId", localeServicesIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *DefaultLocaleServicesClient) Get(tier0IdParam string, localeServicesIdParam string) (model.LocaleServices, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(localeServicesGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("LocaleServicesId", localeServicesIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LocaleServices + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.LocaleServices + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localeServicesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LocaleServices), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *DefaultLocaleServicesClient) List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LocaleServicesListResult, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(localeServicesListInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LocaleServicesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.LocaleServicesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localeServicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LocaleServicesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *DefaultLocaleServicesClient) Patch(tier0IdParam string, localeServicesIdParam string, localeServicesParam model.LocaleServices) error { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(localeServicesPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("LocaleServicesId", localeServicesIdParam) + sv.AddStructField("LocaleServices", localeServicesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *DefaultLocaleServicesClient) Update(tier0IdParam string, localeServicesIdParam string, localeServicesParam model.LocaleServices) (model.LocaleServices, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(localeServicesUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("LocaleServicesId", localeServicesIdParam) + sv.AddStructField("LocaleServices", localeServicesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LocaleServices + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.LocaleServices + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localeServicesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LocaleServices), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (lIface *DefaultLocaleServicesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := lIface.connector.GetApiProvider().Invoke(lIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (lIface *DefaultLocaleServicesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLocaleServicesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLocaleServicesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLocaleServicesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLocaleServicesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultPrefixListsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultPrefixListsClient.go new file mode 100644 index 000000000..77f9e00fd --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultPrefixListsClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: PrefixLists + * Functions that implement the generated PrefixListsClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultPrefixListsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultPrefixListsClient(connector client.Connector) *DefaultPrefixListsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.prefix_lists" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + pIface := DefaultPrefixListsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + pIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + pIface.methodNameToDefMap["delete"] = pIface.deleteMethodDefinition() + pIface.methodNameToDefMap["get"] = pIface.getMethodDefinition() + pIface.methodNameToDefMap["list"] = pIface.listMethodDefinition() + pIface.methodNameToDefMap["patch"] = pIface.patchMethodDefinition() + pIface.methodNameToDefMap["update"] = pIface.updateMethodDefinition() + return &pIface +} + +func (pIface *DefaultPrefixListsClient) Delete(tier0IdParam string, prefixListIdParam string) error { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(prefixListsDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("PrefixListId", prefixListIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := prefixListsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *DefaultPrefixListsClient) Get(tier0IdParam string, prefixListIdParam string) (model.PrefixList, error) { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(prefixListsGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("PrefixListId", prefixListIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PrefixList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := prefixListsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PrefixList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), prefixListsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PrefixList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *DefaultPrefixListsClient) List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PrefixListResult, error) { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(prefixListsListInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PrefixListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := prefixListsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PrefixListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), prefixListsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PrefixListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *DefaultPrefixListsClient) Patch(tier0IdParam string, prefixListIdParam string, prefixListParam model.PrefixList) error { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(prefixListsPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("PrefixListId", prefixListIdParam) + sv.AddStructField("PrefixList", prefixListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := prefixListsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *DefaultPrefixListsClient) Update(tier0IdParam string, prefixListIdParam string, prefixListParam model.PrefixList) (model.PrefixList, error) { + typeConverter := pIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(pIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(prefixListsUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("PrefixListId", prefixListIdParam) + sv.AddStructField("PrefixList", prefixListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PrefixList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := prefixListsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := pIface.connector.NewExecutionContext() + methodResult := pIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PrefixList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), prefixListsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PrefixList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (pIface *DefaultPrefixListsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := pIface.connector.GetApiProvider().Invoke(pIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (pIface *DefaultPrefixListsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(prefixListsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(prefixListsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPrefixListsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(prefixListsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(prefixListsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPrefixListsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(prefixListsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(prefixListsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPrefixListsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(prefixListsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(prefixListsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (pIface *DefaultPrefixListsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(pIface.interfaceName) + typeConverter := pIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(prefixListsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(prefixListsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + pIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + pIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultPrefixListsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultRouteMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultRouteMapsClient.go new file mode 100644 index 000000000..cb9eba4fb --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultRouteMapsClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: RouteMaps + * Functions that implement the generated RouteMapsClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultRouteMapsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultRouteMapsClient(connector client.Connector) *DefaultRouteMapsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.route_maps" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + rIface := DefaultRouteMapsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + rIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + rIface.methodNameToDefMap["delete"] = rIface.deleteMethodDefinition() + rIface.methodNameToDefMap["get"] = rIface.getMethodDefinition() + rIface.methodNameToDefMap["list"] = rIface.listMethodDefinition() + rIface.methodNameToDefMap["patch"] = rIface.patchMethodDefinition() + rIface.methodNameToDefMap["update"] = rIface.updateMethodDefinition() + return &rIface +} + +func (rIface *DefaultRouteMapsClient) Delete(tier0IdParam string, routeMapIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(rIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(routeMapsDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("RouteMapId", routeMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := rIface.connector.NewExecutionContext() + methodResult := rIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *DefaultRouteMapsClient) Get(tier0IdParam string, routeMapIdParam string) (model.Tier0RouteMap, error) { + typeConverter := rIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(rIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(routeMapsGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("RouteMapId", routeMapIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier0RouteMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := rIface.connector.NewExecutionContext() + methodResult := rIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier0RouteMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routeMapsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier0RouteMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *DefaultRouteMapsClient) List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier0RouteMapListResult, error) { + typeConverter := rIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(rIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(routeMapsListInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier0RouteMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := rIface.connector.NewExecutionContext() + methodResult := rIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier0RouteMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routeMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier0RouteMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *DefaultRouteMapsClient) Patch(tier0IdParam string, routeMapIdParam string, tier0RouteMapParam model.Tier0RouteMap) error { + typeConverter := rIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(rIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(routeMapsPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("RouteMapId", routeMapIdParam) + sv.AddStructField("Tier0RouteMap", tier0RouteMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := rIface.connector.NewExecutionContext() + methodResult := rIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *DefaultRouteMapsClient) Update(tier0IdParam string, routeMapIdParam string, tier0RouteMapParam model.Tier0RouteMap) (model.Tier0RouteMap, error) { + typeConverter := rIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(rIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(routeMapsUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("RouteMapId", routeMapIdParam) + sv.AddStructField("Tier0RouteMap", tier0RouteMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier0RouteMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := rIface.connector.NewExecutionContext() + methodResult := rIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier0RouteMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routeMapsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier0RouteMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (rIface *DefaultRouteMapsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := rIface.connector.GetApiProvider().Invoke(rIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (rIface *DefaultRouteMapsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(rIface.interfaceName) + typeConverter := rIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(routeMapsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(routeMapsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + rIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (rIface *DefaultRouteMapsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(rIface.interfaceName) + typeConverter := rIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(routeMapsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(routeMapsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + rIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (rIface *DefaultRouteMapsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(rIface.interfaceName) + typeConverter := rIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(routeMapsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(routeMapsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + rIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (rIface *DefaultRouteMapsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(rIface.interfaceName) + typeConverter := rIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(routeMapsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(routeMapsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + rIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (rIface *DefaultRouteMapsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(rIface.interfaceName) + typeConverter := rIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(routeMapsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(routeMapsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + rIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRouteMapsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultRoutingTableClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultRoutingTableClient.go new file mode 100644 index 000000000..2d2ba7fd2 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultRoutingTableClient.go @@ -0,0 +1,187 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: RoutingTable + * Functions that implement the generated RoutingTableClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultRoutingTableClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultRoutingTableClient(connector client.Connector) *DefaultRoutingTableClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.routing_table" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + rIface := DefaultRoutingTableClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + rIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + rIface.methodNameToDefMap["list"] = rIface.listMethodDefinition() + return &rIface +} + +func (rIface *DefaultRoutingTableClient) List(tier0IdParam string, cursorParam *string, edgeIdParam *string, edgePathParam *string, enforcementPointPathParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, routeSourceParam *string, sortAscendingParam *bool, sortByParam *string) (model.RoutingTableListResult, error) { + typeConverter := rIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(rIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(routingTableListInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EdgeId", edgeIdParam) + sv.AddStructField("EdgePath", edgePathParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NetworkPrefix", networkPrefixParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("RouteSource", routeSourceParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoutingTableListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routingTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := rIface.connector.NewExecutionContext() + methodResult := rIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.RoutingTableListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routingTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoutingTableListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (rIface *DefaultRoutingTableClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := rIface.connector.GetApiProvider().Invoke(rIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (rIface *DefaultRoutingTableClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(rIface.interfaceName) + typeConverter := rIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(routingTableListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(routingTableListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRoutingTableClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRoutingTableClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + rIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRoutingTableClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRoutingTableClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRoutingTableClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRoutingTableClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + rIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultRoutingTableClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultSessionTimerProfileBindingsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultSessionTimerProfileBindingsClient.go new file mode 100644 index 000000000..824dc8aa5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultSessionTimerProfileBindingsClient.go @@ -0,0 +1,462 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SessionTimerProfileBindings + * Functions that implement the generated SessionTimerProfileBindingsClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSessionTimerProfileBindingsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSessionTimerProfileBindingsClient(connector client.Connector) *DefaultSessionTimerProfileBindingsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.session_timer_profile_bindings" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSessionTimerProfileBindingsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) Delete(tier0IdParam string, sessionTimerProfileBindingIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(sessionTimerProfileBindingsDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("SessionTimerProfileBindingId", sessionTimerProfileBindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTimerProfileBindingsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) Get(tier0IdParam string, sessionTimerProfileBindingIdParam string) (model.SessionTimerProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(sessionTimerProfileBindingsGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("SessionTimerProfileBindingId", sessionTimerProfileBindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SessionTimerProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTimerProfileBindingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SessionTimerProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionTimerProfileBindingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SessionTimerProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) Patch(tier0IdParam string, sessionTimerProfileBindingIdParam string, sessionTimerProfileBindingMapParam model.SessionTimerProfileBindingMap) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(sessionTimerProfileBindingsPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("SessionTimerProfileBindingId", sessionTimerProfileBindingIdParam) + sv.AddStructField("SessionTimerProfileBindingMap", sessionTimerProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTimerProfileBindingsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) Update(tier0IdParam string, sessionTimerProfileBindingIdParam string, sessionTimerProfileBindingMapParam model.SessionTimerProfileBindingMap) (model.SessionTimerProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(sessionTimerProfileBindingsUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("SessionTimerProfileBindingId", sessionTimerProfileBindingIdParam) + sv.AddStructField("SessionTimerProfileBindingMap", sessionTimerProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SessionTimerProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTimerProfileBindingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SessionTimerProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionTimerProfileBindingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SessionTimerProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSessionTimerProfileBindingsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSessionTimerProfileBindingsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultStateClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultStateClient.go new file mode 100644 index 000000000..e07933c57 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultStateClient.go @@ -0,0 +1,184 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: State + * Functions that implement the generated StateClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultStateClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultStateClient(connector client.Connector) *DefaultStateClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.state" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultStateClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + return &sIface +} + +func (sIface *DefaultStateClient) Get(tier0IdParam string, cursorParam *string, enforcementPointPathParam *string, includedFieldsParam *string, interfacePathParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier0GatewayState, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("InterfacePath", interfacePathParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier0GatewayState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier0GatewayState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier0GatewayState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultStateClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultStateClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(stateGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(stateGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultStaticRoutesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultStaticRoutesClient.go new file mode 100644 index 000000000..535c03ed6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DefaultStaticRoutesClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: StaticRoutes + * Functions that implement the generated StaticRoutesClient interface + */ + + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultStaticRoutesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultStaticRoutesClient(connector client.Connector) *DefaultStaticRoutesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_0s.static_routes" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultStaticRoutesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultStaticRoutesClient) Delete(tier0IdParam string, routeIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(staticRoutesDeleteInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("RouteId", routeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultStaticRoutesClient) Get(tier0IdParam string, routeIdParam string) (model.StaticRoutes, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(staticRoutesGetInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("RouteId", routeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoutes + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.StaticRoutes + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoutes), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultStaticRoutesClient) List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.StaticRoutesListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(staticRoutesListInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoutesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.StaticRoutesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoutesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultStaticRoutesClient) Patch(tier0IdParam string, routeIdParam string, staticRoutesParam model.StaticRoutes) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(staticRoutesPatchInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("RouteId", routeIdParam) + sv.AddStructField("StaticRoutes", staticRoutesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultStaticRoutesClient) Update(tier0IdParam string, routeIdParam string, staticRoutesParam model.StaticRoutes) (model.StaticRoutes, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(staticRoutesUpdateInputType(), typeConverter) + sv.AddStructField("Tier0Id", tier0IdParam) + sv.AddStructField("RouteId", routeIdParam) + sv.AddStructField("StaticRoutes", staticRoutesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoutes + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.StaticRoutes + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoutes), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultStaticRoutesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultStaticRoutesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultStaticRoutesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultStaticRoutesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultStaticRoutesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultStaticRoutesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DnsForwarderClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DnsForwarderClient.go new file mode 100644 index 000000000..3fd4e3592 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DnsForwarderClient.go @@ -0,0 +1,74 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: DnsForwarder + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DnsForwarderClient interface { + + // Perform the specified action for Tier0 DNS forwarder on specified enforcement point. + // + // @param tier0IdParam (required) + // @param actionParam An action to be performed for DNS forwarder on EP (required) + // @param enforcementPointPathParam An enforcement point path, on which the action is to be performed (optional, default to /infra/sites/default/enforcement-points/default) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(tier0IdParam string, actionParam string, enforcementPointPathParam *string) error + + // Delete DNS configuration for tier-0 instance + // + // @param tier0IdParam Tier-0 ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string) error + + // Read the DNS Forwarder for the given tier-0 instance + // + // @param tier0IdParam Tier-0 ID (required) + // @return com.vmware.nsx_global_policy.model.PolicyDnsForwarder + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string) (model.PolicyDnsForwarder, error) + + // Update the DNS Forwarder + // + // @param tier0IdParam Tier-0 ID (required) + // @param policyDnsForwarderParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, policyDnsForwarderParam model.PolicyDnsForwarder) error + + // Update the DNS Forwarder + // + // @param tier0IdParam Tier-0 ID (required) + // @param policyDnsForwarderParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyDnsForwarder + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, policyDnsForwarderParam model.PolicyDnsForwarder) (model.PolicyDnsForwarder, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DnsForwarderTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DnsForwarderTypes.go new file mode 100644 index 000000000..924cc3e2f --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/DnsForwarderTypes.go @@ -0,0 +1,301 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: DnsForwarder. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``action`` of method DnsForwarder#create. +const DnsForwarder_CREATE_ACTION_CACHE = "clear_cache" + + + + +func dnsForwarderCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["action"] = bindings.NewStringType() + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["action"] = "Action" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsForwarderCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["action"] = bindings.NewStringType() + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["action"] = "Action" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["action"] = "action" + queryParams["enforcement_point_path"] = "enforcement_point_path" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/dns-forwarder", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsForwarderDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/dns-forwarder", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) +} + +func dnsForwarderGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/dns-forwarder", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["policy_dns_forwarder"] = "PolicyDnsForwarder" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsForwarderPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["policy_dns_forwarder"] = "PolicyDnsForwarder" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_dns_forwarder", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/dns-forwarder", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["policy_dns_forwarder"] = "PolicyDnsForwarder" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) +} + +func dnsForwarderUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["policy_dns_forwarder"] = "PolicyDnsForwarder" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_dns_forwarder", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/dns-forwarder", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/FloodProtectionProfileBindingsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/FloodProtectionProfileBindingsClient.go new file mode 100644 index 000000000..b3be4be89 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/FloodProtectionProfileBindingsClient.go @@ -0,0 +1,66 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FloodProtectionProfileBindings + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type FloodProtectionProfileBindingsClient interface { + + // API will delete Flood Protection Profile Binding for Tier-0 Logical Router. + // + // @param tier0IdParam (required) + // @param floodProtectionProfileBindingIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string, floodProtectionProfileBindingIdParam string) error + + // API will get Flood Protection Profile Binding Map for Tier-0 Logical Router. + // + // @param tier0IdParam (required) + // @param floodProtectionProfileBindingIdParam (required) + // @return com.vmware.nsx_global_policy.model.FloodProtectionProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string, floodProtectionProfileBindingIdParam string) (model.FloodProtectionProfileBindingMap, error) + + // API will create or update Flood Protection profile binding map for Tier-0 Logical Router. + // + // @param tier0IdParam (required) + // @param floodProtectionProfileBindingIdParam (required) + // @param floodProtectionProfileBindingMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, floodProtectionProfileBindingIdParam string, floodProtectionProfileBindingMapParam model.FloodProtectionProfileBindingMap) error + + // API will create or update Flood Protection profile binding map for Tier-0 Logical Router. + // + // @param tier0IdParam (required) + // @param floodProtectionProfileBindingIdParam (required) + // @param floodProtectionProfileBindingMapParam (required) + // @return com.vmware.nsx_global_policy.model.FloodProtectionProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, floodProtectionProfileBindingIdParam string, floodProtectionProfileBindingMapParam model.FloodProtectionProfileBindingMap) (model.FloodProtectionProfileBindingMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/FloodProtectionProfileBindingsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/FloodProtectionProfileBindingsTypes.go new file mode 100644 index 000000000..3394c3328 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/FloodProtectionProfileBindingsTypes.go @@ -0,0 +1,265 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FloodProtectionProfileBindings. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func floodProtectionProfileBindingsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfileBindingsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func floodProtectionProfileBindingsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileBindingId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["flood_protection_profile_binding_id"] = "floodProtectionProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/flood-protection-profile-bindings/{floodProtectionProfileBindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfileBindingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfileBindingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) +} + +func floodProtectionProfileBindingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileBindingId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["flood_protection_profile_binding_id"] = "floodProtectionProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/flood-protection-profile-bindings/{floodProtectionProfileBindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfileBindingsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + fieldNameMap["flood_protection_profile_binding_map"] = "FloodProtectionProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfileBindingsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func floodProtectionProfileBindingsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + fieldNameMap["flood_protection_profile_binding_map"] = "FloodProtectionProfileBindingMap" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + paramsTypeMap["flood_protection_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileBindingId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["flood_protection_profile_binding_id"] = "floodProtectionProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "flood_protection_profile_binding_map", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/flood-protection-profile-bindings/{floodProtectionProfileBindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfileBindingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + fieldNameMap["flood_protection_profile_binding_map"] = "FloodProtectionProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfileBindingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) +} + +func floodProtectionProfileBindingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + fieldNameMap["flood_protection_profile_binding_map"] = "FloodProtectionProfileBindingMap" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + paramsTypeMap["flood_protection_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileBindingId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["flood_protection_profile_binding_id"] = "floodProtectionProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "flood_protection_profile_binding_map", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/flood-protection-profile-bindings/{floodProtectionProfileBindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/ForwardingTableClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/ForwardingTableClient.go new file mode 100644 index 000000000..56553cd36 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/ForwardingTableClient.go @@ -0,0 +1,39 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: ForwardingTable + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type ForwardingTableClient interface { + + // Get forwarding table from tier-0 + // + // @param tier0IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param edgeIdParam UUID of edge node (optional) + // @param edgePathParam Policy path of edge node (optional) + // @param enforcementPointPathParam Enforcement point path (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param networkPrefixParam IPv4 or IPv6 CIDR Block (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param routeSourceParam Filter routes based on the source from which route is learned (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.RoutingTableListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier0IdParam string, cursorParam *string, edgeIdParam *string, edgePathParam *string, enforcementPointPathParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, routeSourceParam *string, sortAscendingParam *bool, sortByParam *string) (model.RoutingTableListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/ForwardingTableTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/ForwardingTableTypes.go new file mode 100644 index 000000000..2d71d2447 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/ForwardingTableTypes.go @@ -0,0 +1,143 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: ForwardingTable. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``routeSource`` of method ForwardingTable#list. +const ForwardingTable_LIST_ROUTE_SOURCE_BGP = "BGP" +// Possible value for ``routeSource`` of method ForwardingTable#list. +const ForwardingTable_LIST_ROUTE_SOURCE_STATIC = "STATIC" +// Possible value for ``routeSource`` of method ForwardingTable#list. +const ForwardingTable_LIST_ROUTE_SOURCE_CONNECTED = "CONNECTED" + + + + +func forwardingTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_id"] = "EdgeId" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["route_source"] = "RouteSource" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardingTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoutingTableListResultBindingType) +} + +func forwardingTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_id"] = "EdgeId" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["route_source"] = "RouteSource" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["cursor"] = "cursor" + queryParams["network_prefix"] = "network_prefix" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["edge_path"] = "edge_path" + queryParams["edge_id"] = "edge_id" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["route_source"] = "route_source" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/forwarding-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/GatewayFirewallClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/GatewayFirewallClient.go new file mode 100644 index 000000000..1db98bdef --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/GatewayFirewallClient.go @@ -0,0 +1,29 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GatewayFirewall + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GatewayFirewallClient interface { + + // Get filtered view of gateway rules associated with the Tier-0. The gateay policies are returned in the order of category and precedence. + // + // @param tier0IdParam (required) + // @return com.vmware.nsx_global_policy.model.GatewayPolicyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier0IdParam string) (model.GatewayPolicyListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/GatewayFirewallTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/GatewayFirewallTypes.go new file mode 100644 index 000000000..97336beb1 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/GatewayFirewallTypes.go @@ -0,0 +1,77 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GatewayFirewall. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func gatewayFirewallListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayFirewallListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayPolicyListResultBindingType) +} + +func gatewayFirewallListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/gateway-firewall", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/LocaleServicesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/LocaleServicesClient.go new file mode 100644 index 000000000..261a2ae0d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/LocaleServicesClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: LocaleServices + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type LocaleServicesClient interface { + + // Delete Tier-0 locale-services + // + // @param tier0IdParam (required) + // @param localeServicesIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string, localeServicesIdParam string) error + + // Read Tier-0 locale-services + // + // @param tier0IdParam (required) + // @param localeServicesIdParam (required) + // @return com.vmware.nsx_global_policy.model.LocaleServices + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string, localeServicesIdParam string) (model.LocaleServices, error) + + // Paginated list of all Tier-0 locale-services + // + // @param tier0IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.LocaleServicesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LocaleServicesListResult, error) + + // If a Tier-0 locale-services with the locale-services-id is not already present, create a new locale-services. If it already exists, update Tier-0 locale-services with specified attributes. + // + // @param tier0IdParam (required) + // @param localeServicesIdParam (required) + // @param localeServicesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, localeServicesIdParam string, localeServicesParam model.LocaleServices) error + + // If a Tier-0 locale-services with the locale-services-id is not already present, create a new locale-services. If it already exists, replace the Tier-0 locale-services instance with the new object. + // + // @param tier0IdParam (required) + // @param localeServicesIdParam (required) + // @param localeServicesParam (required) + // @return com.vmware.nsx_global_policy.model.LocaleServices + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, localeServicesIdParam string, localeServicesParam model.LocaleServices) (model.LocaleServices, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/LocaleServicesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/LocaleServicesTypes.go new file mode 100644 index 000000000..01c6dd894 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/LocaleServicesTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: LocaleServices. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func localeServicesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func localeServicesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["locale_services_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["localeServicesId"] = bindings.NewStringType() + pathParams["locale_services_id"] = "localeServicesId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/locale-services/{localeServicesId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func localeServicesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LocaleServicesBindingType) +} + +func localeServicesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["locale_services_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["localeServicesId"] = bindings.NewStringType() + pathParams["locale_services_id"] = "localeServicesId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/locale-services/{localeServicesId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func localeServicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LocaleServicesListResultBindingType) +} + +func localeServicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/locale-services", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func localeServicesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fields["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + fieldNameMap["locale_services"] = "LocaleServices" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func localeServicesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fields["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + fieldNameMap["locale_services"] = "LocaleServices" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["locale_services_id"] = bindings.NewStringType() + paramsTypeMap["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["localeServicesId"] = bindings.NewStringType() + pathParams["locale_services_id"] = "localeServicesId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "locale_services", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/locale-services/{localeServicesId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func localeServicesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fields["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + fieldNameMap["locale_services"] = "LocaleServices" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LocaleServicesBindingType) +} + +func localeServicesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fields["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + fieldNameMap["locale_services"] = "LocaleServices" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["locale_services_id"] = bindings.NewStringType() + paramsTypeMap["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["localeServicesId"] = bindings.NewStringType() + pathParams["locale_services_id"] = "localeServicesId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "locale_services", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/locale-services/{localeServicesId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/PrefixListsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/PrefixListsClient.go new file mode 100644 index 000000000..61fa6eabd --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/PrefixListsClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: PrefixLists + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type PrefixListsClient interface { + + // Delete a prefix list + // + // @param tier0IdParam (required) + // @param prefixListIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string, prefixListIdParam string) error + + // Read a prefix list + // + // @param tier0IdParam (required) + // @param prefixListIdParam (required) + // @return com.vmware.nsx_global_policy.model.PrefixList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string, prefixListIdParam string) (model.PrefixList, error) + + // Paginated list of all prefix lists + // + // @param tier0IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.PrefixListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PrefixListResult, error) + + // If prefix list for prefix-list-id is not already present, create a prefix list. If it already exists, update prefix list for prefix-list-id. + // + // @param tier0IdParam (required) + // @param prefixListIdParam (required) + // @param prefixListParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, prefixListIdParam string, prefixListParam model.PrefixList) error + + // If prefix list for prefix-list-id is not already present, create a prefix list. If it already exists, replace the prefix list for prefix-list-id. + // + // @param tier0IdParam Tier-0 ID (required) + // @param prefixListIdParam Prefix List ID (required) + // @param prefixListParam (required) + // @return com.vmware.nsx_global_policy.model.PrefixList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, prefixListIdParam string, prefixListParam model.PrefixList) (model.PrefixList, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/PrefixListsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/PrefixListsTypes.go new file mode 100644 index 000000000..0b338466a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/PrefixListsTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: PrefixLists. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func prefixListsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["prefix_list_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["prefix_list_id"] = "PrefixListId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func prefixListsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func prefixListsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["prefix_list_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["prefix_list_id"] = "PrefixListId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["prefix_list_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["prefixListId"] = bindings.NewStringType() + pathParams["prefix_list_id"] = "prefixListId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/prefix-lists/{prefixListId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func prefixListsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["prefix_list_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["prefix_list_id"] = "PrefixListId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func prefixListsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PrefixListBindingType) +} + +func prefixListsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["prefix_list_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["prefix_list_id"] = "PrefixListId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["prefix_list_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["prefixListId"] = bindings.NewStringType() + pathParams["prefix_list_id"] = "prefixListId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/prefix-lists/{prefixListId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func prefixListsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func prefixListsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PrefixListResultBindingType) +} + +func prefixListsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/prefix-lists", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func prefixListsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["prefix_list_id"] = bindings.NewStringType() + fields["prefix_list"] = bindings.NewReferenceType(model.PrefixListBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["prefix_list_id"] = "PrefixListId" + fieldNameMap["prefix_list"] = "PrefixList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func prefixListsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func prefixListsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["prefix_list_id"] = bindings.NewStringType() + fields["prefix_list"] = bindings.NewReferenceType(model.PrefixListBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["prefix_list_id"] = "PrefixListId" + fieldNameMap["prefix_list"] = "PrefixList" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["prefix_list"] = bindings.NewReferenceType(model.PrefixListBindingType) + paramsTypeMap["prefix_list_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["prefixListId"] = bindings.NewStringType() + pathParams["prefix_list_id"] = "prefixListId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "prefix_list", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/prefix-lists/{prefixListId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func prefixListsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["prefix_list_id"] = bindings.NewStringType() + fields["prefix_list"] = bindings.NewReferenceType(model.PrefixListBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["prefix_list_id"] = "PrefixListId" + fieldNameMap["prefix_list"] = "PrefixList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func prefixListsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PrefixListBindingType) +} + +func prefixListsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["prefix_list_id"] = bindings.NewStringType() + fields["prefix_list"] = bindings.NewReferenceType(model.PrefixListBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["prefix_list_id"] = "PrefixListId" + fieldNameMap["prefix_list"] = "PrefixList" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["prefix_list"] = bindings.NewReferenceType(model.PrefixListBindingType) + paramsTypeMap["prefix_list_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["prefixListId"] = bindings.NewStringType() + pathParams["prefix_list_id"] = "prefixListId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "prefix_list", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/prefix-lists/{prefixListId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RouteMapsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RouteMapsClient.go new file mode 100644 index 000000000..c52bae22b --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RouteMapsClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: RouteMaps + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type RouteMapsClient interface { + + // Delete a route map + // + // @param tier0IdParam (required) + // @param routeMapIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string, routeMapIdParam string) error + + // Read a route map + // + // @param tier0IdParam (required) + // @param routeMapIdParam (required) + // @return com.vmware.nsx_global_policy.model.Tier0RouteMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string, routeMapIdParam string) (model.Tier0RouteMap, error) + + // Paginated list of all route maps under a tier-0 + // + // @param tier0IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.Tier0RouteMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier0RouteMapListResult, error) + + // If a route map with the route-map-id is not already present, create a new route map. If it already exists, update the route map for specified attributes. + // + // @param tier0IdParam (required) + // @param routeMapIdParam (required) + // @param tier0RouteMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, routeMapIdParam string, tier0RouteMapParam model.Tier0RouteMap) error + + // If a route map with the route-map-id is not already present, create a new route map. If it already exists, replace the route map instance with the new object. + // + // @param tier0IdParam (required) + // @param routeMapIdParam (required) + // @param tier0RouteMapParam (required) + // @return com.vmware.nsx_global_policy.model.Tier0RouteMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, routeMapIdParam string, tier0RouteMapParam model.Tier0RouteMap) (model.Tier0RouteMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RouteMapsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RouteMapsTypes.go new file mode 100644 index 000000000..ecc0f1b47 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RouteMapsTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: RouteMaps. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func routeMapsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["route_map_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_map_id"] = "RouteMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func routeMapsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["route_map_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_map_id"] = "RouteMapId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["route_map_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["routeMapId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["route_map_id"] = "routeMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/route-maps/{routeMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func routeMapsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["route_map_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_map_id"] = "RouteMapId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier0RouteMapBindingType) +} + +func routeMapsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["route_map_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_map_id"] = "RouteMapId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["route_map_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["routeMapId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["route_map_id"] = "routeMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/route-maps/{routeMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func routeMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier0RouteMapListResultBindingType) +} + +func routeMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/route-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func routeMapsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["route_map_id"] = bindings.NewStringType() + fields["tier0_route_map"] = bindings.NewReferenceType(model.Tier0RouteMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_map_id"] = "RouteMapId" + fieldNameMap["tier0_route_map"] = "Tier0RouteMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func routeMapsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["route_map_id"] = bindings.NewStringType() + fields["tier0_route_map"] = bindings.NewReferenceType(model.Tier0RouteMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_map_id"] = "RouteMapId" + fieldNameMap["tier0_route_map"] = "Tier0RouteMap" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0_route_map"] = bindings.NewReferenceType(model.Tier0RouteMapBindingType) + paramsTypeMap["route_map_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["routeMapId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["route_map_id"] = "routeMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tier0_route_map", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/route-maps/{routeMapId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func routeMapsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["route_map_id"] = bindings.NewStringType() + fields["tier0_route_map"] = bindings.NewReferenceType(model.Tier0RouteMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_map_id"] = "RouteMapId" + fieldNameMap["tier0_route_map"] = "Tier0RouteMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier0RouteMapBindingType) +} + +func routeMapsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["route_map_id"] = bindings.NewStringType() + fields["tier0_route_map"] = bindings.NewReferenceType(model.Tier0RouteMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_map_id"] = "RouteMapId" + fieldNameMap["tier0_route_map"] = "Tier0RouteMap" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["tier0_route_map"] = bindings.NewReferenceType(model.Tier0RouteMapBindingType) + paramsTypeMap["route_map_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["routeMapId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["route_map_id"] = "routeMapId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "tier0_route_map", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/route-maps/{routeMapId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RoutingTableClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RoutingTableClient.go new file mode 100644 index 000000000..7046a51b6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RoutingTableClient.go @@ -0,0 +1,39 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: RoutingTable + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type RoutingTableClient interface { + + // Get routing table from tier-0 + // + // @param tier0IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param edgeIdParam UUID of edge node (optional) + // @param edgePathParam Policy path of edge node (optional) + // @param enforcementPointPathParam Enforcement point path (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param networkPrefixParam IPv4 or IPv6 CIDR Block (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param routeSourceParam Filter routes based on the source from which route is learned (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.RoutingTableListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier0IdParam string, cursorParam *string, edgeIdParam *string, edgePathParam *string, enforcementPointPathParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, routeSourceParam *string, sortAscendingParam *bool, sortByParam *string) (model.RoutingTableListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RoutingTableTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RoutingTableTypes.go new file mode 100644 index 000000000..c233c925a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/RoutingTableTypes.go @@ -0,0 +1,143 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: RoutingTable. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``routeSource`` of method RoutingTable#list. +const RoutingTable_LIST_ROUTE_SOURCE_BGP = "BGP" +// Possible value for ``routeSource`` of method RoutingTable#list. +const RoutingTable_LIST_ROUTE_SOURCE_STATIC = "STATIC" +// Possible value for ``routeSource`` of method RoutingTable#list. +const RoutingTable_LIST_ROUTE_SOURCE_CONNECTED = "CONNECTED" + + + + +func routingTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_id"] = "EdgeId" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["route_source"] = "RouteSource" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routingTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoutingTableListResultBindingType) +} + +func routingTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_id"] = "EdgeId" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["route_source"] = "RouteSource" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["cursor"] = "cursor" + queryParams["network_prefix"] = "network_prefix" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["edge_path"] = "edge_path" + queryParams["edge_id"] = "edge_id" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["route_source"] = "route_source" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/routing-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/SessionTimerProfileBindingsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/SessionTimerProfileBindingsClient.go new file mode 100644 index 000000000..9f1dd0eb8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/SessionTimerProfileBindingsClient.go @@ -0,0 +1,66 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SessionTimerProfileBindings + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SessionTimerProfileBindingsClient interface { + + // API will delete Session Timer Profile Binding for Tier-0 Logical Router. + // + // @param tier0IdParam (required) + // @param sessionTimerProfileBindingIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string, sessionTimerProfileBindingIdParam string) error + + // API will get Session Timer Profile Binding Map for Tier-0 Logical Router. + // + // @param tier0IdParam (required) + // @param sessionTimerProfileBindingIdParam (required) + // @return com.vmware.nsx_global_policy.model.SessionTimerProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string, sessionTimerProfileBindingIdParam string) (model.SessionTimerProfileBindingMap, error) + + // API will create or update Session Timer profile binding map for Tier-0 Logical Router. + // + // @param tier0IdParam (required) + // @param sessionTimerProfileBindingIdParam (required) + // @param sessionTimerProfileBindingMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, sessionTimerProfileBindingIdParam string, sessionTimerProfileBindingMapParam model.SessionTimerProfileBindingMap) error + + // API will create or update Session Timer profile binding map for Tier-0 Logical Router. + // + // @param tier0IdParam (required) + // @param sessionTimerProfileBindingIdParam (required) + // @param sessionTimerProfileBindingMapParam (required) + // @return com.vmware.nsx_global_policy.model.SessionTimerProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, sessionTimerProfileBindingIdParam string, sessionTimerProfileBindingMapParam model.SessionTimerProfileBindingMap) (model.SessionTimerProfileBindingMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/SessionTimerProfileBindingsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/SessionTimerProfileBindingsTypes.go new file mode 100644 index 000000000..ac6a1521e --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/SessionTimerProfileBindingsTypes.go @@ -0,0 +1,265 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SessionTimerProfileBindings. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func sessionTimerProfileBindingsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTimerProfileBindingsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sessionTimerProfileBindingsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["sessionTimerProfileBindingId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["session_timer_profile_binding_id"] = "sessionTimerProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/session-timer-profile-bindings/{sessionTimerProfileBindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionTimerProfileBindingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTimerProfileBindingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) +} + +func sessionTimerProfileBindingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["sessionTimerProfileBindingId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["session_timer_profile_binding_id"] = "sessionTimerProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/session-timer-profile-bindings/{sessionTimerProfileBindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionTimerProfileBindingsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + fieldNameMap["session_timer_profile_binding_map"] = "SessionTimerProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTimerProfileBindingsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sessionTimerProfileBindingsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + fieldNameMap["session_timer_profile_binding_map"] = "SessionTimerProfileBindingMap" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["sessionTimerProfileBindingId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["session_timer_profile_binding_id"] = "sessionTimerProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "session_timer_profile_binding_map", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/session-timer-profile-bindings/{sessionTimerProfileBindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionTimerProfileBindingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + fieldNameMap["session_timer_profile_binding_map"] = "SessionTimerProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTimerProfileBindingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) +} + +func sessionTimerProfileBindingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + fieldNameMap["session_timer_profile_binding_map"] = "SessionTimerProfileBindingMap" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["sessionTimerProfileBindingId"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + pathParams["session_timer_profile_binding_id"] = "sessionTimerProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "session_timer_profile_binding_map", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/session-timer-profile-bindings/{sessionTimerProfileBindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StateClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StateClient.go new file mode 100644 index 000000000..8c7439bd4 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StateClient.go @@ -0,0 +1,36 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: State + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type StateClient interface { + + // Returns + // + // @param tier0IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param enforcementPointPathParam Enforcement point path (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param interfacePathParam Interface path for interface specific state such as IPv6 DAD state (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.Tier0GatewayState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string, cursorParam *string, enforcementPointPathParam *string, includedFieldsParam *string, interfacePathParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier0GatewayState, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StateTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StateTypes.go new file mode 100644 index 000000000..4dd900076 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StateTypes.go @@ -0,0 +1,119 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: State. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["interface_path"] = "InterfacePath" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier0GatewayStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["interface_path"] = "InterfacePath" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["cursor"] = "cursor" + queryParams["interface_path"] = "interface_path" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StaticRoutesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StaticRoutesClient.go new file mode 100644 index 000000000..61ec17f57 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StaticRoutesClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: StaticRoutes + * Used by client-side stubs. + */ + +package tier_0s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type StaticRoutesClient interface { + + // Delete Tier-0 static routes + // + // @param tier0IdParam (required) + // @param routeIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier0IdParam string, routeIdParam string) error + + // Read Tier-0 static routes + // + // @param tier0IdParam (required) + // @param routeIdParam (required) + // @return com.vmware.nsx_global_policy.model.StaticRoutes + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier0IdParam string, routeIdParam string) (model.StaticRoutes, error) + + // Paginated list of all Tier-0 Static Routes + // + // @param tier0IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.StaticRoutesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier0IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.StaticRoutesListResult, error) + + // If static routes for route-id are not already present, create static routes. If it already exists, update static routes for route-id. + // + // @param tier0IdParam (required) + // @param routeIdParam (required) + // @param staticRoutesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier0IdParam string, routeIdParam string, staticRoutesParam model.StaticRoutes) error + + // If static routes for route-id are not already present, create static routes. If it already exists, replace the static routes for route-id. + // + // @param tier0IdParam (required) + // @param routeIdParam (required) + // @param staticRoutesParam (required) + // @return com.vmware.nsx_global_policy.model.StaticRoutes + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier0IdParam string, routeIdParam string, staticRoutesParam model.StaticRoutes) (model.StaticRoutes, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StaticRoutesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StaticRoutesTypes.go new file mode 100644 index 000000000..ae49cda97 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/StaticRoutesTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: StaticRoutes. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func staticRoutesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_id"] = "RouteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func staticRoutesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_id"] = "RouteId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/static-routes/{routeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_id"] = "RouteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRoutesBindingType) +} + +func staticRoutesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_id"] = "RouteId" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/static-routes/{routeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRoutesListResultBindingType) +} + +func staticRoutesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + pathParams["tier0_id"] = "tier0Id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/static-routes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fields["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_id"] = "RouteId" + fieldNameMap["static_routes"] = "StaticRoutes" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func staticRoutesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fields["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_id"] = "RouteId" + fieldNameMap["static_routes"] = "StaticRoutes" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "static_routes", + "PATCH", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/static-routes/{routeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier0_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fields["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_id"] = "RouteId" + fieldNameMap["static_routes"] = "StaticRoutes" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRoutesBindingType) +} + +func staticRoutesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier0_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fields["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + fieldNameMap["tier0_id"] = "Tier0Id" + fieldNameMap["route_id"] = "RouteId" + fieldNameMap["static_routes"] = "StaticRoutes" + paramsTypeMap["tier0_id"] = bindings.NewStringType() + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + paramsTypeMap["tier0Id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + pathParams["tier0_id"] = "tier0Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "static_routes", + "PUT", + "/global-manager/api/v1/global-infra/tier-0s/{tier0Id}/static-routes/{routeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/Tier0sPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/Tier0sPackageTypes.go new file mode 100644 index 000000000..469e0d5f6 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s/Tier0sPackageTypes.go @@ -0,0 +1,19 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy.global_infra.tier_0s. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_0s + + + + + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultDnsForwarderClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultDnsForwarderClient.go new file mode 100644 index 000000000..727f17c52 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultDnsForwarderClient.go @@ -0,0 +1,551 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: DnsForwarder + * Functions that implement the generated DnsForwarderClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDnsForwarderClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDnsForwarderClient(connector client.Connector) *DefaultDnsForwarderClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.dns_forwarder" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "create"), + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDnsForwarderClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["create"] = dIface.createMethodDefinition() + dIface.methodNameToDefMap["delete"] = dIface.deleteMethodDefinition() + dIface.methodNameToDefMap["get"] = dIface.getMethodDefinition() + dIface.methodNameToDefMap["patch"] = dIface.patchMethodDefinition() + dIface.methodNameToDefMap["update"] = dIface.updateMethodDefinition() + return &dIface +} + +func (dIface *DefaultDnsForwarderClient) Create(tier1IdParam string, actionParam string, enforcementPointPathParam *string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "create") + sv := bindings.NewStructValueBuilder(dnsForwarderCreateInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("Action", actionParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderClient) Delete(tier1IdParam string) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(dnsForwarderDeleteInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderClient) Get(tier1IdParam string) (model.PolicyDnsForwarder, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(dnsForwarderGetInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDnsForwarder + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDnsForwarder + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsForwarderGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDnsForwarder), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderClient) Patch(tier1IdParam string, policyDnsForwarderParam model.PolicyDnsForwarder) error { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(dnsForwarderPatchInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("PolicyDnsForwarder", policyDnsForwarderParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *DefaultDnsForwarderClient) Update(tier1IdParam string, policyDnsForwarderParam model.PolicyDnsForwarder) (model.PolicyDnsForwarder, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(dnsForwarderUpdateInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("PolicyDnsForwarder", policyDnsForwarderParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PolicyDnsForwarder + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dnsForwarderUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.PolicyDnsForwarder + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dnsForwarderUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PolicyDnsForwarder), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDnsForwarderClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDnsForwarderClient) createMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderCreateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderCreateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "create") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.create method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (dIface *DefaultDnsForwarderClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dnsForwarderUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dnsForwarderUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDnsForwarderClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultFloodProtectionProfileBindingsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultFloodProtectionProfileBindingsClient.go new file mode 100644 index 000000000..1bd9aa490 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultFloodProtectionProfileBindingsClient.go @@ -0,0 +1,462 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: FloodProtectionProfileBindings + * Functions that implement the generated FloodProtectionProfileBindingsClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultFloodProtectionProfileBindingsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultFloodProtectionProfileBindingsClient(connector client.Connector) *DefaultFloodProtectionProfileBindingsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.flood_protection_profile_bindings" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultFloodProtectionProfileBindingsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["delete"] = fIface.deleteMethodDefinition() + fIface.methodNameToDefMap["get"] = fIface.getMethodDefinition() + fIface.methodNameToDefMap["patch"] = fIface.patchMethodDefinition() + fIface.methodNameToDefMap["update"] = fIface.updateMethodDefinition() + return &fIface +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Delete(tier1IdParam string, floodProtectionProfileBindingIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(floodProtectionProfileBindingsDeleteInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("FloodProtectionProfileBindingId", floodProtectionProfileBindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfileBindingsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Get(tier1IdParam string, floodProtectionProfileBindingIdParam string) (model.FloodProtectionProfileBindingMap, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(floodProtectionProfileBindingsGetInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("FloodProtectionProfileBindingId", floodProtectionProfileBindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FloodProtectionProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfileBindingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FloodProtectionProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), floodProtectionProfileBindingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FloodProtectionProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Patch(tier1IdParam string, floodProtectionProfileBindingIdParam string, floodProtectionProfileBindingMapParam model.FloodProtectionProfileBindingMap) error { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(floodProtectionProfileBindingsPatchInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("FloodProtectionProfileBindingId", floodProtectionProfileBindingIdParam) + sv.AddStructField("FloodProtectionProfileBindingMap", floodProtectionProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfileBindingsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Update(tier1IdParam string, floodProtectionProfileBindingIdParam string, floodProtectionProfileBindingMapParam model.FloodProtectionProfileBindingMap) (model.FloodProtectionProfileBindingMap, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(floodProtectionProfileBindingsUpdateInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("FloodProtectionProfileBindingId", floodProtectionProfileBindingIdParam) + sv.AddStructField("FloodProtectionProfileBindingMap", floodProtectionProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FloodProtectionProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := floodProtectionProfileBindingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.FloodProtectionProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), floodProtectionProfileBindingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FloodProtectionProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultFloodProtectionProfileBindingsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultFloodProtectionProfileBindingsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (fIface *DefaultFloodProtectionProfileBindingsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(floodProtectionProfileBindingsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultFloodProtectionProfileBindingsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultForwardingTableClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultForwardingTableClient.go new file mode 100644 index 000000000..532659b98 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultForwardingTableClient.go @@ -0,0 +1,187 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: ForwardingTable + * Functions that implement the generated ForwardingTableClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultForwardingTableClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultForwardingTableClient(connector client.Connector) *DefaultForwardingTableClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.forwarding_table" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + fIface := DefaultForwardingTableClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + fIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + fIface.methodNameToDefMap["list"] = fIface.listMethodDefinition() + return &fIface +} + +func (fIface *DefaultForwardingTableClient) List(tier1IdParam string, cursorParam *string, edgeIdParam *string, edgePathParam *string, enforcementPointPathParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, routeSourceParam *string, sortAscendingParam *bool, sortByParam *string) (model.RoutingTableListResult, error) { + typeConverter := fIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(fIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(forwardingTableListInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EdgeId", edgeIdParam) + sv.AddStructField("EdgePath", edgePathParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NetworkPrefix", networkPrefixParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("RouteSource", routeSourceParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoutingTableListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardingTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := fIface.connector.NewExecutionContext() + methodResult := fIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.RoutingTableListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardingTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoutingTableListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (fIface *DefaultForwardingTableClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := fIface.connector.GetApiProvider().Invoke(fIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (fIface *DefaultForwardingTableClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(fIface.interfaceName) + typeConverter := fIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(forwardingTableListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(forwardingTableListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + fIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + fIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultForwardingTableClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultGatewayFirewallClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultGatewayFirewallClient.go new file mode 100644 index 000000000..c6906d657 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultGatewayFirewallClient.go @@ -0,0 +1,177 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: GatewayFirewall + * Functions that implement the generated GatewayFirewallClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultGatewayFirewallClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultGatewayFirewallClient(connector client.Connector) *DefaultGatewayFirewallClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.gateway_firewall" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + gIface := DefaultGatewayFirewallClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + gIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + gIface.methodNameToDefMap["list"] = gIface.listMethodDefinition() + return &gIface +} + +func (gIface *DefaultGatewayFirewallClient) List(tier1IdParam string) (model.GatewayPolicyListResult, error) { + typeConverter := gIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(gIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(gatewayFirewallListInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GatewayPolicyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := gatewayFirewallListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := gIface.connector.NewExecutionContext() + methodResult := gIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.GatewayPolicyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), gatewayFirewallListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GatewayPolicyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (gIface *DefaultGatewayFirewallClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := gIface.connector.GetApiProvider().Invoke(gIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (gIface *DefaultGatewayFirewallClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(gIface.interfaceName) + typeConverter := gIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(gatewayFirewallListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(gatewayFirewallListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + gIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + gIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultGatewayFirewallClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultLocaleServicesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultLocaleServicesClient.go new file mode 100644 index 000000000..5c77261ce --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultLocaleServicesClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: LocaleServices + * Functions that implement the generated LocaleServicesClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultLocaleServicesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultLocaleServicesClient(connector client.Connector) *DefaultLocaleServicesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.locale_services" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + lIface := DefaultLocaleServicesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + lIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + lIface.methodNameToDefMap["delete"] = lIface.deleteMethodDefinition() + lIface.methodNameToDefMap["get"] = lIface.getMethodDefinition() + lIface.methodNameToDefMap["list"] = lIface.listMethodDefinition() + lIface.methodNameToDefMap["patch"] = lIface.patchMethodDefinition() + lIface.methodNameToDefMap["update"] = lIface.updateMethodDefinition() + return &lIface +} + +func (lIface *DefaultLocaleServicesClient) Delete(tier1IdParam string, localeServicesIdParam string) error { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(localeServicesDeleteInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("LocaleServicesId", localeServicesIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *DefaultLocaleServicesClient) Get(tier1IdParam string, localeServicesIdParam string) (model.LocaleServices, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(localeServicesGetInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("LocaleServicesId", localeServicesIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LocaleServices + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.LocaleServices + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localeServicesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LocaleServices), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *DefaultLocaleServicesClient) List(tier1IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LocaleServicesListResult, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(localeServicesListInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LocaleServicesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.LocaleServicesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localeServicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LocaleServicesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *DefaultLocaleServicesClient) Patch(tier1IdParam string, localeServicesIdParam string, localeServicesParam model.LocaleServices) error { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(localeServicesPatchInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("LocaleServicesId", localeServicesIdParam) + sv.AddStructField("LocaleServices", localeServicesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *DefaultLocaleServicesClient) Update(tier1IdParam string, localeServicesIdParam string, localeServicesParam model.LocaleServices) (model.LocaleServices, error) { + typeConverter := lIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(lIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(localeServicesUpdateInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("LocaleServicesId", localeServicesIdParam) + sv.AddStructField("LocaleServices", localeServicesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LocaleServices + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localeServicesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := lIface.connector.NewExecutionContext() + methodResult := lIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.LocaleServices + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localeServicesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LocaleServices), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (lIface *DefaultLocaleServicesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := lIface.connector.GetApiProvider().Invoke(lIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (lIface *DefaultLocaleServicesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLocaleServicesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLocaleServicesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLocaleServicesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (lIface *DefaultLocaleServicesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(lIface.interfaceName) + typeConverter := lIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(localeServicesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(localeServicesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + lIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + lIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultLocaleServicesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultSegmentsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultSegmentsClient.go new file mode 100644 index 000000000..bae0f4fb8 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultSegmentsClient.go @@ -0,0 +1,657 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Segments + * Functions that implement the generated SegmentsClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSegmentsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSegmentsClient(connector client.Connector) *DefaultSegmentsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.segments" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "delete_0"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSegmentsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["delete_0"] = sIface.delete_0MethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSegmentsClient) Delete(tier1IdParam string, segmentIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(segmentsDeleteInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SegmentId", segmentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Delete0(tier1IdParam string, segmentIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete_0") + sv := bindings.NewStructValueBuilder(segmentsDelete0InputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SegmentId", segmentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsDelete0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Get(tier1IdParam string, segmentIdParam string) (model.Segment, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(segmentsGetInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SegmentId", segmentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Segment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Segment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Segment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) List(tier1IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(segmentsListInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SegmentListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SegmentListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SegmentListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Patch(tier1IdParam string, segmentIdParam string, segmentParam model.Segment) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(segmentsPatchInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Segment", segmentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSegmentsClient) Update(tier1IdParam string, segmentIdParam string, segmentParam model.Segment) (model.Segment, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(segmentsUpdateInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SegmentId", segmentIdParam) + sv.AddStructField("Segment", segmentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Segment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := segmentsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Segment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), segmentsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Segment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSegmentsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSegmentsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) delete_0MethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsDelete0InputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsDelete0OutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete_0") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.delete_0 method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSegmentsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(segmentsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(segmentsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSegmentsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultSessionTimerProfileBindingsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultSessionTimerProfileBindingsClient.go new file mode 100644 index 000000000..9382053db --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultSessionTimerProfileBindingsClient.go @@ -0,0 +1,462 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: SessionTimerProfileBindings + * Functions that implement the generated SessionTimerProfileBindingsClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultSessionTimerProfileBindingsClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultSessionTimerProfileBindingsClient(connector client.Connector) *DefaultSessionTimerProfileBindingsClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.session_timer_profile_bindings" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultSessionTimerProfileBindingsClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) Delete(tier1IdParam string, sessionTimerProfileBindingIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(sessionTimerProfileBindingsDeleteInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SessionTimerProfileBindingId", sessionTimerProfileBindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTimerProfileBindingsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) Get(tier1IdParam string, sessionTimerProfileBindingIdParam string) (model.SessionTimerProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(sessionTimerProfileBindingsGetInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SessionTimerProfileBindingId", sessionTimerProfileBindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SessionTimerProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTimerProfileBindingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SessionTimerProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionTimerProfileBindingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SessionTimerProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) Patch(tier1IdParam string, sessionTimerProfileBindingIdParam string, sessionTimerProfileBindingMapParam model.SessionTimerProfileBindingMap) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(sessionTimerProfileBindingsPatchInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SessionTimerProfileBindingId", sessionTimerProfileBindingIdParam) + sv.AddStructField("SessionTimerProfileBindingMap", sessionTimerProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTimerProfileBindingsPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) Update(tier1IdParam string, sessionTimerProfileBindingIdParam string, sessionTimerProfileBindingMapParam model.SessionTimerProfileBindingMap) (model.SessionTimerProfileBindingMap, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(sessionTimerProfileBindingsUpdateInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("SessionTimerProfileBindingId", sessionTimerProfileBindingIdParam) + sv.AddStructField("SessionTimerProfileBindingMap", sessionTimerProfileBindingMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SessionTimerProfileBindingMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTimerProfileBindingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SessionTimerProfileBindingMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionTimerProfileBindingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SessionTimerProfileBindingMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultSessionTimerProfileBindingsClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultSessionTimerProfileBindingsClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultSessionTimerProfileBindingsClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(sessionTimerProfileBindingsUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultSessionTimerProfileBindingsClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultStateClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultStateClient.go new file mode 100644 index 000000000..15250e4eb --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultStateClient.go @@ -0,0 +1,184 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: State + * Functions that implement the generated StateClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultStateClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultStateClient(connector client.Connector) *DefaultStateClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.state" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultStateClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + return &sIface +} + +func (sIface *DefaultStateClient) Get(tier1IdParam string, cursorParam *string, enforcementPointPathParam *string, includedFieldsParam *string, interfacePathParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier1GatewayState, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EnforcementPointPath", enforcementPointPathParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("InterfacePath", interfacePathParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Tier1GatewayState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.Tier1GatewayState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Tier1GatewayState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultStateClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultStateClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(stateGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(stateGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStateClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultStaticRoutesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultStaticRoutesClient.go new file mode 100644 index 000000000..4df9f84a4 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DefaultStaticRoutesClient.go @@ -0,0 +1,565 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: StaticRoutes + * Functions that implement the generated StaticRoutesClient interface + */ + + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultStaticRoutesClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultStaticRoutesClient(connector client.Connector) *DefaultStaticRoutesClient { + interfaceName := "com.vmware.nsx_global_policy.global_infra.tier_1s.static_routes" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "delete"), + core.NewMethodIdentifier(interfaceIdentifier, "get"), + core.NewMethodIdentifier(interfaceIdentifier, "list"), + core.NewMethodIdentifier(interfaceIdentifier, "patch"), + core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + sIface := DefaultStaticRoutesClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + sIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + sIface.methodNameToDefMap["delete"] = sIface.deleteMethodDefinition() + sIface.methodNameToDefMap["get"] = sIface.getMethodDefinition() + sIface.methodNameToDefMap["list"] = sIface.listMethodDefinition() + sIface.methodNameToDefMap["patch"] = sIface.patchMethodDefinition() + sIface.methodNameToDefMap["update"] = sIface.updateMethodDefinition() + return &sIface +} + +func (sIface *DefaultStaticRoutesClient) Delete(tier1IdParam string, routeIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "delete") + sv := bindings.NewStructValueBuilder(staticRoutesDeleteInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("RouteId", routeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultStaticRoutesClient) Get(tier1IdParam string, routeIdParam string) (model.StaticRoutes, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "get") + sv := bindings.NewStructValueBuilder(staticRoutesGetInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("RouteId", routeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoutes + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.StaticRoutes + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoutes), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultStaticRoutesClient) List(tier1IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.StaticRoutesListResult, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(staticRoutesListInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeMarkForDeleteObjects", includeMarkForDeleteObjectsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoutesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.StaticRoutesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoutesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *DefaultStaticRoutesClient) Patch(tier1IdParam string, routeIdParam string, staticRoutesParam model.StaticRoutes) error { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "patch") + sv := bindings.NewStructValueBuilder(staticRoutesPatchInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("RouteId", routeIdParam) + sv.AddStructField("StaticRoutes", staticRoutesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *DefaultStaticRoutesClient) Update(tier1IdParam string, routeIdParam string, staticRoutesParam model.StaticRoutes) (model.StaticRoutes, error) { + typeConverter := sIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(sIface.interfaceIdentifier, "update") + sv := bindings.NewStructValueBuilder(staticRoutesUpdateInputType(), typeConverter) + sv.AddStructField("Tier1Id", tier1IdParam) + sv.AddStructField("RouteId", routeIdParam) + sv.AddStructField("StaticRoutes", staticRoutesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoutes + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := sIface.connector.NewExecutionContext() + methodResult := sIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.StaticRoutes + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoutes), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (sIface *DefaultStaticRoutesClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := sIface.connector.GetApiProvider().Invoke(sIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (sIface *DefaultStaticRoutesClient) deleteMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesDeleteInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesDeleteOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "delete") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.delete method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultStaticRoutesClient) getMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesGetInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesGetOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "get") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.get method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultStaticRoutesClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultStaticRoutesClient) patchMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesPatchInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesPatchOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "patch") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.patch method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} + +func (sIface *DefaultStaticRoutesClient) updateMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(sIface.interfaceName) + typeConverter := sIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(staticRoutesUpdateInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(staticRoutesUpdateOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "update") + errorDefinitions := make([]data.ErrorDefinition, 0) + sIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + sIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultStaticRoutesClient.update method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DnsForwarderClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DnsForwarderClient.go new file mode 100644 index 000000000..babd75865 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DnsForwarderClient.go @@ -0,0 +1,74 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: DnsForwarder + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DnsForwarderClient interface { + + // Perform the specified action for Tier0 DNS forwarder on specified enforcement point. + // + // @param tier1IdParam (required) + // @param actionParam An action to be performed for DNS forwarder on EP (required) + // @param enforcementPointPathParam An enforcement point path, on which the action is to be performed (optional, default to /infra/sites/default/enforcement-points/default) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(tier1IdParam string, actionParam string, enforcementPointPathParam *string) error + + // Delete DNS configuration for tier-1 instance + // + // @param tier1IdParam Tier-1 ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier1IdParam string) error + + // Read the DNS Forwarder for the given tier-1 instance + // + // @param tier1IdParam Tier-1 ID (required) + // @return com.vmware.nsx_global_policy.model.PolicyDnsForwarder + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier1IdParam string) (model.PolicyDnsForwarder, error) + + // Create or update the DNS Forwarder + // + // @param tier1IdParam Tier-1 ID (required) + // @param policyDnsForwarderParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier1IdParam string, policyDnsForwarderParam model.PolicyDnsForwarder) error + + // Create or update the DNS Forwarder + // + // @param tier1IdParam Tier-1 ID (required) + // @param policyDnsForwarderParam (required) + // @return com.vmware.nsx_global_policy.model.PolicyDnsForwarder + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier1IdParam string, policyDnsForwarderParam model.PolicyDnsForwarder) (model.PolicyDnsForwarder, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DnsForwarderTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DnsForwarderTypes.go new file mode 100644 index 000000000..d862ca774 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/DnsForwarderTypes.go @@ -0,0 +1,301 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: DnsForwarder. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``action`` of method DnsForwarder#create. +const DnsForwarder_CREATE_ACTION_CACHE = "clear_cache" + + + + +func dnsForwarderCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["action"] = bindings.NewStringType() + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["action"] = "Action" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsForwarderCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["action"] = bindings.NewStringType() + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["action"] = "Action" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + queryParams["action"] = "action" + queryParams["enforcement_point_path"] = "enforcement_point_path" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/dns-forwarder", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsForwarderDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/dns-forwarder", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) +} + +func dnsForwarderGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/dns-forwarder", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["policy_dns_forwarder"] = "PolicyDnsForwarder" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dnsForwarderPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["policy_dns_forwarder"] = "PolicyDnsForwarder" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_dns_forwarder", + "PATCH", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/dns-forwarder", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func dnsForwarderUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["policy_dns_forwarder"] = "PolicyDnsForwarder" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dnsForwarderUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) +} + +func dnsForwarderUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["policy_dns_forwarder"] = "PolicyDnsForwarder" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["policy_dns_forwarder"] = bindings.NewReferenceType(model.PolicyDnsForwarderBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "policy_dns_forwarder", + "PUT", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/dns-forwarder", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/FloodProtectionProfileBindingsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/FloodProtectionProfileBindingsClient.go new file mode 100644 index 000000000..096ec0386 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/FloodProtectionProfileBindingsClient.go @@ -0,0 +1,66 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: FloodProtectionProfileBindings + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type FloodProtectionProfileBindingsClient interface { + + // API will delete Flood Protection Profile Binding for Tier-1 Logical Router. + // + // @param tier1IdParam (required) + // @param floodProtectionProfileBindingIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier1IdParam string, floodProtectionProfileBindingIdParam string) error + + // API will get Flood Protection Profile Binding Map for Tier-1 Logical Router. + // + // @param tier1IdParam (required) + // @param floodProtectionProfileBindingIdParam (required) + // @return com.vmware.nsx_global_policy.model.FloodProtectionProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier1IdParam string, floodProtectionProfileBindingIdParam string) (model.FloodProtectionProfileBindingMap, error) + + // API will create or update Flood Protection profile binding map for Tier-1 Logical Router. + // + // @param tier1IdParam (required) + // @param floodProtectionProfileBindingIdParam (required) + // @param floodProtectionProfileBindingMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier1IdParam string, floodProtectionProfileBindingIdParam string, floodProtectionProfileBindingMapParam model.FloodProtectionProfileBindingMap) error + + // API will create or update Flood Protection profile binding map for Tier-1 Logical Router. + // + // @param tier1IdParam (required) + // @param floodProtectionProfileBindingIdParam (required) + // @param floodProtectionProfileBindingMapParam (required) + // @return com.vmware.nsx_global_policy.model.FloodProtectionProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier1IdParam string, floodProtectionProfileBindingIdParam string, floodProtectionProfileBindingMapParam model.FloodProtectionProfileBindingMap) (model.FloodProtectionProfileBindingMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/FloodProtectionProfileBindingsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/FloodProtectionProfileBindingsTypes.go new file mode 100644 index 000000000..39d04a8ad --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/FloodProtectionProfileBindingsTypes.go @@ -0,0 +1,265 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: FloodProtectionProfileBindings. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func floodProtectionProfileBindingsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfileBindingsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func floodProtectionProfileBindingsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileBindingId"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + pathParams["flood_protection_profile_binding_id"] = "floodProtectionProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/flood-protection-profile-bindings/{floodProtectionProfileBindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfileBindingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfileBindingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) +} + +func floodProtectionProfileBindingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileBindingId"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + pathParams["flood_protection_profile_binding_id"] = "floodProtectionProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/flood-protection-profile-bindings/{floodProtectionProfileBindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfileBindingsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + fieldNameMap["flood_protection_profile_binding_map"] = "FloodProtectionProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfileBindingsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func floodProtectionProfileBindingsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + fieldNameMap["flood_protection_profile_binding_map"] = "FloodProtectionProfileBindingMap" + paramsTypeMap["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileBindingId"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + pathParams["flood_protection_profile_binding_id"] = "floodProtectionProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "flood_protection_profile_binding_map", + "PATCH", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/flood-protection-profile-bindings/{floodProtectionProfileBindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func floodProtectionProfileBindingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + fieldNameMap["flood_protection_profile_binding_map"] = "FloodProtectionProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func floodProtectionProfileBindingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) +} + +func floodProtectionProfileBindingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_id"] = bindings.NewStringType() + fields["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["flood_protection_profile_binding_id"] = "FloodProtectionProfileBindingId" + fieldNameMap["flood_protection_profile_binding_map"] = "FloodProtectionProfileBindingMap" + paramsTypeMap["flood_protection_profile_binding_map"] = bindings.NewReferenceType(model.FloodProtectionProfileBindingMapBindingType) + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["flood_protection_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["floodProtectionProfileBindingId"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + pathParams["flood_protection_profile_binding_id"] = "floodProtectionProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "flood_protection_profile_binding_map", + "PUT", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/flood-protection-profile-bindings/{floodProtectionProfileBindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/ForwardingTableClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/ForwardingTableClient.go new file mode 100644 index 000000000..60e172f1d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/ForwardingTableClient.go @@ -0,0 +1,39 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: ForwardingTable + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type ForwardingTableClient interface { + + // Get forwarding table from tier-1 + // + // @param tier1IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param edgeIdParam UUID of edge node (optional) + // @param edgePathParam Policy path of edge node (optional) + // @param enforcementPointPathParam Enforcement point path (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param networkPrefixParam IPv4 or IPv6 CIDR Block (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param routeSourceParam Filter routes based on the source from which route is learned (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.RoutingTableListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier1IdParam string, cursorParam *string, edgeIdParam *string, edgePathParam *string, enforcementPointPathParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, routeSourceParam *string, sortAscendingParam *bool, sortByParam *string) (model.RoutingTableListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/ForwardingTableTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/ForwardingTableTypes.go new file mode 100644 index 000000000..00f32c686 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/ForwardingTableTypes.go @@ -0,0 +1,143 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: ForwardingTable. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + +// Possible value for ``routeSource`` of method ForwardingTable#list. +const ForwardingTable_LIST_ROUTE_SOURCE_BGP = "BGP" +// Possible value for ``routeSource`` of method ForwardingTable#list. +const ForwardingTable_LIST_ROUTE_SOURCE_STATIC = "STATIC" +// Possible value for ``routeSource`` of method ForwardingTable#list. +const ForwardingTable_LIST_ROUTE_SOURCE_CONNECTED = "CONNECTED" + + + + +func forwardingTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_id"] = "EdgeId" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["route_source"] = "RouteSource" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardingTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoutingTableListResultBindingType) +} + +func forwardingTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_id"] = "EdgeId" + fieldNameMap["edge_path"] = "EdgePath" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["route_source"] = "RouteSource" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["edge_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + queryParams["cursor"] = "cursor" + queryParams["network_prefix"] = "network_prefix" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["edge_path"] = "edge_path" + queryParams["edge_id"] = "edge_id" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["route_source"] = "route_source" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/forwarding-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/GatewayFirewallClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/GatewayFirewallClient.go new file mode 100644 index 000000000..1f12accc4 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/GatewayFirewallClient.go @@ -0,0 +1,29 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: GatewayFirewall + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type GatewayFirewallClient interface { + + // Get filtered view of Gateway Firewall rules associated with the Tier-1. The gateway policies are returned in the order of category and sequence number. + // + // @param tier1IdParam (required) + // @return com.vmware.nsx_global_policy.model.GatewayPolicyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier1IdParam string) (model.GatewayPolicyListResult, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/GatewayFirewallTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/GatewayFirewallTypes.go new file mode 100644 index 000000000..56e708b57 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/GatewayFirewallTypes.go @@ -0,0 +1,77 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: GatewayFirewall. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func gatewayFirewallListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func gatewayFirewallListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GatewayPolicyListResultBindingType) +} + +func gatewayFirewallListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/gateway-firewall", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/LocaleServicesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/LocaleServicesClient.go new file mode 100644 index 000000000..13409e700 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/LocaleServicesClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: LocaleServices + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type LocaleServicesClient interface { + + // Delete Tier-1 locale-services + // + // @param tier1IdParam (required) + // @param localeServicesIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier1IdParam string, localeServicesIdParam string) error + + // Read Tier-1 locale-services + // + // @param tier1IdParam (required) + // @param localeServicesIdParam (required) + // @return com.vmware.nsx_global_policy.model.LocaleServices + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier1IdParam string, localeServicesIdParam string) (model.LocaleServices, error) + + // Paginated list of all Tier-1 locale-services + // + // @param tier1IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.LocaleServicesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier1IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LocaleServicesListResult, error) + + // If a Tier-1 locale services with the locale-services-id is not already present, create a new locale services. If it already exists, update Tier-1 locale services with specified attributes. + // + // @param tier1IdParam (required) + // @param localeServicesIdParam (required) + // @param localeServicesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier1IdParam string, localeServicesIdParam string, localeServicesParam model.LocaleServices) error + + // If a Tier-1 locale services with the locale-services-id is not already present, create a new locale-services. If it already exists, replace the Tier-1 locale services instance with the new object. Modifying edge cluster re-allocates NSX service routers of TIER1 to a different edge cluster. You can also place edge nodes manually and provide maximum two indices for HA mode ACTIVE_STANDBY. To re-allocating edge cluster is a disruptive operation and all existing statistics of Tier1 gateway will be removed. + // + // @param tier1IdParam (required) + // @param localeServicesIdParam (required) + // @param localeServicesParam (required) + // @return com.vmware.nsx_global_policy.model.LocaleServices + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier1IdParam string, localeServicesIdParam string, localeServicesParam model.LocaleServices) (model.LocaleServices, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/LocaleServicesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/LocaleServicesTypes.go new file mode 100644 index 000000000..3e2fb48dd --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/LocaleServicesTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: LocaleServices. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func localeServicesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func localeServicesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["locale_services_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["localeServicesId"] = bindings.NewStringType() + pathParams["locale_services_id"] = "localeServicesId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/locale-services/{localeServicesId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func localeServicesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LocaleServicesBindingType) +} + +func localeServicesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["locale_services_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["localeServicesId"] = bindings.NewStringType() + pathParams["locale_services_id"] = "localeServicesId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/locale-services/{localeServicesId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func localeServicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LocaleServicesListResultBindingType) +} + +func localeServicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/locale-services", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func localeServicesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fields["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + fieldNameMap["locale_services"] = "LocaleServices" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func localeServicesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fields["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + fieldNameMap["locale_services"] = "LocaleServices" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["locale_services_id"] = bindings.NewStringType() + paramsTypeMap["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["localeServicesId"] = bindings.NewStringType() + pathParams["locale_services_id"] = "localeServicesId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "locale_services", + "PATCH", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/locale-services/{localeServicesId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func localeServicesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fields["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + fieldNameMap["locale_services"] = "LocaleServices" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localeServicesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LocaleServicesBindingType) +} + +func localeServicesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["locale_services_id"] = bindings.NewStringType() + fields["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["locale_services_id"] = "LocaleServicesId" + fieldNameMap["locale_services"] = "LocaleServices" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["locale_services_id"] = bindings.NewStringType() + paramsTypeMap["locale_services"] = bindings.NewReferenceType(model.LocaleServicesBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["localeServicesId"] = bindings.NewStringType() + pathParams["locale_services_id"] = "localeServicesId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "locale_services", + "PUT", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/locale-services/{localeServicesId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SegmentsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SegmentsClient.go new file mode 100644 index 000000000..75c9cd4e4 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SegmentsClient.go @@ -0,0 +1,94 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Segments + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SegmentsClient interface { + + // Delete segment + // + // @param tier1IdParam (required) + // @param segmentIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier1IdParam string, segmentIdParam string) error + + // Force delete bypasses validations during segment deletion. This may result in an inconsistent connectivity. + // + // @param tier1IdParam (required) + // @param segmentIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete0(tier1IdParam string, segmentIdParam string) error + + // Read segment + // + // @param tier1IdParam (required) + // @param segmentIdParam (required) + // @return com.vmware.nsx_global_policy.model.Segment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier1IdParam string, segmentIdParam string) (model.Segment, error) + + // Paginated list of all segments under Tier-1 instance + // + // @param tier1IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SegmentListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier1IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SegmentListResult, error) + + // If segment with the segment-id is not already present, create a new segment. If it already exists, update the segment with specified attributes. + // + // @param tier1IdParam (required) + // @param segmentIdParam (required) + // @param segmentParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier1IdParam string, segmentIdParam string, segmentParam model.Segment) error + + // If segment with the segment-id is not already present, create a new segment. If it already exists, replace the segment with this object. + // + // @param tier1IdParam (required) + // @param segmentIdParam (required) + // @param segmentParam (required) + // @return com.vmware.nsx_global_policy.model.Segment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier1IdParam string, segmentIdParam string, segmentParam model.Segment) (model.Segment, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SegmentsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SegmentsTypes.go new file mode 100644 index 000000000..326a1f958 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SegmentsTypes.go @@ -0,0 +1,408 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Segments. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func segmentsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/segments/{segmentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsDelete0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsDelete0OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentsDelete0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "force=true", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/segments/{segmentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentBindingType) +} + +func segmentsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/segments/{segmentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentListResultBindingType) +} + +func segmentsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/segments", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func segmentsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment", + "PATCH", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/segments/{segmentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func segmentsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func segmentsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SegmentBindingType) +} + +func segmentsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["segment_id"] = bindings.NewStringType() + fields["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["segment_id"] = "SegmentId" + fieldNameMap["segment"] = "Segment" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["segment_id"] = bindings.NewStringType() + paramsTypeMap["segment"] = bindings.NewReferenceType(model.SegmentBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["segmentId"] = bindings.NewStringType() + pathParams["segment_id"] = "segmentId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "segment", + "PUT", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/segments/{segmentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SessionTimerProfileBindingsClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SessionTimerProfileBindingsClient.go new file mode 100644 index 000000000..81bfd513c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SessionTimerProfileBindingsClient.go @@ -0,0 +1,66 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: SessionTimerProfileBindings + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type SessionTimerProfileBindingsClient interface { + + // API will delete Session Timer Profile Binding for Tier-1 Logical Router. + // + // @param tier1IdParam (required) + // @param sessionTimerProfileBindingIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier1IdParam string, sessionTimerProfileBindingIdParam string) error + + // API will get Session Timer Profile Binding Map for Tier-1 Logical Router. + // + // @param tier1IdParam (required) + // @param sessionTimerProfileBindingIdParam (required) + // @return com.vmware.nsx_global_policy.model.SessionTimerProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier1IdParam string, sessionTimerProfileBindingIdParam string) (model.SessionTimerProfileBindingMap, error) + + // API will create or update Session Timer profile binding map for Tier-1 Logical Router. + // + // @param tier1IdParam (required) + // @param sessionTimerProfileBindingIdParam (required) + // @param sessionTimerProfileBindingMapParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier1IdParam string, sessionTimerProfileBindingIdParam string, sessionTimerProfileBindingMapParam model.SessionTimerProfileBindingMap) error + + // API will create or update Session Timer profile binding map for Tier-1 Logical Router. + // + // @param tier1IdParam (required) + // @param sessionTimerProfileBindingIdParam (required) + // @param sessionTimerProfileBindingMapParam (required) + // @return com.vmware.nsx_global_policy.model.SessionTimerProfileBindingMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier1IdParam string, sessionTimerProfileBindingIdParam string, sessionTimerProfileBindingMapParam model.SessionTimerProfileBindingMap) (model.SessionTimerProfileBindingMap, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SessionTimerProfileBindingsTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SessionTimerProfileBindingsTypes.go new file mode 100644 index 000000000..6a68449b9 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/SessionTimerProfileBindingsTypes.go @@ -0,0 +1,265 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: SessionTimerProfileBindings. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func sessionTimerProfileBindingsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTimerProfileBindingsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sessionTimerProfileBindingsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["sessionTimerProfileBindingId"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + pathParams["session_timer_profile_binding_id"] = "sessionTimerProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/session-timer-profile-bindings/{sessionTimerProfileBindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionTimerProfileBindingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTimerProfileBindingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) +} + +func sessionTimerProfileBindingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["sessionTimerProfileBindingId"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + pathParams["session_timer_profile_binding_id"] = "sessionTimerProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/session-timer-profile-bindings/{sessionTimerProfileBindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionTimerProfileBindingsPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + fieldNameMap["session_timer_profile_binding_map"] = "SessionTimerProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTimerProfileBindingsPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sessionTimerProfileBindingsPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + fieldNameMap["session_timer_profile_binding_map"] = "SessionTimerProfileBindingMap" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["sessionTimerProfileBindingId"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + pathParams["session_timer_profile_binding_id"] = "sessionTimerProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "session_timer_profile_binding_map", + "PATCH", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/session-timer-profile-bindings/{sessionTimerProfileBindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionTimerProfileBindingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + fieldNameMap["session_timer_profile_binding_map"] = "SessionTimerProfileBindingMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTimerProfileBindingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) +} + +func sessionTimerProfileBindingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_id"] = bindings.NewStringType() + fields["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["session_timer_profile_binding_id"] = "SessionTimerProfileBindingId" + fieldNameMap["session_timer_profile_binding_map"] = "SessionTimerProfileBindingMap" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_id"] = bindings.NewStringType() + paramsTypeMap["session_timer_profile_binding_map"] = bindings.NewReferenceType(model.SessionTimerProfileBindingMapBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["sessionTimerProfileBindingId"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + pathParams["session_timer_profile_binding_id"] = "sessionTimerProfileBindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "session_timer_profile_binding_map", + "PUT", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/session-timer-profile-bindings/{sessionTimerProfileBindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StateClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StateClient.go new file mode 100644 index 000000000..4a911b4cb --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StateClient.go @@ -0,0 +1,36 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: State + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type StateClient interface { + + // Returns + // + // @param tier1IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param enforcementPointPathParam Enforcement point path (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param interfacePathParam Interface path for interface specific state such as IPv6 DAD state (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.Tier1GatewayState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier1IdParam string, cursorParam *string, enforcementPointPathParam *string, includedFieldsParam *string, interfacePathParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.Tier1GatewayState, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StateTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StateTypes.go new file mode 100644 index 000000000..e73ab6855 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StateTypes.go @@ -0,0 +1,119 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: State. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["interface_path"] = "InterfacePath" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.Tier1GatewayStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["interface_path"] = "InterfacePath" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + queryParams["cursor"] = "cursor" + queryParams["interface_path"] = "interface_path" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["enforcement_point_path"] = "enforcement_point_path" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StaticRoutesClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StaticRoutesClient.go new file mode 100644 index 000000000..c4e5d535c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StaticRoutesClient.go @@ -0,0 +1,83 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: StaticRoutes + * Used by client-side stubs. + */ + +package tier_1s + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type StaticRoutesClient interface { + + // Delete Tier-1 static routes + // + // @param tier1IdParam (required) + // @param routeIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tier1IdParam string, routeIdParam string) error + + // Read Tier-1 static routes + // + // @param tier1IdParam (required) + // @param routeIdParam (required) + // @return com.vmware.nsx_global_policy.model.StaticRoutes + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tier1IdParam string, routeIdParam string) (model.StaticRoutes, error) + + // Paginated list of all Tier-1 Static Routes + // + // @param tier1IdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeMarkForDeleteObjectsParam Include objects that are marked for deletion in results (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.StaticRoutesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(tier1IdParam string, cursorParam *string, includeMarkForDeleteObjectsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.StaticRoutesListResult, error) + + // If static routes for route-id are not already present, create static routes. If it already exists, update static routes for route-id. + // + // @param tier1IdParam (required) + // @param routeIdParam (required) + // @param staticRoutesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(tier1IdParam string, routeIdParam string, staticRoutesParam model.StaticRoutes) error + + // If static routes for route-id are not already present, create static routes. If it already exists, replace the static routes for route-id. + // + // @param tier1IdParam (required) + // @param routeIdParam (required) + // @param staticRoutesParam (required) + // @return com.vmware.nsx_global_policy.model.StaticRoutes + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(tier1IdParam string, routeIdParam string, staticRoutesParam model.StaticRoutes) (model.StaticRoutes, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StaticRoutesTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StaticRoutesTypes.go new file mode 100644 index 000000000..59a3d1ded --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/StaticRoutesTypes.go @@ -0,0 +1,351 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: StaticRoutes. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func staticRoutesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["route_id"] = "RouteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func staticRoutesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["route_id"] = "RouteId" + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/static-routes/{routeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["route_id"] = "RouteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRoutesBindingType) +} + +func staticRoutesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["route_id"] = "RouteId" + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/static-routes/{routeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRoutesListResultBindingType) +} + +func staticRoutesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_mark_for_delete_objects"] = "IncludeMarkForDeleteObjects" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["include_mark_for_delete_objects"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + pathParams["tier1_id"] = "tier1Id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["include_mark_for_delete_objects"] = "include_mark_for_delete_objects" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/static-routes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fields["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["route_id"] = "RouteId" + fieldNameMap["static_routes"] = "StaticRoutes" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesPatchOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func staticRoutesPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fields["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["route_id"] = "RouteId" + fieldNameMap["static_routes"] = "StaticRoutes" + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "static_routes", + "PATCH", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/static-routes/{routeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tier1_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fields["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["route_id"] = "RouteId" + fieldNameMap["static_routes"] = "StaticRoutes" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRoutesBindingType) +} + +func staticRoutesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tier1_id"] = bindings.NewStringType() + fields["route_id"] = bindings.NewStringType() + fields["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + fieldNameMap["tier1_id"] = "Tier1Id" + fieldNameMap["route_id"] = "RouteId" + fieldNameMap["static_routes"] = "StaticRoutes" + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["tier1_id"] = bindings.NewStringType() + paramsTypeMap["static_routes"] = bindings.NewReferenceType(model.StaticRoutesBindingType) + paramsTypeMap["tier1Id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + pathParams["tier1_id"] = "tier1Id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "static_routes", + "PUT", + "/global-manager/api/v1/global-infra/tier-1s/{tier1Id}/static-routes/{routeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/Tier1sPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/Tier1sPackageTypes.go new file mode 100644 index 000000000..96f83a1e1 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s/Tier1sPackageTypes.go @@ -0,0 +1,19 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy.global_infra.tier_1s. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package tier_1s + + + + + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/go.mod b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/go.mod new file mode 100644 index 000000000..0d5b616fb --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/go.mod @@ -0,0 +1,8 @@ +module github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm + +go 1.13 + +require ( + github.com/vmware/vsphere-automation-sdk-go/lib v0.3.1 + github.com/vmware/vsphere-automation-sdk-go/runtime v0.3.1 +) diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/go.sum b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/go.sum new file mode 100644 index 000000000..f67dd2214 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/go.sum @@ -0,0 +1,20 @@ +github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= +github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= +github.com/gibson042/canonicaljson-go v1.0.3 h1:EAyF8L74AWabkyUmrvEFHEt/AGFQeD6RfwbAuf0j1bI= +github.com/gibson042/canonicaljson-go v1.0.3/go.mod h1:DsLpJTThXyGNO+KZlI85C1/KDcImpP67k/RKVjcaEqo= +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/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/vmware/vsphere-automation-sdk-go/lib v0.3.1 h1:YIcvcshkKm/fbXOvheGfAlGlDTitQXUSMPnYON/uzyg= +github.com/vmware/vsphere-automation-sdk-go/lib v0.3.1/go.mod h1:lzuoOgc7zhx3bfrKFRDBbaJX3wj4wSstWv4pTpryhJs= +github.com/vmware/vsphere-automation-sdk-go/runtime v0.3.1 h1:AhoRilMJ6hZbBDr4J9GSrAVpPBkLlZz8+FS84Pdbhc8= +github.com/vmware/vsphere-automation-sdk-go/runtime v0.3.1/go.mod h1:kYY+E5osoSMD814W25lc8SqHqSo32hbCZr4pFRA5VgA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model/ModelPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model/ModelPackageTypes.go new file mode 100644 index 000000000..de84d179d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model/ModelPackageTypes.go @@ -0,0 +1,80008 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy.model. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package model + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" +) + + +// An ServiceEntry that represents an ALG protocol +type ALGTypeServiceEntry struct { + // Possible values are: + // + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_ORACLE_TNS + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_FTP + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_SUN_RPC_TCP + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_SUN_RPC_UDP + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_MS_RPC_TCP + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_MS_RPC_UDP + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_NBNS_BROADCAST + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_NBDG_BROADCAST + // * ALGTypeServiceEntry#ALGTypeServiceEntry_ALG_TFTP + // + // The Application Layer Gateway (ALG) protocol. Please note, protocol NBNS_BROADCAST and NBDG_BROADCAST are deprecated. Please use UDP protocol and create L4 Port Set type of service instead. + Alg *string + // The destination_port cannot be empty and must be a single value. format: port-or-range + DestinationPorts []string + SourcePorts []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ALGTypeServiceEntry__TYPE_IDENTIFIER = "ALGTypeServiceEntry" +const ALGTypeServiceEntry_ALG_ORACLE_TNS = "ORACLE_TNS" +const ALGTypeServiceEntry_ALG_FTP = "FTP" +const ALGTypeServiceEntry_ALG_SUN_RPC_TCP = "SUN_RPC_TCP" +const ALGTypeServiceEntry_ALG_SUN_RPC_UDP = "SUN_RPC_UDP" +const ALGTypeServiceEntry_ALG_MS_RPC_TCP = "MS_RPC_TCP" +const ALGTypeServiceEntry_ALG_MS_RPC_UDP = "MS_RPC_UDP" +const ALGTypeServiceEntry_ALG_NBNS_BROADCAST = "NBNS_BROADCAST" +const ALGTypeServiceEntry_ALG_NBDG_BROADCAST = "NBDG_BROADCAST" +const ALGTypeServiceEntry_ALG_TFTP = "TFTP" + +func (s ALGTypeServiceEntry) GetType__() bindings.BindingType { + return ALGTypeServiceEntryBindingType() +} + +func (s ALGTypeServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ALGTypeServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the space in which the policy is being defined. +type AbstractSpace struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * AbstractSpace#AbstractSpace_CONNECTIVITY_STRATEGY_WHITELIST + // * AbstractSpace#AbstractSpace_CONNECTIVITY_STRATEGY_BLACKLIST + // * AbstractSpace#AbstractSpace_CONNECTIVITY_STRATEGY_WHITELIST_ENABLE_LOGGING + // * AbstractSpace#AbstractSpace_CONNECTIVITY_STRATEGY_BLACKLIST_ENABLE_LOGGING + // * AbstractSpace#AbstractSpace_CONNECTIVITY_STRATEGY_NONE + // + // The connectivity strategy is deprecated. Use default layer3 rule, /infra/domains/default/security-policies/default-layer3-security-policy/rules/default-layer3-rule. This field indicates the default connectivity policy for the infra or tenant space WHITELIST - Adds a default drop rule. Administrator can then use \"allow\" rules (aka whitelist) to allow traffic between groups BLACKLIST - Adds a default allow rule. Admin can then use \"drop\" rules (aka blacklist) to block traffic between groups WHITELIST_ENABLE_LOGGING - Whitelising with logging enabled BLACKLIST_ENABLE_LOGGING - Blacklisting with logging enabled NONE - No default rules are added. + ConnectivityStrategy *string +} +const AbstractSpace_CONNECTIVITY_STRATEGY_WHITELIST = "WHITELIST" +const AbstractSpace_CONNECTIVITY_STRATEGY_BLACKLIST = "BLACKLIST" +const AbstractSpace_CONNECTIVITY_STRATEGY_WHITELIST_ENABLE_LOGGING = "WHITELIST_ENABLE_LOGGING" +const AbstractSpace_CONNECTIVITY_STRATEGY_BLACKLIST_ENABLE_LOGGING = "BLACKLIST_ENABLE_LOGGING" +const AbstractSpace_CONNECTIVITY_STRATEGY_NONE = "NONE" + +func (s AbstractSpace) GetType__() bindings.BindingType { + return AbstractSpaceBindingType() +} + +func (s AbstractSpace) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AbstractSpace._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type AcceptableComponentVersion struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of component versions + AcceptableVersions []string + // Possible values are: + // + // * AcceptableComponentVersion#AcceptableComponentVersion_COMPONENT_TYPE_HOST + // * AcceptableComponentVersion#AcceptableComponentVersion_COMPONENT_TYPE_EDGE + // * AcceptableComponentVersion#AcceptableComponentVersion_COMPONENT_TYPE_CCP + // * AcceptableComponentVersion#AcceptableComponentVersion_COMPONENT_TYPE_MP + // + // Node type + ComponentType *string +} +const AcceptableComponentVersion_COMPONENT_TYPE_HOST = "HOST" +const AcceptableComponentVersion_COMPONENT_TYPE_EDGE = "EDGE" +const AcceptableComponentVersion_COMPONENT_TYPE_CCP = "CCP" +const AcceptableComponentVersion_COMPONENT_TYPE_MP = "MP" + +func (s AcceptableComponentVersion) GetType__() bindings.BindingType { + return AcceptableComponentVersionBindingType() +} + +func (s AcceptableComponentVersion) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AcceptableComponentVersion._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type AcceptableComponentVersionList struct { + // Acceptable version whitelist for different components + Results []AcceptableComponentVersion +} + +func (s AcceptableComponentVersionList) GetType__() bindings.BindingType { + return AcceptableComponentVersionListBindingType() +} + +func (s AcceptableComponentVersionList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AcceptableComponentVersionList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Reaction Action is the action to take when the stipulated criteria specified in the event exist over the source. Some example actions include: - Notify Admin (or VMC's SRE) via email. - Populate a specific label with the IPSec VPN Session. - Remove the IPSec VPN Session from a specific label. +type Action struct { + // Possible values are: + // + // * Action#Action_RESOURCE_TYPE_PATCHRESOURCES + // * Action#Action_RESOURCE_TYPE_SETFIELDS + // + // Reaction Action resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const Action__TYPE_IDENTIFIER = "Action" +const Action_RESOURCE_TYPE_PATCHRESOURCES = "PatchResources" +const Action_RESOURCE_TYPE_SETFIELDS = "SetFields" + +func (s Action) GetType__() bindings.BindingType { + return ActionBindingType() +} + +func (s Action) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Action._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Resources managed during restore process +type ActionableResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // A resource reference on which actions can be performed format: hostname-or-ip + IpAddress *string +} + +func (s ActionableResource) GetType__() bindings.BindingType { + return ActionableResourceBindingType() +} + +func (s ActionableResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ActionableResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type ActionableResourceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []ActionableResource +} + +func (s ActionableResourceListResult) GetType__() bindings.BindingType { + return ActionableResourceListResultBindingType() +} + +func (s ActionableResourceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ActionableResourceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// An identity source service that runs Microsoft Active Directory. The service allows selected user accounts defined in Active Directory to log into and access NSX-T. +type ActiveDirectoryIdentitySource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LdapIdentitySource#LdapIdentitySource_RESOURCE_TYPE_ACTIVEDIRECTORYIDENTITYSOURCE + // * LdapIdentitySource#LdapIdentitySource_RESOURCE_TYPE_OPENLDAPIDENTITYSOURCE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The subtree of the LDAP identity source to search when locating users and groups. + BaseDn *string + // The name of the authentication domain. When users log into NSX using an identity of the form \"user\\\\@domain\", NSX uses the domain portion to determine which LDAP identity source to use. For Active Directory, this domain name must match the domain of the Active Directory. + DomainName *string + // The list of LDAP servers that provide LDAP service for this identity source. Currently, only one LDAP server is supported. + LdapServers []IdentitySourceLdapServer +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ActiveDirectoryIdentitySource__TYPE_IDENTIFIER = "ActiveDirectoryIdentitySource" + +func (s ActiveDirectoryIdentitySource) GetType__() bindings.BindingType { + return ActiveDirectoryIdentitySourceBindingType() +} + +func (s ActiveDirectoryIdentitySource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ActiveDirectoryIdentitySource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type AdvanceClusterRestoreInput struct { + // Unique id of an instruction (as returned by the GET /restore/status call) for which input is to be provided + Id *string + // List of resources for which the instruction is applicable. + Resources []SelectableResourceReference +} + +func (s AdvanceClusterRestoreInput) GetType__() bindings.BindingType { + return AdvanceClusterRestoreInputBindingType() +} + +func (s AdvanceClusterRestoreInput) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AdvanceClusterRestoreInput._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type AdvanceClusterRestoreRequest struct { + // List of instructions and their associated data + Data []AdvanceClusterRestoreInput +} + +func (s AdvanceClusterRestoreRequest) GetType__() bindings.BindingType { + return AdvanceClusterRestoreRequestBindingType() +} + +func (s AdvanceClusterRestoreRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AdvanceClusterRestoreRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Aggregate of DNS forwarder statistics across enforcement points. +type AggregateDNSForwarderStatistics struct { + // String path of the DNS forwarder intent. + IntentPath *string + // List of DNS forwarder statistics per enforcement point. + StatisticsPerEnforcementPoint []*data.StructValue +} + +func (s AggregateDNSForwarderStatistics) GetType__() bindings.BindingType { + return AggregateDNSForwarderStatisticsBindingType() +} + +func (s AggregateDNSForwarderStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregateDNSForwarderStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Aggregate of DNS forwarder status across enforcement points. +type AggregateDNSForwarderStatus struct { + // String path of the DNS forwarder intent. + IntentPath *string + // List of DNS forwarder status per enforcement point. + StatusPerEnforcementPoint []*data.StructValue +} + +func (s AggregateDNSForwarderStatus) GetType__() bindings.BindingType { + return AggregateDNSForwarderStatusBindingType() +} + +func (s AggregateDNSForwarderStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregateDNSForwarderStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Aggregate of DNS forwarder nslookup answer across enforcement points. +type AggregatePolicyDnsAnswer struct { + // List of DNS forwarder nslookup answer per enforcement point. + DnsAnswerPerEnforcementPoint []*data.StructValue + // String path of the DNS forwarder intent. + IntentPath *string +} + +func (s AggregatePolicyDnsAnswer) GetType__() bindings.BindingType { + return AggregatePolicyDnsAnswerBindingType() +} + +func (s AggregatePolicyDnsAnswer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregatePolicyDnsAnswer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Aggregate of PolicyRuntimeInfoPerEP across Enforcement Points. +type AggregatePolicyRuntimeInfo struct { + // Intent path of object, forward slashes must be escaped using %2F. + IntentPath *string +} + +func (s AggregatePolicyRuntimeInfo) GetType__() bindings.BindingType { + return AggregatePolicyRuntimeInfoBindingType() +} + +func (s AggregatePolicyRuntimeInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregatePolicyRuntimeInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type AggregatedDataCounter struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter +} + +func (s AggregatedDataCounter) GetType__() bindings.BindingType { + return AggregatedDataCounterBindingType() +} + +func (s AggregatedDataCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregatedDataCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type AggregatedDataCounterEx struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + DroppedBySecurityPackets *PacketsDroppedBySecurity + MacLearning *MacLearningCounters +} + +func (s AggregatedDataCounterEx) GetType__() bindings.BindingType { + return AggregatedDataCounterExBindingType() +} + +func (s AggregatedDataCounterEx) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregatedDataCounterEx._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type AggregatedLogicalRouterPortCounters struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Rx *LogicalRouterPortCounters + Tx *LogicalRouterPortCounters +} + +func (s AggregatedLogicalRouterPortCounters) GetType__() bindings.BindingType { + return AggregatedLogicalRouterPortCountersBindingType() +} + +func (s AggregatedLogicalRouterPortCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregatedLogicalRouterPortCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed information about an API Error +type ApiError struct { + // Further details about the error + Details *string + // A numeric error code format: int64 + ErrorCode *int64 + // Additional data about the error + ErrorData *data.StructValue + // A description of the error + ErrorMessage *string + // The module name where the error occurred + ModuleName *string + // Other errors related to this error + RelatedErrors []RelatedApiError +} + +func (s ApiError) GetType__() bindings.BindingType { + return ApiErrorBindingType() +} + +func (s ApiError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApiError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// API Request Body is an Event Source that represents an API request body that is being reveived as part of an API. Supported Request Bodies are those received as part of a PATCH/PUT/POST request. +type ApiRequestBody struct { + // Regex path representing a regex expression on resources. This regex is used to identify the request body(ies) that is/are the source of the Event. For instance: specifying \"Lb\* | /infra/tier-0s/vmc/ipsec-vpn-services/default\" as a source means that ANY resource starting with Lb or ANY resource with \"/infra/tier-0s/vmc/ipsec-vpn-services/default\" as path would be the source of the event in question. + ResourcePointer *string + // Possible values are: + // + // * Source#Source_RESOURCE_TYPE_RESOURCEOPERATION + // * Source#Source_RESOURCE_TYPE_APIREQUESTBODY + // + // Event Source resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ApiRequestBody__TYPE_IDENTIFIER = "ApiRequestBody" + +func (s ApiRequestBody) GetType__() bindings.BindingType { + return ApiRequestBodyBindingType() +} + +func (s ApiRequestBody) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApiRequestBody._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type ArpHeader struct { + // The destination IP address format: ipv4 + DstIp *string + // Possible values are: + // + // * ArpHeader#ArpHeader_OP_CODE_REQUEST + // * ArpHeader#ArpHeader_OP_CODE_REPLY + // + // This field specifies the nature of the Arp message being sent. + OpCode *string + // This field specifies the IP address of the sender. If omitted, the src_ip is set to 0.0.0.0. format: ipv4 + SrcIp *string +} +const ArpHeader_OP_CODE_REQUEST = "ARP_REQUEST" +const ArpHeader_OP_CODE_REPLY = "ARP_REPLY" + +func (s ArpHeader) GetType__() bindings.BindingType { + return ArpHeaderBindingType() +} + +func (s ArpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ArpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains ARP snooping related configuration. +type ArpSnoopingConfig struct { + // Number of arp snooped IP addresses Indicates the number of arp snooped IP addresses to be remembered per LogicalPort. Decreasing this value, will retain the latest bindings from the existing list of address bindings. Increasing this value will retain existing bindings and also learn any new address bindings discovered on the port until the new limit is reached. format: int32 + ArpBindingLimit *int64 + // Indicates whether ARP snooping is enabled + ArpSnoopingEnabled *bool +} + +func (s ArpSnoopingConfig) GetType__() bindings.BindingType { + return ArpSnoopingConfigBindingType() +} + +func (s ArpSnoopingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ArpSnoopingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Attribute specific to a partner. There attributes are passed on to the partner appliance and is opaque to the NSX Manager. The Attributes used by the partner applicance. +type Attribute struct { + // Possible values are: + // + // * Attribute#Attribute_ATTRIBUTE_TYPE_IP_ADDRESS + // * Attribute#Attribute_ATTRIBUTE_TYPE_PORT + // * Attribute#Attribute_ATTRIBUTE_TYPE_PASSWORD + // * Attribute#Attribute_ATTRIBUTE_TYPE_STRING + // * Attribute#Attribute_ATTRIBUTE_TYPE_LONG + // * Attribute#Attribute_ATTRIBUTE_TYPE_BOOLEAN + // + // Attribute Type can be of any of the allowed enum type. + AttributeType *string + // Attribute display name string value. + DisplayName *string + // Attribute key string value. + Key *string + // Read only Attribute cannot be overdidden by service instance/deployment. + ReadOnly *bool + // Attribute value string value. + Value *string +} +const Attribute_ATTRIBUTE_TYPE_IP_ADDRESS = "IP_ADDRESS" +const Attribute_ATTRIBUTE_TYPE_PORT = "PORT" +const Attribute_ATTRIBUTE_TYPE_PASSWORD = "PASSWORD" +const Attribute_ATTRIBUTE_TYPE_STRING = "STRING" +const Attribute_ATTRIBUTE_TYPE_LONG = "LONG" +const Attribute_ATTRIBUTE_TYPE_BOOLEAN = "BOOLEAN" + +func (s Attribute) GetType__() bindings.BindingType { + return AttributeBindingType() +} + +func (s Attribute) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Attribute._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains type specific properties of generic realized entity +type AttributeVal struct { + // Possible values are: + // + // * AttributeVal#AttributeVal_DATA_TYPE_STRING + // * AttributeVal#AttributeVal_DATA_TYPE_DATE + // * AttributeVal#AttributeVal_DATA_TYPE_INTEGER + // * AttributeVal#AttributeVal_DATA_TYPE_BOOLEAN + // + // Datatype of the property + DataType *string + // Attribute key + Key *string + // If attribute has a single value or collection of values + Multivalue *bool + // List of attribute values + Values []string +} +const AttributeVal_DATA_TYPE_STRING = "STRING" +const AttributeVal_DATA_TYPE_DATE = "DATE" +const AttributeVal_DATA_TYPE_INTEGER = "INTEGER" +const AttributeVal_DATA_TYPE_BOOLEAN = "BOOLEAN" + +func (s AttributeVal) GetType__() bindings.BindingType { + return AttributeValBindingType() +} + +func (s AttributeVal) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AttributeVal._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents X and Y axes of a graph. For a multi-graph, the same axes are shared by all the graphs. +type Axes struct { + // Label for X axis of a graph + XLabel *Label + // Label for Y axis of a graph + YLabel *Label +} + +func (s Axes) GetType__() bindings.BindingType { + return AxesBindingType() +} + +func (s Axes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Axes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Configuration for taking manual/automated backup +type BackupConfiguration struct { + // A number of seconds after a last backup, that needs to pass, before a topology change will trigger a generation of a new cluster/node backups. If parameter is not provided, then changes in a topology will not trigger a generation of cluster/node backups. format: int64 + AfterInventoryUpdateInterval *int64 + // true if automated backup is enabled + BackupEnabled *bool + // Set when backups should be taken - on a weekly schedule or at regular intervals. + BackupSchedule *data.StructValue + // The minimum number of seconds between each upload of the inventory summary to backup server. format: int64 + InventorySummaryInterval *int64 + // Passphrase used to encrypt backup files. The passphrase specified must be at least 8 characters in length and must contain at least one lowercase, one uppercase, one numeric character and one special character (any other non-space character). + Passphrase *string + // The server to which backups will be sent. + RemoteFileServer *RemoteFileServer +} + +func (s BackupConfiguration) GetType__() bindings.BindingType { + return BackupConfigurationBindingType() +} + +func (s BackupConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Past backup operation details +type BackupOperationHistory struct { + // Statuses of previous cluser backups + ClusterBackupStatuses []BackupOperationStatus + // Statuses of previous inventory backups + InventoryBackupStatuses []BackupOperationStatus + // Statuses of previous node backups + NodeBackupStatuses []BackupOperationStatus +} + +func (s BackupOperationHistory) GetType__() bindings.BindingType { + return BackupOperationHistoryBindingType() +} + +func (s BackupOperationHistory) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupOperationHistory._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Backup operation status +type BackupOperationStatus struct { + // Unique identifier of a backup + BackupId *string + // Time when operation was ended format: int64 + EndTime *int64 + // Possible values are: + // + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_NOT_RUN_ON_MASTER + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_SERVER_UNREACHABLE + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_AUTHENTICATION_FAILURE + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_PERMISSION_ERROR + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_TIMEOUT + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_BAD_FINGERPRINT + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_GENERIC_ERROR + // + // Error code + ErrorCode *string + // Error code details + ErrorMessage *string + // Time when operation was started format: int64 + StartTime *int64 + // True if backup is successfully completed, else false + Success *bool +} +const BackupOperationStatus_ERROR_CODE_NOT_RUN_ON_MASTER = "BACKUP_NOT_RUN_ON_MASTER" +const BackupOperationStatus_ERROR_CODE_SERVER_UNREACHABLE = "BACKUP_SERVER_UNREACHABLE" +const BackupOperationStatus_ERROR_CODE_AUTHENTICATION_FAILURE = "BACKUP_AUTHENTICATION_FAILURE" +const BackupOperationStatus_ERROR_CODE_PERMISSION_ERROR = "BACKUP_PERMISSION_ERROR" +const BackupOperationStatus_ERROR_CODE_TIMEOUT = "BACKUP_TIMEOUT" +const BackupOperationStatus_ERROR_CODE_BAD_FINGERPRINT = "BACKUP_BAD_FINGERPRINT" +const BackupOperationStatus_ERROR_CODE_GENERIC_ERROR = "BACKUP_GENERIC_ERROR" + +func (s BackupOperationStatus) GetType__() bindings.BindingType { + return BackupOperationStatusBindingType() +} + +func (s BackupOperationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupOperationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Data for a single backup/restore card +type BackupOverview struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of timestamps of backed-up cluster files + Results []ClusterBackupInfo + // Configuration to generate a manual/automated backup + BackupConfig *BackupConfiguration + // Status of the last backup execution per component + BackupOperationHistory *BackupOperationHistory + // Backup status decribes type, phase, success/failure and time of a | latest backup execution + CurrentBackupOperationStatus *CurrentBackupOperationStatus + // Status of restore process executing/executed on appliance + RestoreStatus *ClusterRestoreStatus +} + +func (s BackupOverview) GetType__() bindings.BindingType { + return BackupOverviewBindingType() +} + +func (s BackupOverview) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupOverview._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Abstract base type for Weekly or Interval Backup Schedule +type BackupSchedule struct { + // Possible values are: + // + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_WEEKLYBACKUPSCHEDULE + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_INTERVALBACKUPSCHEDULE + // + // Schedule type + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BackupSchedule__TYPE_IDENTIFIER = "BackupSchedule" +const BackupSchedule_RESOURCE_TYPE_WEEKLYBACKUPSCHEDULE = "WeeklyBackupSchedule" +const BackupSchedule_RESOURCE_TYPE_INTERVALBACKUPSCHEDULE = "IntervalBackupSchedule" + +func (s BackupSchedule) GetType__() bindings.BindingType { + return BackupScheduleBindingType() +} + +func (s BackupSchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupSchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Consolidated Realized Status Per Enforcement Point. +type BaseConsolidatedStatusPerEnforcementPoint struct { + // Alarm information details. + Alarm *PolicyRuntimeAlarm + // Policy Path referencing the enforcement point where the info is fetched. + EnforcementPointPath *string + // Consolidated Realized Status of an Intent object per enforcement point. + ConsolidatedStatus *ConsolidatedStatus + // Enforcement Point Id. + EnforcementPointId *string + ResourceType string + // The site where this enforcement point resides. + SitePath *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BaseConsolidatedStatusPerEnforcementPoint__TYPE_IDENTIFIER = "BaseConsolidatedStatusPerEnforcementPoint" + +func (s BaseConsolidatedStatusPerEnforcementPoint) GetType__() bindings.BindingType { + return BaseConsolidatedStatusPerEnforcementPointBindingType() +} + +func (s BaseConsolidatedStatusPerEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseConsolidatedStatusPerEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents an endpoint which will be used as subject in rule. It is a polymorphic type object which can be either of the types - 1. Virtual 2. Logical We have 2 separate objects representing these 2 types. VirtualEndPoint for Virtual type and ServiceInstanceEndpoint for Logical. +type BaseEndpoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseEndpoint#BaseEndpoint_RESOURCE_TYPE_VIRTUALENDPOINT + // * BaseEndpoint#BaseEndpoint_RESOURCE_TYPE_SERVICEINSTANCEENDPOINT + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // IPs where either inbound or outbound traffic is to be redirected. + TargetIps []IPInfo +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BaseEndpoint__TYPE_IDENTIFIER = "BaseEndpoint" +const BaseEndpoint_RESOURCE_TYPE_VIRTUALENDPOINT = "VirtualEndpoint" +const BaseEndpoint_RESOURCE_TYPE_SERVICEINSTANCEENDPOINT = "ServiceInstanceEndpoint" + +func (s BaseEndpoint) GetType__() bindings.BindingType { + return BaseEndpointBindingType() +} + +func (s BaseEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents an instance of partner Service and its configuration. +type BasePolicyServiceInstance struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * BasePolicyServiceInstance#BasePolicyServiceInstance_DEPLOYMENT_MODE_STAND_ALONE + // * BasePolicyServiceInstance#BasePolicyServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY + // + // Deployment mode specifies how the partner appliance will be deployed i.e. in HA or standalone mode. + DeploymentMode *string + // Unique name of Partner Service in the Marketplace + PartnerServiceName *string + // Possible values are: + // + // * BasePolicyServiceInstance#BasePolicyServiceInstance_TRANSPORT_TYPE_L2_BRIDGE + // * BasePolicyServiceInstance#BasePolicyServiceInstance_TRANSPORT_TYPE_L3_ROUTED + // + // Transport to be used while deploying Service-VM. + TransportType *string +} +const BasePolicyServiceInstance_DEPLOYMENT_MODE_STAND_ALONE = "STAND_ALONE" +const BasePolicyServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY = "ACTIVE_STANDBY" +const BasePolicyServiceInstance_TRANSPORT_TYPE_L2_BRIDGE = "L2_BRIDGE" +const BasePolicyServiceInstance_TRANSPORT_TYPE_L3_ROUTED = "L3_ROUTED" + +func (s BasePolicyServiceInstance) GetType__() bindings.BindingType { + return BasePolicyServiceInstanceBindingType() +} + +func (s BasePolicyServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BasePolicyServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A rule indicates the action to be performed for various types of traffic flowing between workload groups. +type BaseRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + DestinationGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the destination groups. If false, the rule applies to the destination groups + DestinationsExcluded *bool + // Possible values are: + // + // * BaseRule#BaseRule_DIRECTION_IN + // * BaseRule#BaseRule_DIRECTION_OUT + // * BaseRule#BaseRule_DIRECTION_IN_OUT + // + // Define direction of traffic. + Direction *string + // Flag to disable the rule. Default is enabled. + Disabled *bool + // Possible values are: + // + // * BaseRule#BaseRule_IP_PROTOCOL_IPV4 + // * BaseRule#BaseRule_IP_PROTOCOL_IPV6 + // * BaseRule#BaseRule_IP_PROTOCOL_IPV4_IPV6 + // + // Type of IP packet that should be matched while enforcing the rule. The value is set to IPV4_IPV6 for Layer3 rule if not specified. For Layer2/Ether rule the value must be null. + IpProtocol *string + // A flag to indicate whether rule is a default rule. + IsDefault *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // Text for additional notes on changes. + Notes *string + // Holds the list of layer 7 service profile paths. These profiles accept attributes and sub-attributes of various network services (e.g. L4 AppId, encryption algorithm, domain name, etc) as key value pairs. + Profiles []string + // This is a unique 4 byte positive number that is assigned by the system. This rule id is passed all the way down to the data path. The first 1GB (1000 to 2^30) will be shared by GM and LM with zebra style striped number space. For E.g 1000 to (1Million -1) by LM, (1M - 2M-1) by GM and so on. format: int64 + RuleId *int64 + // The list of policy paths where the rule is applied LR/Edge/T0/T1/LRP etc. Note that a given rule can be applied on multiple LRs/LRPs. + Scope []string + // This field is used to resolve conflicts between multiple Rules under Security or Gateway Policy for a Domain If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple rules with the same sequence number then their order is not deterministic. If a specific order of rules is desired, then one has to specify unique sequence numbers or use the POST request on the rule entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // In order to specify raw services this can be used, along with services which contains path to services. This can be empty or null. + ServiceEntries []*data.StructValue + // In order to specify all services, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the services array. Error will be thrown if ANY is used in conjunction with other values. + Services []string + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + SourceGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the source groups. If false, the rule applies to the source groups + SourcesExcluded *bool + // User level field which will be printed in CLI and packet logs. + Tag *string +} +const BaseRule_DIRECTION_IN = "IN" +const BaseRule_DIRECTION_OUT = "OUT" +const BaseRule_DIRECTION_IN_OUT = "IN_OUT" +const BaseRule_IP_PROTOCOL_IPV4 = "IPV4" +const BaseRule_IP_PROTOCOL_IPV6 = "IPV6" +const BaseRule_IP_PROTOCOL_IPV4_IPV6 = "IPV4_IPV6" + +func (s BaseRule) GetType__() bindings.BindingType { + return BaseRuleBindingType() +} + +func (s BaseRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Rules +type BaseRuleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string +} + +func (s BaseRuleListResult) GetType__() bindings.BindingType { + return BaseRuleListResultBindingType() +} + +func (s BaseRuleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseRuleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier-0 interface configuration for external connectivity. +type BaseTier0Interface struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Specify IP address and network prefix for interface. + Subnets []InterfaceSubnet +} + +func (s BaseTier0Interface) GetType__() bindings.BindingType { + return BaseTier0InterfaceBindingType() +} + +func (s BaseTier0Interface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseTier0Interface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A set of operations to be performed in a single batch +type BatchRequest struct { + // Flag to decide if we will continue processing subsequent requests in case of current error for atomic = false. + ContinueOnError *bool + Requests []BatchRequestItem +} + +func (s BatchRequest) GetType__() bindings.BindingType { + return BatchRequestBindingType() +} + +func (s BatchRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BatchRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A single request within a batch of operations +type BatchRequestItem struct { + Body *data.StructValue + // Possible values are: + // + // * BatchRequestItem#BatchRequestItem_METHOD_GET + // * BatchRequestItem#BatchRequestItem_METHOD_POST + // * BatchRequestItem#BatchRequestItem_METHOD_PUT + // * BatchRequestItem#BatchRequestItem_METHOD_DELETE + // * BatchRequestItem#BatchRequestItem_METHOD_PATCH + // + // http method type + Method *string + // relative uri (path and args), of the call including resource id (if this is a POST/DELETE), exclude hostname and port and prefix, exploded form of parameters + Uri *string +} +const BatchRequestItem_METHOD_GET = "GET" +const BatchRequestItem_METHOD_POST = "POST" +const BatchRequestItem_METHOD_PUT = "PUT" +const BatchRequestItem_METHOD_DELETE = "DELETE" +const BatchRequestItem_METHOD_PATCH = "PATCH" + +func (s BatchRequestItem) GetType__() bindings.BindingType { + return BatchRequestItemBindingType() +} + +func (s BatchRequestItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BatchRequestItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The reponse to a batch operation +type BatchResponse struct { + // Indicates if any of the APIs failed + HasErrors *bool + // Bulk list results + Results []BatchResponseItem + // Optional flag indicating that all items were rolled back even if succeeded initially + RolledBack *bool +} + +func (s BatchResponse) GetType__() bindings.BindingType { + return BatchResponseBindingType() +} + +func (s BatchResponse) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BatchResponse._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A single respose in a list of batched responses +type BatchResponseItem struct { + // object returned by api + Body *data.StructValue + // http status code format: int64 + Code *int64 + // The headers returned by the API call + Headers *data.StructValue +} + +func (s BatchResponseItem) GetType__() bindings.BindingType { + return BatchResponseItemBindingType() +} + +func (s BatchResponseItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BatchResponseItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Bidirectional Forwarding Detection configuration for BGP peers +type BfdProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Time interval between heartbeat packets in milliseconds. format: int32 + Interval *int64 + // Declare dead multiple. Number of times heartbeat packet is missed before BFD declares the neighbor is down. format: int32 + Multiple *int64 +} + +func (s BfdProfile) GetType__() bindings.BindingType { + return BfdProfileBindingType() +} + +func (s BfdProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BfdProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of BfdProfile. +type BfdProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Bfd Profile list results. + Results []BfdProfile +} + +func (s BfdProfileListResult) GetType__() bindings.BindingType { + return BfdProfileListResultBindingType() +} + +func (s BfdProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BfdProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type BgpAddressFamily struct { + // Count of in prefixes format: int64 + InPrefixCount *int64 + // Count of out prefixes format: int64 + OutPrefixCount *int64 + // Possible values are: + // + // * BgpAddressFamily#BgpAddressFamily_TYPE_IPV4_UNICAST + // * BgpAddressFamily#BgpAddressFamily_TYPE_VPNV4_UNICAST + // * BgpAddressFamily#BgpAddressFamily_TYPE_IPV6_UNICAST + // * BgpAddressFamily#BgpAddressFamily_TYPE_L2VPN_EVPN + // + // BGP address family type + Type_ *string +} +const BgpAddressFamily_TYPE_IPV4_UNICAST = "IPV4_UNICAST" +const BgpAddressFamily_TYPE_VPNV4_UNICAST = "VPNV4_UNICAST" +const BgpAddressFamily_TYPE_IPV6_UNICAST = "IPV6_UNICAST" +const BgpAddressFamily_TYPE_L2VPN_EVPN = "L2VPN_EVPN" + +func (s BgpAddressFamily) GetType__() bindings.BindingType { + return BgpAddressFamilyBindingType() +} + +func (s BgpAddressFamily) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpAddressFamily._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// BFD configuration for BGP peers +type BgpBfdConfig struct { + // Flag to enable BFD cofiguration. + Enabled *bool + // Time interval between heartbeat packets in milliseconds. format: int32 + Interval *int64 + // Declare dead multiple. Number of times heartbeat packet is missed before BFD declares the neighbor is down. format: int32 + Multiple *int64 +} + +func (s BgpBfdConfig) GetType__() bindings.BindingType { + return BgpBfdConfigBindingType() +} + +func (s BgpBfdConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpBfdConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Configuration field to hold BGP restart mode and timer. +type BgpGracefulRestartConfig struct { + // Possible values are: + // + // * BgpGracefulRestartConfig#BgpGracefulRestartConfig_MODE_DISABLE + // * BgpGracefulRestartConfig#BgpGracefulRestartConfig_MODE_GR_AND_HELPER + // * BgpGracefulRestartConfig#BgpGracefulRestartConfig_MODE_HELPER_ONLY + // + // If mode is DISABLE, then graceful restart and helper modes are disabled. If mode is GR_AND_HELPER, then both graceful restart and helper modes are enabled. If mode is HELPER_ONLY, then helper mode is enabled. HELPER_ONLY mode is the ability for a BGP speaker to indicate its ability to preserve forwarding state during BGP restart. GRACEFUL_RESTART mode is the ability of a BGP speaker to advertise its restart to its peers. + Mode *string + // Configuration field to hold BGP restart timers. + Timer *BgpGracefulRestartTimer +} +const BgpGracefulRestartConfig_MODE_DISABLE = "DISABLE" +const BgpGracefulRestartConfig_MODE_GR_AND_HELPER = "GR_AND_HELPER" +const BgpGracefulRestartConfig_MODE_HELPER_ONLY = "HELPER_ONLY" + +func (s BgpGracefulRestartConfig) GetType__() bindings.BindingType { + return BgpGracefulRestartConfigBindingType() +} + +func (s BgpGracefulRestartConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpGracefulRestartConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Configuration field to hold BGP restart timers +type BgpGracefulRestartTimer struct { + // Maximum time taken (in seconds) for a BGP session to be established after a restart. This can be used to speed up routing convergence by its peer in case the BGP speaker does not come back up after a restart. If the session is not re-established within this timer, the receiving speaker will delete all the stale routes from that peer. format: int64 + RestartTimer *int64 + // Maximum time (in seconds) before stale routes are removed from the RIB (Routing Information Base) when BGP restarts. format: int64 + StaleRouteTimer *int64 +} + +func (s BgpGracefulRestartTimer) GetType__() bindings.BindingType { + return BgpGracefulRestartTimerBindingType() +} + +func (s BgpGracefulRestartTimer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpGracefulRestartTimer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains information necessary to configure a BGP neighbor. +type BgpNeighborConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Flag to enable allowas_in option for BGP neighbor + AllowAsIn *bool + // BFD configuration for failure detection. BFD is enabled with default values when not configured. + Bfd *BgpBfdConfig + // Possible values are: + // + // * BgpNeighborConfig#BgpNeighborConfig_GRACEFUL_RESTART_MODE_DISABLE + // * BgpNeighborConfig#BgpNeighborConfig_GRACEFUL_RESTART_MODE_GR_AND_HELPER + // * BgpNeighborConfig#BgpNeighborConfig_GRACEFUL_RESTART_MODE_HELPER_ONLY + // + // If mode is DISABLE, then graceful restart and helper modes are disabled. If mode is GR_AND_HELPER, then both graceful restart and helper modes are enabled. If mode is HELPER_ONLY, then helper mode is enabled. HELPER_ONLY mode is the ability for a BGP speaker to indicate its ability to preserve forwarding state during BGP restart. GRACEFUL_RESTART mode is the ability of a BGP speaker to advertise its restart to its peers. + GracefulRestartMode *string + // Wait time in seconds before declaring peer dead. format: int32 + HoldDownTime *int64 + // Specify path of prefix-list or route map to filter routes for IN direction. This property is deprecated, use route_filtering instead. Specifying different values for both properties will result in error. + InRouteFilters []string + // Interval (in seconds) between keep alive messages sent to peer. format: int32 + KeepAliveTime *int64 + // Maximum number of hops allowed to reach BGP neighbor. format: int32 + MaximumHopLimit *int64 + // Neighbor IP Address format: ip + NeighborAddress *string + // Specify path of prefix-list or route map to filter routes for OUT direction. When not specified, a built-in prefix-list named 'prefixlist-out-default' is automatically applied. This property is deprecated, use route_filtering instead. Specifying different values for both properties will result in error. + OutRouteFilters []string + // Specify password for BGP neighbor authentication. Empty string (\"\") clears existing password. + Password *string + // 4 Byte ASN of the neighbor in ASPLAIN Format + RemoteAsNum *string + // Enable address families and route filtering in each direction. + RouteFiltering []BgpRouteFiltering + // Source addresses should belong to Tier0 external or loopback interface IP Addresses . BGP peering is formed from all these addresses. This property is mandatory when maximum_hop_limit is greater than 1. format: ip + SourceAddresses []string +} +const BgpNeighborConfig_GRACEFUL_RESTART_MODE_DISABLE = "DISABLE" +const BgpNeighborConfig_GRACEFUL_RESTART_MODE_GR_AND_HELPER = "GR_AND_HELPER" +const BgpNeighborConfig_GRACEFUL_RESTART_MODE_HELPER_ONLY = "HELPER_ONLY" + +func (s BgpNeighborConfig) GetType__() bindings.BindingType { + return BgpNeighborConfigBindingType() +} + +func (s BgpNeighborConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of BGP Neighbor Configs +type BgpNeighborConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // BGP neighbor configs list results + Results []BgpNeighborConfig +} + +func (s BgpNeighborConfigListResult) GetType__() bindings.BindingType { + return BgpNeighborConfigListResultBindingType() +} + +func (s BgpNeighborConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// BGP neighbor learned/advertised route details. +type BgpNeighborRouteDetailsCsvRecord struct { + // BGP AS path attribute. + AsPath *string + // BGP Local Preference attribute. format: int64 + LocalPref *int64 + // Logical router id + LogicalRouterId *string + // BGP Multi Exit Discriminator attribute. format: int64 + Med *int64 + // BGP neighbor peer IP address. format: ip + NeighborAddress *string + // BGP neighbor id + NeighborId *string + // CIDR network address. format: ip-cidr-block + Network *string + // Next hop IP address. format: ip + NextHop *string + // BGP neighbor source address. format: ip + SourceAddress *string + // Transport node id + TransportNodeId *string + // BGP Weight attribute. format: int64 + Weight *int64 +} + +func (s BgpNeighborRouteDetailsCsvRecord) GetType__() bindings.BindingType { + return BgpNeighborRouteDetailsCsvRecordBindingType() +} + +func (s BgpNeighborRouteDetailsCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborRouteDetailsCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type BgpNeighborRouteDetailsInCsvFormat struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + Results []BgpNeighborRouteDetailsCsvRecord +} + +func (s BgpNeighborRouteDetailsInCsvFormat) GetType__() bindings.BindingType { + return BgpNeighborRouteDetailsInCsvFormatBindingType() +} + +func (s BgpNeighborRouteDetailsInCsvFormat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborRouteDetailsInCsvFormat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// BGP neighbor learned/advertised route details. +type BgpNeighborRoutes struct { + // Array of BGP neighbor route details per edge node. + EgdeNodeRoutes []RoutesPerTransportNode + // Enforcement point policy path + EnforcementPointPath *string + // BGP neighbor policy path + NeighborPath *string +} + +func (s BgpNeighborRoutes) GetType__() bindings.BindingType { + return BgpNeighborRoutesBindingType() +} + +func (s BgpNeighborRoutes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborRoutes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type BgpNeighborRoutesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of Bgp neighbor routes. + Results []BgpNeighborRoutes +} + +func (s BgpNeighborRoutesListResult) GetType__() bindings.BindingType { + return BgpNeighborRoutesListResultBindingType() +} + +func (s BgpNeighborRoutesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborRoutesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Enable address_families and route filtering in each direction +type BgpRouteFiltering struct { + // Possible values are: + // + // * BgpRouteFiltering#BgpRouteFiltering_ADDRESS_FAMILY_IPV4 + // * BgpRouteFiltering#BgpRouteFiltering_ADDRESS_FAMILY_IPV6 + // * BgpRouteFiltering#BgpRouteFiltering_ADDRESS_FAMILY_L2VPN_EVPN + // + // Address family type. If not configured, this property automatically derived for IPv4 & IPv6 peer configuration. + AddressFamily *string + // Flag to enable address family. + Enabled *bool + // Specify path of prefix-list or route map to filter routes for IN direction. + InRouteFilters []string + // Maximum number of routes for the address family. format: int32 + MaximumRoutes *int64 + // Specify path of prefix-list or route map to filter routes for OUT direction. When not specified, a built-in prefix-list named 'prefixlist-out-default' is automatically applied. + OutRouteFilters []string +} +const BgpRouteFiltering_ADDRESS_FAMILY_IPV4 = "IPV4" +const BgpRouteFiltering_ADDRESS_FAMILY_IPV6 = "IPV6" +const BgpRouteFiltering_ADDRESS_FAMILY_L2VPN_EVPN = "L2VPN_EVPN" + +func (s BgpRouteFiltering) GetType__() bindings.BindingType { + return BgpRouteFilteringBindingType() +} + +func (s BgpRouteFiltering) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpRouteFiltering._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains BGP routing configuration. +type BgpRoutingConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Flag to enable ECMP. + Ecmp *bool + // Flag to enable BGP configuration. Disabling will stop feature and BGP peering. + Enabled *bool + // Flag to enable graceful restart. This field is deprecated, please use graceful_restart_config parameter for graceful restart configuration. If both parameters are set and consistent with each other (i.e. graceful_restart=false and graceful_restart_mode=HELPER_ONLY OR graceful_restart=true and graceful_restart_mode=GR_AND_HELPER) then this is allowed, but if inconsistent with each other then this is not allowed and validation error will be thrown. + GracefulRestart *bool + // Configuration field to hold BGP Restart mode and timer. + GracefulRestartConfig *BgpGracefulRestartConfig + // Flag to enable inter SR IBGP configuration. When not specified, inter SR IBGP is automatically enabled if Tier-0 is created in ACTIVE_ACTIVE ha_mode. + InterSrIbgp *bool + // Specify BGP AS number for Tier-0 to advertize to BGP peers. AS number can be specified in ASPLAIN (e.g., \"65546\") or ASDOT (e.g., \"1.10\") format. Empty string disables BGP feature. It is required by normal tier0 but not required in vrf tier0. + LocalAsNum *string + // Flag to enable BGP multipath relax option. + MultipathRelax *bool + // List of routes to be aggregated. + RouteAggregations []RouteAggregationEntry +} + +func (s BgpRoutingConfig) GetType__() bindings.BindingType { + return BgpRoutingConfigBindingType() +} + +func (s BgpRoutingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpRoutingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type BinaryPacketData struct { + // Up to 1000 bytes of payload may be supplied (with a base64-encoded length of 1336 bytes.) Additional bytes of traceflow metadata will be appended to the payload. The payload must contain all headers (Ethernet, IP, etc). Note that VLAN is not supported in the logical space. Hence, payload must not contain 802.1Q headers. + Payload *string + // If the requested frame_size is too small (given the payload and traceflow metadata requirement of 16 bytes), the traceflow request will fail with an appropriate message. The frame will be zero padded to the requested size. format: int64 + FrameSize *int64 + // Possible values are: + // + // * PacketData#PacketData_RESOURCE_TYPE_BINARYPACKETDATA + // * PacketData#PacketData_RESOURCE_TYPE_FIELDSPACKETDATA + // + // Packet configuration + ResourceType string + // A flag, when set true, indicates that the traceflow packet is of L3 routing. + Routed *bool + // Possible values are: + // + // * PacketData#PacketData_TRANSPORT_TYPE_BROADCAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNICAST + // * PacketData#PacketData_TRANSPORT_TYPE_MULTICAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNKNOWN + // + // transport type of the traceflow packet + TransportType *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BinaryPacketData__TYPE_IDENTIFIER = "BinaryPacketData" + +func (s BinaryPacketData) GetType__() bindings.BindingType { + return BinaryPacketDataBindingType() +} + +func (s BinaryPacketData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BinaryPacketData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// configuration parameters for Bridge Profile +type BridgeProfileConfig struct { + // Same bridge profile can be configured on different segments. Each bridge profile on a segment must unique. + BridgeProfilePath *string + // The name of the switching uplink teaming policy for the bridge endpoint. This name corresponds to one fot he switching uplink teaming policy names listed in teh transport zone. When this property is not specified, the teaming policy is assigned by MP. + UplinkTeamingPolicyName *string + // VLAN specification for bridge endpoint. Either VLAN ID or VLAN ranges can be specified. Not both. + VlanIds []string + // VLAN transport zone should belong to the enforcment-point as the transport zone specified in the segment. + VlanTransportZonePath *string +} + +func (s BridgeProfileConfig) GetType__() bindings.BindingType { + return BridgeProfileConfigBindingType() +} + +func (s BridgeProfileConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BridgeProfileConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents an instance of partner's service whose wiring will be done by partner itself. As partner does all the wiring, we call it as Byod - Bring your own device. +type ByodPolicyServiceInstance struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * ByodPolicyServiceInstance#ByodPolicyServiceInstance_DEPLOYMENT_MODE_STAND_ALONE + // * ByodPolicyServiceInstance#ByodPolicyServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY + // + // Deployment mode specifies how the partner appliance will be deployed i.e. in HA or standalone mode. + DeploymentMode *string + // Unique name of Partner Service in the Marketplace + PartnerServiceName *string + // Possible values are: + // + // * ByodPolicyServiceInstance#ByodPolicyServiceInstance_TRANSPORT_TYPE_L2_BRIDGE + // * ByodPolicyServiceInstance#ByodPolicyServiceInstance_TRANSPORT_TYPE_L3_ROUTED + // + // Transport to be used while deploying Service-VM. + TransportType *string +} +const ByodPolicyServiceInstance_DEPLOYMENT_MODE_STAND_ALONE = "STAND_ALONE" +const ByodPolicyServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY = "ACTIVE_STANDBY" +const ByodPolicyServiceInstance_TRANSPORT_TYPE_L2_BRIDGE = "L2_BRIDGE" +const ByodPolicyServiceInstance_TRANSPORT_TYPE_L3_ROUTED = "L3_ROUTED" + +func (s ByodPolicyServiceInstance) GetType__() bindings.BindingType { + return ByodPolicyServiceInstanceBindingType() +} + +func (s ByodPolicyServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ByodPolicyServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for BfdProfile, used in hierarchical API. +type ChildBfdProfile struct { + // Contains the actual BfdProfile object. + BfdProfile *BfdProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildBfdProfile) GetType__() bindings.BindingType { + return ChildBfdProfileBindingType() +} + +func (s ChildBfdProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildBfdProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for BgpNeighborConfig, used in hierarchical API. +type ChildBgpNeighborConfig struct { + // Contains the actual BgpNeighborConfig object. + BgpNeighborConfig *BgpNeighborConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildBgpNeighborConfig) GetType__() bindings.BindingType { + return ChildBgpNeighborConfigBindingType() +} + +func (s ChildBgpNeighborConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildBgpNeighborConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for BgpRoutingConfig, used in hierarchical API. +type ChildBgpRoutingConfig struct { + // Contains the actual BgpRoutingConfig object. + BgpRoutingConfig *BgpRoutingConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildBgpRoutingConfig) GetType__() bindings.BindingType { + return ChildBgpRoutingConfigBindingType() +} + +func (s ChildBgpRoutingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildBgpRoutingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ByodPolicyServiceInstance used in hierarchical API. +type ChildByodPolicyServiceInstance struct { + // Contains actual ByodPolicyServiceInstance. + ByodPolicyServiceInstance *ByodPolicyServiceInstance + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildByodPolicyServiceInstance) GetType__() bindings.BindingType { + return ChildByodPolicyServiceInstanceBindingType() +} + +func (s ChildByodPolicyServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildByodPolicyServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for CommunicationEntry, used in hierarchical API This type is deprecated. Use the type ChildRule instead. +type ChildCommunicationEntry struct { + // Contains the actual CommunicationEntry object. + CommunicationEntry *CommunicationEntry + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildCommunicationEntry) GetType__() bindings.BindingType { + return ChildCommunicationEntryBindingType() +} + +func (s ChildCommunicationEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildCommunicationEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for CommunicationMap, used in hierarchical API This type is deprecated. Use the type ChildSecurityPolicy instead. +type ChildCommunicationMap struct { + // Contains the actual CommunicationMap object. + CommunicationMap *CommunicationMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildCommunicationMap) GetType__() bindings.BindingType { + return ChildCommunicationMapBindingType() +} + +func (s ChildCommunicationMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildCommunicationMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for CommunityList, used in hierarchical API +type ChildCommunityList struct { + // Contains the actual CommunityList object + CommunityList *CommunityList + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildCommunityList) GetType__() bindings.BindingType { + return ChildCommunityListBindingType() +} + +func (s ChildCommunityList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildCommunityList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Wrapper object for ComputeClusterIdfwConfiguration +type ChildComputeClusterIdfwConfiguration struct { + // Contains the actual compute cluster idfw configuration object. + ComputeClusterIdfwConfiguration *ComputeClusterIdfwConfiguration + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildComputeClusterIdfwConfiguration) GetType__() bindings.BindingType { + return ChildComputeClusterIdfwConfigurationBindingType() +} + +func (s ChildComputeClusterIdfwConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildComputeClusterIdfwConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Constraint, used in hierarchical API +type ChildConstraint struct { + // Contains the actual Constraint object + Constraint *Constraint + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildConstraint) GetType__() bindings.BindingType { + return ChildConstraintBindingType() +} + +func (s ChildConstraint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildConstraint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for DeploymentZone, used in hierarchical API +type ChildDeploymentZone struct { + // Contains the actual DeploymentZone object + DeploymentZone *DeploymentZone + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDeploymentZone) GetType__() bindings.BindingType { + return ChildDeploymentZoneBindingType() +} + +func (s ChildDeploymentZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDeploymentZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Wrapper object for FirewallConfiguration +type ChildDfwFirewallConfiguration struct { + // Contains the actual dfw firewall configuration list object. + DfwFirewallConfiguration *DfwFirewallConfiguration + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDfwFirewallConfiguration) GetType__() bindings.BindingType { + return ChildDfwFirewallConfigurationBindingType() +} + +func (s ChildDfwFirewallConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDfwFirewallConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for DhcpRelayConfig, used in hierarchical API +type ChildDhcpRelayConfig struct { + // Contains the actual DhcpRelayConfig object + DhcpRelayConfig *DhcpRelayConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDhcpRelayConfig) GetType__() bindings.BindingType { + return ChildDhcpRelayConfigBindingType() +} + +func (s ChildDhcpRelayConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDhcpRelayConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for DhcpServerConfig, used in hierarchical API +type ChildDhcpServerConfig struct { + // Contains the actual DhcpServerConfig object + DhcpServerConfig *DhcpServerConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDhcpServerConfig) GetType__() bindings.BindingType { + return ChildDhcpServerConfigBindingType() +} + +func (s ChildDhcpServerConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDhcpServerConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for DhcpStaticBindingConfig, used in hierarchical API. +type ChildDhcpStaticBindingConfig struct { + // Contains the actual DhcpStaticBindingConfig object. + DhcpStaticBindingConfig *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDhcpStaticBindingConfig) GetType__() bindings.BindingType { + return ChildDhcpStaticBindingConfigBindingType() +} + +func (s ChildDhcpStaticBindingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDhcpStaticBindingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for DnsSecurityProfile, used in hierarchical API +type ChildDnsSecurityProfile struct { + // Contains the actual DnsSecurityProfile object + DnsSecurityProfile *DnsSecurityProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDnsSecurityProfile) GetType__() bindings.BindingType { + return ChildDnsSecurityProfileBindingType() +} + +func (s ChildDnsSecurityProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDnsSecurityProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper obejct for DnsSecurityProfileBindingMap used in hierarchical API +type ChildDnsSecurityProfileBindingMap struct { + // Contains the actual DnsSecurityProfileBindingMap object + DnsSecurityProfileBindingMap *DnsSecurityProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDnsSecurityProfileBindingMap) GetType__() bindings.BindingType { + return ChildDnsSecurityProfileBindingMapBindingType() +} + +func (s ChildDnsSecurityProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDnsSecurityProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for domain, used in hierarchical API. +type ChildDomain struct { + // Contains the actual domain object. + Domain *Domain + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDomain) GetType__() bindings.BindingType { + return ChildDomainBindingType() +} + +func (s ChildDomain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDomain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for DomainDeploymentMap, used in hierarchical API. +type ChildDomainDeploymentMap struct { + // Contains the actual DomainDeploymentMap object. + DomainDeploymentMap *DomainDeploymentMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildDomainDeploymentMap) GetType__() bindings.BindingType { + return ChildDomainDeploymentMapBindingType() +} + +func (s ChildDomainDeploymentMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildDomainDeploymentMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for EndpointPolicy used in hierarchical API. +type ChildEndpointPolicy struct { + // Contains actual EndpointPolicy. + EndpointPolicy *EndpointPolicy + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildEndpointPolicy) GetType__() bindings.BindingType { + return ChildEndpointPolicyBindingType() +} + +func (s ChildEndpointPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildEndpointPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for EndpointRule used in hierarchical API. +type ChildEndpointRule struct { + // Contains actual EndpointRule. + EndpointRule *EndpointRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildEndpointRule) GetType__() bindings.BindingType { + return ChildEndpointRuleBindingType() +} + +func (s ChildEndpointRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildEndpointRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for EnforcementPoint, used in hierarchical API. +type ChildEnforcementPoint struct { + // Contains the actual Enforcement point object. + EnforcementPoint *EnforcementPoint + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildEnforcementPoint) GetType__() bindings.BindingType { + return ChildEnforcementPointBindingType() +} + +func (s ChildEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for EvpnConfig, used in hierarchical API. +type ChildEvpnConfig struct { + // Contains the actual EvpnConfig object. + EvpnConfig *EvpnConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildEvpnConfig) GetType__() bindings.BindingType { + return ChildEvpnConfigBindingType() +} + +func (s ChildEvpnConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildEvpnConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for EvpnTunnelEndpointConfig, used in hierarchical API. +type ChildEvpnTunnelEndpointConfig struct { + // Contains the actual EvpnTunnelEndpointConfig object. + EvpnTunnelEndpointConfig *EvpnTunnelEndpointConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildEvpnTunnelEndpointConfig) GetType__() bindings.BindingType { + return ChildEvpnTunnelEndpointConfigBindingType() +} + +func (s ChildEvpnTunnelEndpointConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildEvpnTunnelEndpointConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for FirewallIdentityStore, used in hierarchical API. +type ChildFirewallIdentityStore struct { + // Contains the actual FirewallIdentityStore object. + FirewallIdentityStore *FirewallIdentityStore + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildFirewallIdentityStore) GetType__() bindings.BindingType { + return ChildFirewallIdentityStoreBindingType() +} + +func (s ChildFirewallIdentityStore) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildFirewallIdentityStore._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for FloodProtectionProfile, used in hierarchical API +type ChildFloodProtectionProfile struct { + // Contains the actual FloodProtectionProfile object + FloodProtectionProfile *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildFloodProtectionProfile) GetType__() bindings.BindingType { + return ChildFloodProtectionProfileBindingType() +} + +func (s ChildFloodProtectionProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildFloodProtectionProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for FloodProtectionProfileBindingMap, used in hierarchical API +type ChildFloodProtectionProfileBindingMap struct { + // Contains the actual FloodProtectionProfileBindingMap object + FloodProtectionProfileBindingMap *FloodProtectionProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildFloodProtectionProfileBindingMap) GetType__() bindings.BindingType { + return ChildFloodProtectionProfileBindingMapBindingType() +} + +func (s ChildFloodProtectionProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildFloodProtectionProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ForwardingPolicy used in Hierarchical API. +type ChildForwardingPolicy struct { + // Contains actual ForwardingPolicy. + ForwardingPolicy *ForwardingPolicy + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildForwardingPolicy) GetType__() bindings.BindingType { + return ChildForwardingPolicyBindingType() +} + +func (s ChildForwardingPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildForwardingPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ForwardingRule used in Hierarchical API. +type ChildForwardingRule struct { + // Contains actual ForwardingRule. + ForwardingRule *ForwardingRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildForwardingRule) GetType__() bindings.BindingType { + return ChildForwardingRuleBindingType() +} + +func (s ChildForwardingRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildForwardingRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for GatewayPolicy, used in hierarchical API +type ChildGatewayPolicy struct { + // Contains the actual GatewayPolicy object + GatewayPolicy *GatewayPolicy + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildGatewayPolicy) GetType__() bindings.BindingType { + return ChildGatewayPolicyBindingType() +} + +func (s ChildGatewayPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildGatewayPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for GatewayQosProfile, used in hierarchical API. +type ChildGatewayQosProfile struct { + // Contains the actual GatewayQosProfile object. + QosProfile *GatewayQosProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildGatewayQosProfile) GetType__() bindings.BindingType { + return ChildGatewayQosProfileBindingType() +} + +func (s ChildGatewayQosProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildGatewayQosProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for GlobalConfig, used in hierarchical API +type ChildGlobalConfig struct { + // Contains the actual GlobalConfig object. + GlobalConfig *GlobalConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildGlobalConfig) GetType__() bindings.BindingType { + return ChildGlobalConfigBindingType() +} + +func (s ChildGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Global Manager, used in hierarchical API. +type ChildGlobalManager struct { + // Contains the actual Global Manager object. + GlobalManager *GlobalManager + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildGlobalManager) GetType__() bindings.BindingType { + return ChildGlobalManagerBindingType() +} + +func (s ChildGlobalManager) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildGlobalManager._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for group, used in hierarchical API. +type ChildGroup struct { + // Contains the actual group objects. + Group *Group + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildGroup) GetType__() bindings.BindingType { + return ChildGroupBindingType() +} + +func (s ChildGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper obejct for GroupDiscoveryProfileBindingMap used in hierarchical API +type ChildGroupDiscoveryProfileBindingMap struct { + // Contains the actual GroupDiscoveryProfileBindingMap object + GroupDiscoveryProfileBindingMap *GroupDiscoveryProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildGroupDiscoveryProfileBindingMap) GetType__() bindings.BindingType { + return ChildGroupDiscoveryProfileBindingMapBindingType() +} + +func (s ChildGroupDiscoveryProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildGroupDiscoveryProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for GroupMonitoringProfileBindingMap, used in hierarchical API +type ChildGroupMonitoringProfileBindingMap struct { + // Contains the actual GroupMonitoringProfileBindingMap object + GroupMonitoringProfileBindingMap *GroupMonitoringProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildGroupMonitoringProfileBindingMap) GetType__() bindings.BindingType { + return ChildGroupMonitoringProfileBindingMapBindingType() +} + +func (s ChildGroupMonitoringProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildGroupMonitoringProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPDiscoveryProfile, used in hierarchical API +type ChildIPDiscoveryProfile struct { + // Contains the actual IPDiscoveryProfile object + IpDiscoveryProfile *IPDiscoveryProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPDiscoveryProfile) GetType__() bindings.BindingType { + return ChildIPDiscoveryProfileBindingType() +} + +func (s ChildIPDiscoveryProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPDiscoveryProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPFIXDFWCollectorProfile, used in hierarchical API +type ChildIPFIXDFWCollectorProfile struct { + // Contains the actual IPFIXDFWCollectorProfile object + IPFIXDFWCollectorProfile *IPFIXDFWCollectorProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPFIXDFWCollectorProfile) GetType__() bindings.BindingType { + return ChildIPFIXDFWCollectorProfileBindingType() +} + +func (s ChildIPFIXDFWCollectorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPFIXDFWCollectorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPFIXDFWProfile, used in hierarchical API +type ChildIPFIXDFWProfile struct { + // Contains the actual IPFIXDFWProfile object + IPFIXDFWProfile *IPFIXDFWProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPFIXDFWProfile) GetType__() bindings.BindingType { + return ChildIPFIXDFWProfileBindingType() +} + +func (s ChildIPFIXDFWProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPFIXDFWProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPFIXL2CollectorProfile, used in hierarchical API +type ChildIPFIXL2CollectorProfile struct { + // Contains the actual IPFIXL2CollectorProfile object + IPFIXL2CollectorProfile *IPFIXL2CollectorProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPFIXL2CollectorProfile) GetType__() bindings.BindingType { + return ChildIPFIXL2CollectorProfileBindingType() +} + +func (s ChildIPFIXL2CollectorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPFIXL2CollectorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPFIXL2Profile, used in hierarchical API +type ChildIPFIXL2Profile struct { + // Contains the actual IPFIXL2Profile object + IPFIXL2Profile *IPFIXL2Profile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPFIXL2Profile) GetType__() bindings.BindingType { + return ChildIPFIXL2ProfileBindingType() +} + +func (s ChildIPFIXL2Profile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPFIXL2Profile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPSecVpnDpdProfile, used in hierarchical API. +type ChildIPSecVpnDpdProfile struct { + // Contains the actual IPSecVpnDpdProfile object. + IpSecVpnDpdProfile *IPSecVpnDpdProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPSecVpnDpdProfile) GetType__() bindings.BindingType { + return ChildIPSecVpnDpdProfileBindingType() +} + +func (s ChildIPSecVpnDpdProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPSecVpnDpdProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPSecVpnIkeProfile, used in hierarchical API. +type ChildIPSecVpnIkeProfile struct { + // Contains the actual IPSecVpnIkeProfile object. + IpSecVpnIkeProfile *IPSecVpnIkeProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPSecVpnIkeProfile) GetType__() bindings.BindingType { + return ChildIPSecVpnIkeProfileBindingType() +} + +func (s ChildIPSecVpnIkeProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPSecVpnIkeProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPSecVpnLocalEndpoint, used in hierarchical API. +type ChildIPSecVpnLocalEndpoint struct { + // Contains the actual IPSecVpnLocalEndpoint object. + IpSecVpnLocalEndpoint *IPSecVpnLocalEndpoint + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPSecVpnLocalEndpoint) GetType__() bindings.BindingType { + return ChildIPSecVpnLocalEndpointBindingType() +} + +func (s ChildIPSecVpnLocalEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPSecVpnLocalEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPSecVpnService, used in hierarchical API. +type ChildIPSecVpnService struct { + // Contains the actual IPSecVpnService object. + IpSecVpnService *IPSecVpnService + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPSecVpnService) GetType__() bindings.BindingType { + return ChildIPSecVpnServiceBindingType() +} + +func (s ChildIPSecVpnService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPSecVpnService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPSecVpnSession, used in hierarchical API. +type ChildIPSecVpnSession struct { + // Contains the actual IPSecVpnSession object. + IpSecVpnSession *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPSecVpnSession) GetType__() bindings.BindingType { + return ChildIPSecVpnSessionBindingType() +} + +func (s ChildIPSecVpnSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPSecVpnSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IPSecVpnTunnelProfile, used in hierarchical API. +type ChildIPSecVpnTunnelProfile struct { + // Contains the actual IPSecVpnTunnelProfile object + IpSecVpnTunnelProfile *IPSecVpnTunnelProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIPSecVpnTunnelProfile) GetType__() bindings.BindingType { + return ChildIPSecVpnTunnelProfileBindingType() +} + +func (s ChildIPSecVpnTunnelProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIPSecVpnTunnelProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IdsClusterConfig, used in hierarchical API +type ChildIdsClusterConfig struct { + // Contains the IdsClusterConfig object + IdsClusterConfig *IdsClusterConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIdsClusterConfig) GetType__() bindings.BindingType { + return ChildIdsClusterConfigBindingType() +} + +func (s ChildIdsClusterConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIdsClusterConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IdsProfile, used in hierarchical API +type ChildIdsProfile struct { + // Contains the IdsProfile object + IdsProfile *IdsProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIdsProfile) GetType__() bindings.BindingType { + return ChildIdsProfileBindingType() +} + +func (s ChildIdsProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIdsProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IdsRule, used in hierarchical API +type ChildIdsRule struct { + // Contains the IdsRule object + IdsRule *IdsRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIdsRule) GetType__() bindings.BindingType { + return ChildIdsRuleBindingType() +} + +func (s ChildIdsRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIdsRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IdsSecurityPolicy, used in hierarchical API +type ChildIdsSecurityPolicy struct { + // Contains the IdsSecurityPolicy object + IdsSecurityPolicy *IdsSecurityPolicy + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIdsSecurityPolicy) GetType__() bindings.BindingType { + return ChildIdsSecurityPolicyBindingType() +} + +func (s ChildIdsSecurityPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIdsSecurityPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IdsSignature, used in hierarchical API +type ChildIdsSignature struct { + // Contains the IdsSignature object + IdsSignature *IdsSignature + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIdsSignature) GetType__() bindings.BindingType { + return ChildIdsSignatureBindingType() +} + +func (s ChildIdsSignature) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIdsSignature._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IdsStandaloneHostConfig, used in hierarchical API +type ChildIdsStandaloneHostConfig struct { + // Contains the IdsStandaloneHostConfig object + IdsStandaloneHostConfig *IdsStandaloneHostConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIdsStandaloneHostConfig) GetType__() bindings.BindingType { + return ChildIdsStandaloneHostConfigBindingType() +} + +func (s ChildIdsStandaloneHostConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIdsStandaloneHostConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IpAddressAllocation, used in hierarchical API +type ChildIpAddressAllocation struct { + // Contains the actual IpAddressAllocation object + IpAddressAllocation *IpAddressAllocation + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIpAddressAllocation) GetType__() bindings.BindingType { + return ChildIpAddressAllocationBindingType() +} + +func (s ChildIpAddressAllocation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIpAddressAllocation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IpAddressBlock, used in hierarchical API +type ChildIpAddressBlock struct { + // Contains the actual IpAddressBlock object + IpAddressBlock *IpAddressBlock + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIpAddressBlock) GetType__() bindings.BindingType { + return ChildIpAddressBlockBindingType() +} + +func (s ChildIpAddressBlock) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIpAddressBlock._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IpAddressPool, used in hierarchical API +type ChildIpAddressPool struct { + // Contains the actual IpAddressPool object + IpAddressPool *IpAddressPool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIpAddressPool) GetType__() bindings.BindingType { + return ChildIpAddressPoolBindingType() +} + +func (s ChildIpAddressPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIpAddressPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for IpAddressPoolSubnet, used in hierarchical API +type ChildIpAddressPoolSubnet struct { + // Contains the actual IpAddressPoolSubnet object + IpAddressPoolSubnet *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIpAddressPoolSubnet) GetType__() bindings.BindingType { + return ChildIpAddressPoolSubnetBindingType() +} + +func (s ChildIpAddressPoolSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIpAddressPoolSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Ipv6DadProfile, used in hierarchical API +type ChildIpv6DadProfile struct { + // Contains the actual Ipv6DadProfile objects + Ipv6DadProfile *Ipv6DadProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIpv6DadProfile) GetType__() bindings.BindingType { + return ChildIpv6DadProfileBindingType() +} + +func (s ChildIpv6DadProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIpv6DadProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Ipv6NdraProfile, used in hierarchical API +type ChildIpv6NdraProfile struct { + // Contains the actual Ipv6NdraProfile objects + Ipv6NdraProfile *Ipv6NdraProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildIpv6NdraProfile) GetType__() bindings.BindingType { + return ChildIpv6NdraProfileBindingType() +} + +func (s ChildIpv6NdraProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildIpv6NdraProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for L2BridgeEndpointProfile, used in hierarchical API +type ChildL2BridgeEndpointProfile struct { + // Contains the actual L2BridgeEndpointProfile object + L2BridgeEndpointProfile *L2BridgeEndpointProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildL2BridgeEndpointProfile) GetType__() bindings.BindingType { + return ChildL2BridgeEndpointProfileBindingType() +} + +func (s ChildL2BridgeEndpointProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildL2BridgeEndpointProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for L2VPNService, used in hierarchical API. +type ChildL2VPNService struct { + // Contains the actual L2VPNService object. + L2VPNService *L2VPNService + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildL2VPNService) GetType__() bindings.BindingType { + return ChildL2VPNServiceBindingType() +} + +func (s ChildL2VPNService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildL2VPNService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for L2VPNSession, used in hierarchical API. +type ChildL2VPNSession struct { + // Contains the actual L2VPNSession object. + L2VPNSession *L2VPNSession + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildL2VPNSession) GetType__() bindings.BindingType { + return ChildL2VPNSessionBindingType() +} + +func (s ChildL2VPNSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildL2VPNSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for L2Vpn, used in hierarchical API. +type ChildL2Vpn struct { + // Contains the actual L2Vpn object. + L2Vpn *L2Vpn + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildL2Vpn) GetType__() bindings.BindingType { + return ChildL2VpnBindingType() +} + +func (s ChildL2Vpn) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildL2Vpn._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for L2VpnContext, used in hierarchical API. +type ChildL2VpnContext struct { + // Contains the actual L2VpnContext object. + L2VpnContext *L2VpnContext + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildL2VpnContext) GetType__() bindings.BindingType { + return ChildL2VpnContextBindingType() +} + +func (s ChildL2VpnContext) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildL2VpnContext._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for L3Vpn, used in hierarchical API. +type ChildL3Vpn struct { + // Contains the actual L3Vpn object. + L3Vpn *L3Vpn + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildL3Vpn) GetType__() bindings.BindingType { + return ChildL3VpnBindingType() +} + +func (s ChildL3Vpn) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildL3Vpn._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for L3VpnContext, used in hierarchical API. +type ChildL3VpnContext struct { + // Contains the actual L3VpnContext object. + L3VpnContext *L3VpnContext + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildL3VpnContext) GetType__() bindings.BindingType { + return ChildL3VpnContextBindingType() +} + +func (s ChildL3VpnContext) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildL3VpnContext._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for LBAppProfile, used in hierarchical API. +type ChildLBAppProfile struct { + // Contains the actual LBAppProfile object. + LbAppProfile *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLBAppProfile) GetType__() bindings.BindingType { + return ChildLBAppProfileBindingType() +} + +func (s ChildLBAppProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLBAppProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for LBClientSslProfile, used in hierarchical API. +type ChildLBClientSslProfile struct { + // Contains the actual LBClientSslProfile object. + LbClientSslProfile *LBClientSslProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLBClientSslProfile) GetType__() bindings.BindingType { + return ChildLBClientSslProfileBindingType() +} + +func (s ChildLBClientSslProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLBClientSslProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for LBMonitorProfile, used in hierarchical API. +type ChildLBMonitorProfile struct { + // Contains the actual LBMonitorProfile object. + LbMonitorProfile *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLBMonitorProfile) GetType__() bindings.BindingType { + return ChildLBMonitorProfileBindingType() +} + +func (s ChildLBMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLBMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for LBPersistenceProfile, used in hierarchical API. +type ChildLBPersistenceProfile struct { + // Contains the actual LBPersistenceProfile object. + LbPersistenceProfile *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLBPersistenceProfile) GetType__() bindings.BindingType { + return ChildLBPersistenceProfileBindingType() +} + +func (s ChildLBPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLBPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for LBPool, used in hierarchical API. +type ChildLBPool struct { + // Contains the actual LBPool object. + LbPool *LBPool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLBPool) GetType__() bindings.BindingType { + return ChildLBPoolBindingType() +} + +func (s ChildLBPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLBPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for LBServerSslProfile, used in hierarchical API. +type ChildLBServerSslProfile struct { + // Contains the actual LBServerSslProfile object. + LbServerSslProfile *LBServerSslProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLBServerSslProfile) GetType__() bindings.BindingType { + return ChildLBServerSslProfileBindingType() +} + +func (s ChildLBServerSslProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLBServerSslProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for LBService, used in hierarchical API. +type ChildLBService struct { + // Contains the actual LBService object. + LbService *LBService + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLBService) GetType__() bindings.BindingType { + return ChildLBServiceBindingType() +} + +func (s ChildLBService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLBService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for LBVirtualServer, used in hierarchical API. +type ChildLBVirtualServer struct { + // Contains the actual LBVirtualServer object. + LbVirtualServer *LBVirtualServer + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLBVirtualServer) GetType__() bindings.BindingType { + return ChildLBVirtualServerBindingType() +} + +func (s ChildLBVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLBVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for LocaleServices, used in hierarchical API +type ChildLocaleServices struct { + // Contains the actual LocaleServices object + LocaleServices *LocaleServices + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildLocaleServices) GetType__() bindings.BindingType { + return ChildLocaleServicesBindingType() +} + +func (s ChildLocaleServices) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildLocaleServices._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for MacDiscoveryProfile, used in hierarchical API +type ChildMacDiscoveryProfile struct { + // Contains the actual MacDiscoveryProfile object + MacDiscoveryProfile *MacDiscoveryProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildMacDiscoveryProfile) GetType__() bindings.BindingType { + return ChildMacDiscoveryProfileBindingType() +} + +func (s ChildMacDiscoveryProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildMacDiscoveryProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Wrapper object for MetadataProxyConfig +type ChildMetadataProxyConfig struct { + // Contains the actual MetadataProxyConfig object. + MetadataProxyConfig *MetadataProxyConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} + +func (s ChildMetadataProxyConfig) GetType__() bindings.BindingType { + return ChildMetadataProxyConfigBindingType() +} + +func (s ChildMetadataProxyConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildMetadataProxyConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents an object on the desired state +type ChildPolicyConfigResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyConfigResource__TYPE_IDENTIFIER = "ChildPolicyConfigResource" + +func (s ChildPolicyConfigResource) GetType__() bindings.BindingType { + return ChildPolicyConfigResourceBindingType() +} + +func (s ChildPolicyConfigResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyConfigResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyContextProfile, used in hierarchical API +type ChildPolicyContextProfile struct { + // Contains the actual PolicyContextProfile objects + PolicyContextProfile *PolicyContextProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyContextProfile__TYPE_IDENTIFIER = "ChildPolicyContextProfile" + +func (s ChildPolicyContextProfile) GetType__() bindings.BindingType { + return ChildPolicyContextProfileBindingType() +} + +func (s ChildPolicyContextProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyContextProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyDnsForwarder, used in hierarchical API +type ChildPolicyDnsForwarder struct { + // Contains the actual PolicyDnsForwarder object + PolicyDnsForwarder *PolicyDnsForwarder + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyDnsForwarder__TYPE_IDENTIFIER = "ChildPolicyDnsForwarder" + +func (s ChildPolicyDnsForwarder) GetType__() bindings.BindingType { + return ChildPolicyDnsForwarderBindingType() +} + +func (s ChildPolicyDnsForwarder) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyDnsForwarder._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyDnsForwarderZone, used in hierarchical API +type ChildPolicyDnsForwarderZone struct { + // Contains the actual PolicyDnsForwarderZone object + PolicyDnsForwarderZone *PolicyDnsForwarderZone + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyDnsForwarderZone__TYPE_IDENTIFIER = "ChildPolicyDnsForwarderZone" + +func (s ChildPolicyDnsForwarderZone) GetType__() bindings.BindingType { + return ChildPolicyDnsForwarderZoneBindingType() +} + +func (s ChildPolicyDnsForwarderZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyDnsForwarderZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyEdgeCluster, used in hierarchical API. +type ChildPolicyEdgeCluster struct { + // Contains the actual PolicyEdgeCluster object. + PolicyEdgeCluster *PolicyEdgeCluster + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyEdgeCluster__TYPE_IDENTIFIER = "ChildPolicyEdgeCluster" + +func (s ChildPolicyEdgeCluster) GetType__() bindings.BindingType { + return ChildPolicyEdgeClusterBindingType() +} + +func (s ChildPolicyEdgeCluster) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyEdgeCluster._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyEdgeNode, used in hierarchical API. +type ChildPolicyEdgeNode struct { + // Contains the actual PolicyEdgeNode object. + PolicyEdgeNode *PolicyEdgeNode + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyEdgeNode__TYPE_IDENTIFIER = "ChildPolicyEdgeNode" + +func (s ChildPolicyEdgeNode) GetType__() bindings.BindingType { + return ChildPolicyEdgeNodeBindingType() +} + +func (s ChildPolicyEdgeNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyEdgeNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Wrapper object for PolicyExcludeList +type ChildPolicyExcludeList struct { + // Contains the actual policy exclude list object. + PolicyExcludeList *PolicyExcludeList + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyExcludeList__TYPE_IDENTIFIER = "ChildPolicyExcludeList" + +func (s ChildPolicyExcludeList) GetType__() bindings.BindingType { + return ChildPolicyExcludeListBindingType() +} + +func (s ChildPolicyExcludeList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyExcludeList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyFirewallCPUMemThresholdsProfileBindingMap, used in hierarchical API. +type ChildPolicyFirewallCPUMemThresholdsProfileBindingMap struct { + // Contains the actual PolicyFirewallCPUMemThresholdsProfileBindingMap object. + PolicyFirewallCPUMemThresholdsProfileBindingMap *PolicyFirewallCPUMemThresholdsProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyFirewallCPUMemThresholdsProfileBindingMap__TYPE_IDENTIFIER = "ChildPolicyFirewallCPUMemThresholdsProfileBindingMap" + +func (s ChildPolicyFirewallCPUMemThresholdsProfileBindingMap) GetType__() bindings.BindingType { + return ChildPolicyFirewallCPUMemThresholdsProfileBindingMapBindingType() +} + +func (s ChildPolicyFirewallCPUMemThresholdsProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyFirewallCPUMemThresholdsProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyFirewallCpuMemThresholdsProfile, used in hierarchical API. +type ChildPolicyFirewallCpuMemThresholdsProfile struct { + // Contains the actual PolicyFirewallCpuMemThresholdsProfile object + PolicyFirewallCpuMemThresholdsProfile *PolicyFirewallCpuMemThresholdsProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyFirewallCpuMemThresholdsProfile__TYPE_IDENTIFIER = "ChildPolicyFirewallCpuMemThresholdsProfile" + +func (s ChildPolicyFirewallCpuMemThresholdsProfile) GetType__() bindings.BindingType { + return ChildPolicyFirewallCpuMemThresholdsProfileBindingType() +} + +func (s ChildPolicyFirewallCpuMemThresholdsProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyFirewallCpuMemThresholdsProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyFirewallFloodProtectionProfileBindingMap, used in hierarchical API +type ChildPolicyFirewallFloodProtectionProfileBindingMap struct { + // Contains the actual PolicyFirewallFloodProtectionProfileBindingMap object + PolicyFirewallFloodProtectionProfileBindingMap *PolicyFirewallFloodProtectionProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyFirewallFloodProtectionProfileBindingMap__TYPE_IDENTIFIER = "ChildPolicyFirewallFloodProtectionProfileBindingMap" + +func (s ChildPolicyFirewallFloodProtectionProfileBindingMap) GetType__() bindings.BindingType { + return ChildPolicyFirewallFloodProtectionProfileBindingMapBindingType() +} + +func (s ChildPolicyFirewallFloodProtectionProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyFirewallFloodProtectionProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyFirewallScheduler, used in hierarchical API +type ChildPolicyFirewallScheduler struct { + // Contains the actual PolicyFirewallScheduler objects + PolicyFirewallScheduler *PolicyFirewallScheduler + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyFirewallScheduler__TYPE_IDENTIFIER = "ChildPolicyFirewallScheduler" + +func (s ChildPolicyFirewallScheduler) GetType__() bindings.BindingType { + return ChildPolicyFirewallSchedulerBindingType() +} + +func (s ChildPolicyFirewallScheduler) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyFirewallScheduler._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyFirewallSessionTimerProfile, used in hierarchical API +type ChildPolicyFirewallSessionTimerProfile struct { + // Contains the actual PolicyFirewallSessionTimerProfile object + PolicyFirewallSessionTimerProfile *PolicyFirewallSessionTimerProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyFirewallSessionTimerProfile__TYPE_IDENTIFIER = "ChildPolicyFirewallSessionTimerProfile" + +func (s ChildPolicyFirewallSessionTimerProfile) GetType__() bindings.BindingType { + return ChildPolicyFirewallSessionTimerProfileBindingType() +} + +func (s ChildPolicyFirewallSessionTimerProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyFirewallSessionTimerProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyFirewallSessionTimerProfileBindingMap, used in hierarchical API +type ChildPolicyFirewallSessionTimerProfileBindingMap struct { + // Contains the actual PolicyFirewallSessionTimerProfileBindingMap object + PolicyFirewallSessionTimerProfileBindingMap *PolicyFirewallSessionTimerProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyFirewallSessionTimerProfileBindingMap__TYPE_IDENTIFIER = "ChildPolicyFirewallSessionTimerProfileBindingMap" + +func (s ChildPolicyFirewallSessionTimerProfileBindingMap) GetType__() bindings.BindingType { + return ChildPolicyFirewallSessionTimerProfileBindingMapBindingType() +} + +func (s ChildPolicyFirewallSessionTimerProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyFirewallSessionTimerProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyIgmpProfile used in hierarchical API. +type ChildPolicyIgmpProfile struct { + // Contains actual PolicyIgmpProfile. + PolicyIgmpProfile *PolicyIgmpProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyIgmpProfile__TYPE_IDENTIFIER = "ChildPolicyIgmpProfile" + +func (s ChildPolicyIgmpProfile) GetType__() bindings.BindingType { + return ChildPolicyIgmpProfileBindingType() +} + +func (s ChildPolicyIgmpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyIgmpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyLabel, used in hierarchical API +type ChildPolicyLabel struct { + // Contains the actual PolicyLabel object + PolicyLabel *PolicyLabel + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyLabel__TYPE_IDENTIFIER = "ChildPolicyLabel" + +func (s ChildPolicyLabel) GetType__() bindings.BindingType { + return ChildPolicyLabelBindingType() +} + +func (s ChildPolicyLabel) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyLabel._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for PolicyLbMonitorProfile, used in hierarchical API +type ChildPolicyLbMonitorProfile struct { + // Contains the actual PolicyLbMonitorProfile object + PolicyLbMonitorProfile *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyLbMonitorProfile__TYPE_IDENTIFIER = "ChildPolicyLbMonitorProfile" + +func (s ChildPolicyLbMonitorProfile) GetType__() bindings.BindingType { + return ChildPolicyLbMonitorProfileBindingType() +} + +func (s ChildPolicyLbMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyLbMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for PolicyLbPersistenceProfile, used in hierarchical API +type ChildPolicyLbPersistenceProfile struct { + // Contains the actual PolicyLbPersistenceProfile object + PolicyLbPersistenceProfile *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyLbPersistenceProfile__TYPE_IDENTIFIER = "ChildPolicyLbPersistenceProfile" + +func (s ChildPolicyLbPersistenceProfile) GetType__() bindings.BindingType { + return ChildPolicyLbPersistenceProfileBindingType() +} + +func (s ChildPolicyLbPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyLbPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for PolicyLbPoolAccess, used in hierarchical API +type ChildPolicyLbPoolAccess struct { + // Contains the actual PolicyLbPoolAccess object + PolicyLbPoolAccess *PolicyLbPoolAccess + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyLbPoolAccess__TYPE_IDENTIFIER = "ChildPolicyLbPoolAccess" + +func (s ChildPolicyLbPoolAccess) GetType__() bindings.BindingType { + return ChildPolicyLbPoolAccessBindingType() +} + +func (s ChildPolicyLbPoolAccess) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyLbPoolAccess._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for PolicyLbRule, used in hierarchical API +type ChildPolicyLbRule struct { + // Contains the actual PolicyLbRule object + PolicyLbRule *PolicyLbRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyLbRule__TYPE_IDENTIFIER = "ChildPolicyLbRule" + +func (s ChildPolicyLbRule) GetType__() bindings.BindingType { + return ChildPolicyLbRuleBindingType() +} + +func (s ChildPolicyLbRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyLbRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for PolicyLbVirtualServer, used in hierarchical API +type ChildPolicyLbVirtualServer struct { + // Contains the actual PolicyLbVirtualServer object + PolicyLbVirtualServer *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyLbVirtualServer__TYPE_IDENTIFIER = "ChildPolicyLbVirtualServer" + +func (s ChildPolicyLbVirtualServer) GetType__() bindings.BindingType { + return ChildPolicyLbVirtualServerBindingType() +} + +func (s ChildPolicyLbVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyLbVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyMulticastConfig used in hierarchical API. +type ChildPolicyMulticastConfig struct { + // Contains actual PolicyMulticastConfig. + PolicyMulticastConfig *PolicyMulticastConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyMulticastConfig__TYPE_IDENTIFIER = "ChildPolicyMulticastConfig" + +func (s ChildPolicyMulticastConfig) GetType__() bindings.BindingType { + return ChildPolicyMulticastConfigBindingType() +} + +func (s ChildPolicyMulticastConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyMulticastConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyNat, used in hierarchical API +type ChildPolicyNat struct { + // Contains the actual PolicyNAT object + PolicyNat *PolicyNat + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyNat__TYPE_IDENTIFIER = "ChildPolicyNat" + +func (s ChildPolicyNat) GetType__() bindings.BindingType { + return ChildPolicyNatBindingType() +} + +func (s ChildPolicyNat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyNat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyNatRule, used in hierarchical API +type ChildPolicyNatRule struct { + // Contains the actual PolicyNatRule object + PolicyNatRule *PolicyNatRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyNatRule__TYPE_IDENTIFIER = "ChildPolicyNatRule" + +func (s ChildPolicyNatRule) GetType__() bindings.BindingType { + return ChildPolicyNatRuleBindingType() +} + +func (s ChildPolicyNatRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyNatRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyPimProfile used in hierarchical API. +type ChildPolicyPimProfile struct { + // Contains actual PolicyPimProfile. + PolicyPimProfile *PolicyPimProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyPimProfile__TYPE_IDENTIFIER = "ChildPolicyPimProfile" + +func (s ChildPolicyPimProfile) GetType__() bindings.BindingType { + return ChildPolicyPimProfileBindingType() +} + +func (s ChildPolicyPimProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyPimProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyServiceInstance used in hierarchical API. +type ChildPolicyServiceChain struct { + // Contains actual PolicyServiceChain. + PolicyServiceChain *PolicyServiceChain + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyServiceChain__TYPE_IDENTIFIER = "ChildPolicyServiceChain" + +func (s ChildPolicyServiceChain) GetType__() bindings.BindingType { + return ChildPolicyServiceChainBindingType() +} + +func (s ChildPolicyServiceChain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyServiceChain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyServiceInstance used in hierarchical API. +type ChildPolicyServiceInstance struct { + // Contains actual PolicyServiceInstance. + PolicyServiceInstance *PolicyServiceInstance + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyServiceInstance__TYPE_IDENTIFIER = "ChildPolicyServiceInstance" + +func (s ChildPolicyServiceInstance) GetType__() bindings.BindingType { + return ChildPolicyServiceInstanceBindingType() +} + +func (s ChildPolicyServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyServiceProfile used in hierarchical API. +type ChildPolicyServiceProfile struct { + // Contains actual PolicyServiceProfile. + PolicyServiceProfile *PolicyServiceProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyServiceProfile__TYPE_IDENTIFIER = "ChildPolicyServiceProfile" + +func (s ChildPolicyServiceProfile) GetType__() bindings.BindingType { + return ChildPolicyServiceProfileBindingType() +} + +func (s ChildPolicyServiceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyServiceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyTransportZone, used in hierarchical API. +type ChildPolicyTransportZone struct { + // Contains the actual PolicyTransportZone object. + PolicyTransportZone *PolicyTransportZone + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyTransportZone__TYPE_IDENTIFIER = "ChildPolicyTransportZone" + +func (s ChildPolicyTransportZone) GetType__() bindings.BindingType { + return ChildPolicyTransportZoneBindingType() +} + +func (s ChildPolicyTransportZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyTransportZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PolicyUrlCategorizationConfig, used in hierarchical API +type ChildPolicyUrlCategorizationConfig struct { + // Contains the actual PolicyUrlCategorizationConfig object + PolicyUrlCategorizationConfig *PolicyUrlCategorizationConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPolicyUrlCategorizationConfig__TYPE_IDENTIFIER = "ChildPolicyUrlCategorizationConfig" + +func (s ChildPolicyUrlCategorizationConfig) GetType__() bindings.BindingType { + return ChildPolicyUrlCategorizationConfigBindingType() +} + +func (s ChildPolicyUrlCategorizationConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPolicyUrlCategorizationConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PortDiscoveryProfileBindingMap, used in hierarchical API +type ChildPortDiscoveryProfileBindingMap struct { + // Contains the actual PortDiscoveryProfileBindingMap object + PortDiscoveryProfileBindingMap *PortDiscoveryProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPortDiscoveryProfileBindingMap__TYPE_IDENTIFIER = "ChildPortDiscoveryProfileBindingMap" + +func (s ChildPortDiscoveryProfileBindingMap) GetType__() bindings.BindingType { + return ChildPortDiscoveryProfileBindingMapBindingType() +} + +func (s ChildPortDiscoveryProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPortDiscoveryProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PortMirroringProfile, used in hierarchical API +type ChildPortMirroringProfile struct { + // Contains the actual PortMirroringProfile object + PortMirroringProfile *PortMirroringProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPortMirroringProfile__TYPE_IDENTIFIER = "ChildPortMirroringProfile" + +func (s ChildPortMirroringProfile) GetType__() bindings.BindingType { + return ChildPortMirroringProfileBindingType() +} + +func (s ChildPortMirroringProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPortMirroringProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PortMonitoringProfileBindingMap, used in hierarchical API +type ChildPortMonitoringProfileBindingMap struct { + // Contains the actual PortMonitoringProfileBindingMap object + PortMonitoringProfileBindingMap *PortMonitoringProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPortMonitoringProfileBindingMap__TYPE_IDENTIFIER = "ChildPortMonitoringProfileBindingMap" + +func (s ChildPortMonitoringProfileBindingMap) GetType__() bindings.BindingType { + return ChildPortMonitoringProfileBindingMapBindingType() +} + +func (s ChildPortMonitoringProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPortMonitoringProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PortQoSProfileBindingMap, used in hierarchical API +type ChildPortQosProfileBindingMap struct { + // Contains the actual PortQoSProfileBindingMap object + PortQosProfileBindingMap *PortQosProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPortQosProfileBindingMap__TYPE_IDENTIFIER = "ChildPortQoSProfileBindingMap" + +func (s ChildPortQosProfileBindingMap) GetType__() bindings.BindingType { + return ChildPortQosProfileBindingMapBindingType() +} + +func (s ChildPortQosProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPortQosProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PortSecurityProfileBindingMap, used in hierarchical API +type ChildPortSecurityProfileBindingMap struct { + // Contains the actual PortSecurityProfileBindingMap object + PortSecurityProfileBindingMap *PortSecurityProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPortSecurityProfileBindingMap__TYPE_IDENTIFIER = "ChildPortSecurityProfileBindingMap" + +func (s ChildPortSecurityProfileBindingMap) GetType__() bindings.BindingType { + return ChildPortSecurityProfileBindingMapBindingType() +} + +func (s ChildPortSecurityProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPortSecurityProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for PrefixList, used in hierarchical API. +type ChildPrefixList struct { + // Contains the actual PrefixList object. + PrefixList *PrefixList + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildPrefixList__TYPE_IDENTIFIER = "ChildPrefixList" + +func (s ChildPrefixList) GetType__() bindings.BindingType { + return ChildPrefixListBindingType() +} + +func (s ChildPrefixList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildPrefixList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for QoSProfile, used in hierarchical API +type ChildQosProfile struct { + // Contains the actual QoSProfile object + QosProfile *QosProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildQosProfile__TYPE_IDENTIFIER = "ChildQoSProfile" + +func (s ChildQosProfile) GetType__() bindings.BindingType { + return ChildQosProfileBindingType() +} + +func (s ChildQosProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildQosProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Reaction used in hierarchical API. +type ChildReaction struct { + // Contains the actual Reaction object. + Reaction *Reaction + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildReaction__TYPE_IDENTIFIER = "ChildReaction" + +func (s ChildReaction) GetType__() bindings.BindingType { + return ChildReactionBindingType() +} + +func (s ChildReaction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildReaction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for RedirectionPolicy used in Hierarchical API. +type ChildRedirectionPolicy struct { + // Contains actual RedirectionPolicy. + RedirectionPolicy *RedirectionPolicy + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildRedirectionPolicy__TYPE_IDENTIFIER = "ChildRedirectionPolicy" + +func (s ChildRedirectionPolicy) GetType__() bindings.BindingType { + return ChildRedirectionPolicyBindingType() +} + +func (s ChildRedirectionPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildRedirectionPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ChildRedirectionRule used in Hierarchical API. +type ChildRedirectionRule struct { + // Contains actual RedirectionRule. + RedirectionRule *RedirectionRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildRedirectionRule__TYPE_IDENTIFIER = "ChildRedirectionRule" + +func (s ChildRedirectionRule) GetType__() bindings.BindingType { + return ChildRedirectionRuleBindingType() +} + +func (s ChildRedirectionRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildRedirectionRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a reference to ChildPolicyConfigResource in the hierarchical API. resource_type, id and target_type are mandatory fields. +type ChildResourceReference struct { + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // The target type of this reference + TargetType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildResourceReference__TYPE_IDENTIFIER = "ChildResourceReference" + +func (s ChildResourceReference) GetType__() bindings.BindingType { + return ChildResourceReferenceBindingType() +} + +func (s ChildResourceReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildResourceReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Rule, used in hierarchical API +type ChildRule struct { + // Contains the actual Rule object + Rule *Rule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildRule__TYPE_IDENTIFIER = "ChildRule" + +func (s ChildRule) GetType__() bindings.BindingType { + return ChildRuleBindingType() +} + +func (s ChildRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SecurityPolicy, used in hierarchical API +type ChildSecurityPolicy struct { + // Contains the actual SecurityPolicy object + SecurityPolicy *SecurityPolicy + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSecurityPolicy__TYPE_IDENTIFIER = "ChildSecurityPolicy" + +func (s ChildSecurityPolicy) GetType__() bindings.BindingType { + return ChildSecurityPolicyBindingType() +} + +func (s ChildSecurityPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSecurityPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Segment, used in hierarchical API. +type ChildSegment struct { + // Contains the actual Segment object. + Segment *Segment + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSegment__TYPE_IDENTIFIER = "ChildSegment" + +func (s ChildSegment) GetType__() bindings.BindingType { + return ChildSegmentBindingType() +} + +func (s ChildSegment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSegment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SegmentDiscoveryProfileBindingMap, used in hierarchical API +type ChildSegmentDiscoveryProfileBindingMap struct { + // Contains the actual SegmentDiscoveryProfileBindingMap object + SegmentDiscoveryProfileBindingMap *SegmentDiscoveryProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSegmentDiscoveryProfileBindingMap__TYPE_IDENTIFIER = "ChildSegmentDiscoveryProfileBindingMap" + +func (s ChildSegmentDiscoveryProfileBindingMap) GetType__() bindings.BindingType { + return ChildSegmentDiscoveryProfileBindingMapBindingType() +} + +func (s ChildSegmentDiscoveryProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSegmentDiscoveryProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SegmentMonitoringProfileBindingMap, used in hierarchical API +type ChildSegmentMonitoringProfileBindingMap struct { + // Contains the actual SegmentMonitoringProfileBindingMap object + SegmentMonitoringProfileBindingMap *SegmentMonitoringProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSegmentMonitoringProfileBindingMap__TYPE_IDENTIFIER = "ChildSegmentMonitoringProfileBindingMap" + +func (s ChildSegmentMonitoringProfileBindingMap) GetType__() bindings.BindingType { + return ChildSegmentMonitoringProfileBindingMapBindingType() +} + +func (s ChildSegmentMonitoringProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSegmentMonitoringProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SegmentPort, used in hierarchical API +type ChildSegmentPort struct { + // Contains the actual SegmentPort object + SegmentPort *SegmentPort + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSegmentPort__TYPE_IDENTIFIER = "ChildSegmentPort" + +func (s ChildSegmentPort) GetType__() bindings.BindingType { + return ChildSegmentPortBindingType() +} + +func (s ChildSegmentPort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSegmentPort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SegmentQoSProfileBindingMap, used in hierarchical API +type ChildSegmentQosProfileBindingMap struct { + // Contains the actual SegmentQoSProfileBindingMap object + SegmentQosProfileBindingMap *SegmentQosProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSegmentQosProfileBindingMap__TYPE_IDENTIFIER = "ChildSegmentQoSProfileBindingMap" + +func (s ChildSegmentQosProfileBindingMap) GetType__() bindings.BindingType { + return ChildSegmentQosProfileBindingMapBindingType() +} + +func (s ChildSegmentQosProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSegmentQosProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SegmentSecurityProfile, used in hierarchical API +type ChildSegmentSecurityProfile struct { + // Contains the actual SegmentSecurityProfile object + SegmentSecurityProfile *SegmentSecurityProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSegmentSecurityProfile__TYPE_IDENTIFIER = "ChildSegmentSecurityProfile" + +func (s ChildSegmentSecurityProfile) GetType__() bindings.BindingType { + return ChildSegmentSecurityProfileBindingType() +} + +func (s ChildSegmentSecurityProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSegmentSecurityProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SegmentSecurityProfileBindingMap, used in hierarchical API +type ChildSegmentSecurityProfileBindingMap struct { + // Contains the actual SegmentSecurityProfileBindingMap object + SegmentSecurityProfileBindingMap *SegmentSecurityProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSegmentSecurityProfileBindingMap__TYPE_IDENTIFIER = "ChildSegmentSecurityProfileBindingMap" + +func (s ChildSegmentSecurityProfileBindingMap) GetType__() bindings.BindingType { + return ChildSegmentSecurityProfileBindingMapBindingType() +} + +func (s ChildSegmentSecurityProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSegmentSecurityProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Service, used in hierarchical API. +type ChildService struct { + // Contains the actual Service object. + Service *Service + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildService__TYPE_IDENTIFIER = "ChildService" + +func (s ChildService) GetType__() bindings.BindingType { + return ChildServiceBindingType() +} + +func (s ChildService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ServiceEntry, used in hierarchical API. +type ChildServiceEntry struct { + // This is a deprecated property, Please use 'ServiceEntry' instead. + Service *data.StructValue + // Contains the actual ServiceEntry object. + ServiceEntry *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildServiceEntry__TYPE_IDENTIFIER = "ChildServiceEntry" + +func (s ChildServiceEntry) GetType__() bindings.BindingType { + return ChildServiceEntryBindingType() +} + +func (s ChildServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ServiceInstanceEndpoint used in hierarchical API. +type ChildServiceInstanceEndpoint struct { + // Contains actual ServiceInstanceEndpoint. + ServiceInstanceEndpoint *ServiceInstanceEndpoint + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildServiceInstanceEndpoint__TYPE_IDENTIFIER = "ChildServiceInstanceEndpoint" + +func (s ChildServiceInstanceEndpoint) GetType__() bindings.BindingType { + return ChildServiceInstanceEndpointBindingType() +} + +func (s ChildServiceInstanceEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildServiceInstanceEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ServiceInterface, used in hierarchical API. +type ChildServiceInterface struct { + // Contains the actual ServiceInterface object. + ServiceInterface *ServiceInterface + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildServiceInterface__TYPE_IDENTIFIER = "ChildServiceInterface" + +func (s ChildServiceInterface) GetType__() bindings.BindingType { + return ChildServiceInterfaceBindingType() +} + +func (s ChildServiceInterface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildServiceInterface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ServiceReference used in hierarchical API. +type ChildServiceReference struct { + // Contains actual ServiceReference. + ServiceReference *ServiceReference + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildServiceReference__TYPE_IDENTIFIER = "ChildServiceReference" + +func (s ChildServiceReference) GetType__() bindings.BindingType { + return ChildServiceReferenceBindingType() +} + +func (s ChildServiceReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildServiceReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for ServiceSegment, used in hierarchical API +type ChildServiceSegment struct { + // Contains the actual ServiceSegment objects + ServiceSegment *ServiceSegment + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildServiceSegment__TYPE_IDENTIFIER = "ChildServiceSegment" + +func (s ChildServiceSegment) GetType__() bindings.BindingType { + return ChildServiceSegmentBindingType() +} + +func (s ChildServiceSegment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildServiceSegment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SessionTimerProfileBindingMap, used in hierarchical API +type ChildSessionTimerProfileBindingMap struct { + // Contains the actual SessionTimerProfileBindingMap object + SessionTimerProfileBindingMap *SessionTimerProfileBindingMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSessionTimerProfileBindingMap__TYPE_IDENTIFIER = "ChildSessionTimerProfileBindingMap" + +func (s ChildSessionTimerProfileBindingMap) GetType__() bindings.BindingType { + return ChildSessionTimerProfileBindingMapBindingType() +} + +func (s ChildSessionTimerProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSessionTimerProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Site, used in hierarchical API. +type ChildSite struct { + // Contains the actual Site object. + Site *Site + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSite__TYPE_IDENTIFIER = "ChildSite" + +func (s ChildSite) GetType__() bindings.BindingType { + return ChildSiteBindingType() +} + +func (s ChildSite) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSite._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for SpoofGuardProfile, used in hierarchical API +type ChildSpoofGuardProfile struct { + // Contains the actual SpoofGuardProfile object + SpoofGuardProfile *SpoofGuardProfile + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSpoofGuardProfile__TYPE_IDENTIFIER = "ChildSpoofGuardProfile" + +func (s ChildSpoofGuardProfile) GetType__() bindings.BindingType { + return ChildSpoofGuardProfileBindingType() +} + +func (s ChildSpoofGuardProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSpoofGuardProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for SslTrustObjectData, used in hierarchical API +type ChildSslTrustObjectData struct { + // Contains the actual SslTrustObjectData object + SslTrustObjectData *SslTrustObjectData + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildSslTrustObjectData__TYPE_IDENTIFIER = "ChildSslTrustObjectData" + +func (s ChildSslTrustObjectData) GetType__() bindings.BindingType { + return ChildSslTrustObjectDataBindingType() +} + +func (s ChildSslTrustObjectData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildSslTrustObjectData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Wrapper object for StandaloneHostIdfwConfiguration +type ChildStandaloneHostIdfwConfiguration struct { + // Contains the actual standalone host idfw configuration object. + StandaloneHostIdfwConfiguration *StandaloneHostIdfwConfiguration + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildStandaloneHostIdfwConfiguration__TYPE_IDENTIFIER = "ChildStandaloneHostIdfwConfiguration" + +func (s ChildStandaloneHostIdfwConfiguration) GetType__() bindings.BindingType { + return ChildStandaloneHostIdfwConfigurationBindingType() +} + +func (s ChildStandaloneHostIdfwConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildStandaloneHostIdfwConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for StaticARPConfig, used in hierarchical API. +type ChildStaticARPConfig struct { + // Contains the actual StaticARPConfig object. + StaticARPConfig *StaticARPConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildStaticARPConfig__TYPE_IDENTIFIER = "ChildStaticARPConfig" + +func (s ChildStaticARPConfig) GetType__() bindings.BindingType { + return ChildStaticARPConfigBindingType() +} + +func (s ChildStaticARPConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildStaticARPConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for StaticRouteBfdPeer, used in hierarchical API. +type ChildStaticRouteBfdPeer struct { + // Contains the actual StaticRouteBfdPeer object. + BfdPeer *StaticRouteBfdPeer + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildStaticRouteBfdPeer__TYPE_IDENTIFIER = "ChildStaticRouteBfdPeer" + +func (s ChildStaticRouteBfdPeer) GetType__() bindings.BindingType { + return ChildStaticRouteBfdPeerBindingType() +} + +func (s ChildStaticRouteBfdPeer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildStaticRouteBfdPeer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for StaticRoutes, used in hierarchical API. +type ChildStaticRoutes struct { + // Contains the actual StaticRoutes object. + StaticRoutes *StaticRoutes + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildStaticRoutes__TYPE_IDENTIFIER = "ChildStaticRoutes" + +func (s ChildStaticRoutes) GetType__() bindings.BindingType { + return ChildStaticRoutesBindingType() +} + +func (s ChildStaticRoutes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildStaticRoutes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Tier-0, used in hierarchical API. +type ChildTier0 struct { + // Contains the actual Tier-0 object. + Tier0 *Tier0 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTier0__TYPE_IDENTIFIER = "ChildTier0" + +func (s ChildTier0) GetType__() bindings.BindingType { + return ChildTier0BindingType() +} + +func (s ChildTier0) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTier0._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Tier0DeploymentMap, used in hierarchical API. +type ChildTier0DeploymentMap struct { + // Contains the actual Tier0DeploymentMap object. + Tier0DeploymentMap *Tier0DeploymentMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTier0DeploymentMap__TYPE_IDENTIFIER = "ChildTier0DeploymentMap" + +func (s ChildTier0DeploymentMap) GetType__() bindings.BindingType { + return ChildTier0DeploymentMapBindingType() +} + +func (s ChildTier0DeploymentMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTier0DeploymentMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Tier0Interface, used in hierarchical API. +type ChildTier0Interface struct { + // Contains the actual Tier0Interface object. + Tier0Interface *Tier0Interface + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTier0Interface__TYPE_IDENTIFIER = "ChildTier0Interface" + +func (s ChildTier0Interface) GetType__() bindings.BindingType { + return ChildTier0InterfaceBindingType() +} + +func (s ChildTier0Interface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTier0Interface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Tier0RouteMap, used in hierarchical API +type ChildTier0RouteMap struct { + // Contains the actual Tier0RouteMap object + Tier0RouteMap *Tier0RouteMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTier0RouteMap__TYPE_IDENTIFIER = "ChildTier0RouteMap" + +func (s ChildTier0RouteMap) GetType__() bindings.BindingType { + return ChildTier0RouteMapBindingType() +} + +func (s ChildTier0RouteMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTier0RouteMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Tier-1 , used in hierarchical API. +type ChildTier1 struct { + // Contains the actual Tier-1 object. + Tier1 *Tier1 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTier1__TYPE_IDENTIFIER = "ChildTier1" + +func (s ChildTier1) GetType__() bindings.BindingType { + return ChildTier1BindingType() +} + +func (s ChildTier1) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTier1._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Tier1DeploymentMap, used in hierarchical API. +type ChildTier1DeploymentMap struct { + // Contains the actual Tier1DeploymentMap object. + Tier1DeploymentMap *Tier1DeploymentMap + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTier1DeploymentMap__TYPE_IDENTIFIER = "ChildTier1DeploymentMap" + +func (s ChildTier1DeploymentMap) GetType__() bindings.BindingType { + return ChildTier1DeploymentMapBindingType() +} + +func (s ChildTier1DeploymentMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTier1DeploymentMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for Tier1Interface, used in hierarchical API. +type ChildTier1Interface struct { + // Contains the actual Tier1Interface object. + Tier1Interface *Tier1Interface + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTier1Interface__TYPE_IDENTIFIER = "ChildTier1Interface" + +func (s ChildTier1Interface) GetType__() bindings.BindingType { + return ChildTier1InterfaceBindingType() +} + +func (s ChildTier1Interface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTier1Interface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for TlsCertificate, used in hierarchical API. +type ChildTlsCertificate struct { + // Contains the actual TlsCertificate object. + TlsCertificate *TlsCertificate + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTlsCertificate__TYPE_IDENTIFIER = "ChildTlsCertificate" + +func (s ChildTlsCertificate) GetType__() bindings.BindingType { + return ChildTlsCertificateBindingType() +} + +func (s ChildTlsCertificate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTlsCertificate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for TlsCrl, used in hierarchical API. +type ChildTlsCrl struct { + // Contains the actual TlsCrl object. + TlsCrl *TlsCrl + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTlsCrl__TYPE_IDENTIFIER = "ChildTlsCrl" + +func (s ChildTlsCrl) GetType__() bindings.BindingType { + return ChildTlsCrlBindingType() +} + +func (s ChildTlsCrl) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTlsCrl._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for TlsTrustData, used in hierarchical API. +type ChildTlsTrustData struct { + // Contains the actual TlsTrustData object. + TlsTrustData *TlsTrustData + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTlsTrustData__TYPE_IDENTIFIER = "ChildTlsTrustData" + +func (s ChildTlsTrustData) GetType__() bindings.BindingType { + return ChildTlsTrustDataBindingType() +} + +func (s ChildTlsTrustData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTlsTrustData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper for TraceflowConfig, used in hierarchical API +type ChildTraceflowConfig struct { + // Contains the actual TraceflowConfig object. + TraceflowConfig *TraceflowConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildTraceflowConfig__TYPE_IDENTIFIER = "ChildTraceflowConfig" + +func (s ChildTraceflowConfig) GetType__() bindings.BindingType { + return ChildTraceflowConfigBindingType() +} + +func (s ChildTraceflowConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildTraceflowConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for VirtualEndpoint used in hierarchical API. +type ChildVirtualEndpoint struct { + // Contains reference to actual VirtualEndpoint. + VirtualEndpoint *VirtualEndpoint + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildVirtualEndpoint__TYPE_IDENTIFIER = "ChildVirtualEndpoint" + +func (s ChildVirtualEndpoint) GetType__() bindings.BindingType { + return ChildVirtualEndpointBindingType() +} + +func (s ChildVirtualEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildVirtualEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Child wrapper object for VniPoolConfig, used in hierarchical API. +type ChildVniPoolConfig struct { + // Contains the actual VniPoolConfig object. + VniPoolConfig *VniPoolConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If this field is set to true, delete operation is triggered on the intent tree. This resource along with its all children in intent tree will be deleted. This is a cascade delete and should only be used if intent object along with its all children are to be deleted. This does not support deletion of single non-leaf node within the tree and should be used carefully. + MarkedForDelete *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ChildVniPoolConfig__TYPE_IDENTIFIER = "ChildVniPoolConfig" + +func (s ChildVniPoolConfig) GetType__() bindings.BindingType { + return ChildVniPoolConfigBindingType() +} + +func (s ChildVniPoolConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ChildVniPoolConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP classless static route option. +type ClasslessStaticRoute struct { + // Destination network in CIDR format. format: address-or-block-or-range + Network *string + // IP address of next hop of the route. format: ip + NextHop *string +} + +func (s ClasslessStaticRoute) GetType__() bindings.BindingType { + return ClasslessStaticRouteBindingType() +} + +func (s ClasslessStaticRoute) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClasslessStaticRoute._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Stores the information about cloud native service instance. +type CloudNativeServiceInstance struct { + // Id of service instance fetched from public cloud. + ExternalId *string + // Type of cloud native service. + ServiceType *string + // Reference of the public cloud gateway that reported the service instance. + Source *ResourceReference + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s CloudNativeServiceInstance) GetType__() bindings.BindingType { + return CloudNativeServiceInstanceBindingType() +} + +func (s CloudNativeServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CloudNativeServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Cluster backup details +type ClusterBackupInfo struct { + // IP address or FQDN of the node from which the backup was taken format: hostname-or-ip + IpAddress *string + // ID of the node from which the backup was taken + NodeId *string + // Possible values are: + // + // * ClusterBackupInfo#ClusterBackupInfo_RESTORE_TYPE_REGULAR_RESTORE + // * ClusterBackupInfo#ClusterBackupInfo_RESTORE_TYPE_POLICY_ONLY_RESTORE + // + // Type of restore allowed + RestoreType []string + // timestamp of the cluster backup file format: int64 + Timestamp *int64 +} +const ClusterBackupInfo_RESTORE_TYPE_REGULAR_RESTORE = "REGULAR_RESTORE" +const ClusterBackupInfo_RESTORE_TYPE_POLICY_ONLY_RESTORE = "POLICY_ONLY_RESTORE" + +func (s ClusterBackupInfo) GetType__() bindings.BindingType { + return ClusterBackupInfoBindingType() +} + +func (s ClusterBackupInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterBackupInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type ClusterBackupInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of timestamps of backed-up cluster files + Results []ClusterBackupInfo +} + +func (s ClusterBackupInfoListResult) GetType__() bindings.BindingType { + return ClusterBackupInfoListResultBindingType() +} + +func (s ClusterBackupInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterBackupInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Cluster restore status +type ClusterRestoreStatus struct { + // Timestamp when backup was initiated in epoch millisecond format: int64 + BackupTimestamp *int64 + // The list of allowed endpoints, based on the current state of the restore process + Endpoints []ResourceLink + // Unique id for backup request + Id *string + // Instructions for users to reconcile Restore operations + Instructions []InstructionInfo + // Timestamp when restore was completed in epoch millisecond format: int64 + RestoreEndTime *int64 + // Timestamp when restore was started in epoch millisecond format: int64 + RestoreStartTime *int64 + Status *GlobalRestoreStatus + Step *RestoreStep + // Total number of steps in the entire restore process format: int64 + TotalSteps *int64 +} + +func (s ClusterRestoreStatus) GetType__() bindings.BindingType { + return ClusterRestoreStatusBindingType() +} + +func (s ClusterRestoreStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterRestoreStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a column of the Grid +type ColumnItem struct { + // Identifies the column and used for fetching content upon an user click or drilldown. If column identifier is not provided, the column's data will not participate in searches and drilldowns. + ColumnIdentifier *string + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. + DrilldownId *string + // Field from which values of the column will be derived. + Field *string + // If set to true, hides the column + Hidden *bool + // Label of the column. + Label *Label + // Hyperlink of the specified UI page that provides details. If drilldown_id is provided, then navigation cannot be used. + Navigation *string + // Render configuration to be applied, if any. + RenderConfiguration []RenderConfiguration + // If true, the value of the column are sorted in ascending order. Otherwise, in descending order. + SortAscending *bool + // Sorting on column is based on the sort_key. sort_key represents the field in the output data on which sort is requested. + SortKey *string + // Multi-line text to be shown on tooltip while hovering over a cell in the grid. + Tooltip []Tooltip + // Possible values are: + // + // * ColumnItem#ColumnItem_TYPE_STRING + // * ColumnItem#ColumnItem_TYPE_NUMBER + // * ColumnItem#ColumnItem_TYPE_DATE + // + // Data type of the field. + Type_ *string +} +const ColumnItem_TYPE_STRING = "String" +const ColumnItem_TYPE_NUMBER = "Number" +const ColumnItem_TYPE_DATE = "Date" + +func (s ColumnItem) GetType__() bindings.BindingType { + return ColumnItemBindingType() +} + +func (s ColumnItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ColumnItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A communication entry indicates the action to be performed for various types of traffic flowing between workload groups. This type is deprecated. Use the type Rule instead. +type CommunicationEntry struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * CommunicationEntry#CommunicationEntry_ACTION_ALLOW + // * CommunicationEntry#CommunicationEntry_ACTION_DROP + // * CommunicationEntry#CommunicationEntry_ACTION_REJECT + // + // The action to be applied to all the services. + Action *string + // We need paths as duplicate names may exist for groups under different domains.In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + DestinationGroups []string + // Possible values are: + // + // * CommunicationEntry#CommunicationEntry_DIRECTION_IN + // * CommunicationEntry#CommunicationEntry_DIRECTION_OUT + // * CommunicationEntry#CommunicationEntry_DIRECTION_IN_OUT + // + // Define direction of traffic. + Direction *string + // Flag to disable the rule. Default is enabled. + Disabled *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // Text for additional notes on changes. + Notes *string + // The list of policy paths where the communication entry is applied Edge/LR/T0/T1/LRP/CGW/MGW/etc. Note that a given rule can be applied on multiple LRs/LRPs. + Scope []string + // This field is used to resolve conflicts between multiple CommunicationEntries under CommunicationMap for a Domain If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple communication entries with the same sequence number then their order is not deterministic. If a specific order of communication entry is desired, then one has to specify unique sequence numbers or use the POST request on the communication entry entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // In order to specify all services, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the services array. Error will be thrown if ANY is used in conjunction with other values. + Services []string + // We need paths as duplicate names may exist for groups under different domains. In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + SourceGroups []string + // User level field which will be printed in CLI and packet logs. + Tag *string +} +const CommunicationEntry_ACTION_ALLOW = "ALLOW" +const CommunicationEntry_ACTION_DROP = "DROP" +const CommunicationEntry_ACTION_REJECT = "REJECT" +const CommunicationEntry_DIRECTION_IN = "IN" +const CommunicationEntry_DIRECTION_OUT = "OUT" +const CommunicationEntry_DIRECTION_IN_OUT = "IN_OUT" + +func (s CommunicationEntry) GetType__() bindings.BindingType { + return CommunicationEntryBindingType() +} + +func (s CommunicationEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CommunicationEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Ordered list of CommunicationEntries. This object is created by default along with the Domain. This type is deprecated. Use the type SecurityPolicy instead. +type CommunicationMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // - Distributed Firewall - Policy framework for Distributed Firewall provides four pre-defined categories for classifying a communication map. They are \"Emergency\", \"Infrastructure\", \"Environment\" and \"Application\". Amongst the layer 3 communication maps,there is a pre-determined order in which the policy framework manages the priority of these communication maps. Emergency category has the highest priority followed by Infrastructure, Environment and then Application rules. Administrator can choose to categorize a communication map into the above categories or can choose to leave it empty. If empty it will have the least precedence w.r.t the above four layer 3 categories. + Category *string + // CommunicationEntries that are a part of this CommunicationMap + CommunicationEntries []CommunicationEntry + // This field is used to resolve conflicts between communication maps across domains. In order to change the precedence of a communication map one can fire a POST request on the communication map entity with a query parameter action=revise The precedence field will reflect the value of the computed precedence upon execution of the above mentioned POST request. For scenarios where the administrator is using a template to update several communication maps, the only way to set the precedence is to explicitly specify the precedence number for each communication map. If no precedence is specified in the payload, a value of 0 is assigned by default. If there are multiple communication maps with the same precedence then their order is not deterministic. If a specific order of communication map is desired, then one has to specify a unique precedence or use the POST request on the communication map entity with a query parameter action=revise to let the framework assign a precedence format: int32 + Precedence *int64 +} + +func (s CommunicationMap) GetType__() bindings.BindingType { + return CommunicationMapBindingType() +} + +func (s CommunicationMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CommunicationMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Community list for BGP routing configuration +type CommunityList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // List of BGP community entries. Both standard and large communities are supported. Standard community format: aa:nn where aa and nn must be within the range [1 - 65536]. Large BGP Community format: aa:bb:nn where aa (Global Administrator), bb (Local Data Part 1) and nn (Local Data Part 2) must be within the range [1 - 4294967295]. In additon to numbered communites (e.g. 3356:2040), predefined communities (NO_EXPORT, NO_ADVERTISE, NO_EXPORT_SUBCONFED) are supported. + Communities []string +} + +func (s CommunityList) GetType__() bindings.BindingType { + return CommunityListBindingType() +} + +func (s CommunityList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CommunityList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of CommunityLists +type CommunityListListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // CommunityList results + Results []CommunityList +} + +func (s CommunityListListResult) GetType__() bindings.BindingType { + return CommunityListListResultBindingType() +} + +func (s CommunityListListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CommunityListListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Match criteria based on a community list +type CommunityMatchCriteria struct { + // Match criteria specified as a community list path or a regular expression. + Criteria *string + // Possible values are: + // + // * CommunityMatchCriteria#CommunityMatchCriteria_MATCH_OPERATOR_ANY + // * CommunityMatchCriteria#CommunityMatchCriteria_MATCH_OPERATOR_ALL + // * CommunityMatchCriteria#CommunityMatchCriteria_MATCH_OPERATOR_EXACT + // * CommunityMatchCriteria#CommunityMatchCriteria_MATCH_OPERATOR_COMMUNITY_REGEX + // * CommunityMatchCriteria#CommunityMatchCriteria_MATCH_OPERATOR_LARGE_COMMUNITY_REGEX + // + // Match operator for community list entries. Not valid when a regular expression is specified for criteria. + MatchOperator *string +} +const CommunityMatchCriteria_MATCH_OPERATOR_ANY = "MATCH_ANY" +const CommunityMatchCriteria_MATCH_OPERATOR_ALL = "MATCH_ALL" +const CommunityMatchCriteria_MATCH_OPERATOR_EXACT = "MATCH_EXACT" +const CommunityMatchCriteria_MATCH_OPERATOR_COMMUNITY_REGEX = "MATCH_COMMUNITY_REGEX" +const CommunityMatchCriteria_MATCH_OPERATOR_LARGE_COMMUNITY_REGEX = "MATCH_LARGE_COMMUNITY_REGEX" + +func (s CommunityMatchCriteria) GetType__() bindings.BindingType { + return CommunityMatchCriteriaBindingType() +} + +func (s CommunityMatchCriteria) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CommunityMatchCriteria._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Idfw configuration for enable/disable idfw on cluster level. +type ComputeClusterIdfwConfiguration struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If set to true, idfw is enabled for this cluster + ClusterIdfwEnabled *bool + // Contains actual policy resource reference object + Member *PolicyResourceReference +} + +func (s ComputeClusterIdfwConfiguration) GetType__() bindings.BindingType { + return ComputeClusterIdfwConfigurationBindingType() +} + +func (s ComputeClusterIdfwConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeClusterIdfwConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type ComputeCollection struct { + // Local Id of the compute collection in the Compute Manager + CmLocalId *string + // External ID of the ComputeCollection in the source Compute manager, e.g. mo-ref in VC + ExternalId *string + // Id of the compute manager from where this Compute Collection was discovered + OriginId *string + // Key-Value map of additional specific properties of compute collection in the Compute Manager + OriginProperties []KeyValuePair + // ComputeCollection type like VC_Cluster. Here the Compute Manager type prefix would help in differentiating similar named Compute Collection types from different Compute Managers + OriginType *string + // Id of the owner of compute collection in the Compute Manager + OwnerId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s ComputeCollection) GetType__() bindings.BindingType { + return ComputeCollectionBindingType() +} + +func (s ComputeCollection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeCollection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the leaf level condition. Evaluation of the condition expression will be case insensitive. +type Condition struct { + // Possible values are: + // + // * Condition#Condition_KEY_TAG + // * Condition#Condition_KEY_NAME + // * Condition#Condition_KEY_OSNAME + // * Condition#Condition_KEY_COMPUTERNAME + // + // Key + Key *string + // Possible values are: + // + // * Condition#Condition_MEMBER_TYPE_IPSET + // * Condition#Condition_MEMBER_TYPE_VIRTUALMACHINE + // * Condition#Condition_MEMBER_TYPE_LOGICALPORT + // * Condition#Condition_MEMBER_TYPE_LOGICALSWITCH + // * Condition#Condition_MEMBER_TYPE_SEGMENT + // * Condition#Condition_MEMBER_TYPE_SEGMENTPORT + // + // Group member type + MemberType *string + // Possible values are: + // + // * Condition#Condition_OPERATOR_EQUALS + // * Condition#Condition_OPERATOR_CONTAINS + // * Condition#Condition_OPERATOR_STARTSWITH + // * Condition#Condition_OPERATOR_ENDSWITH + // * Condition#Condition_OPERATOR_NOTEQUALS + // + // operator + Operator *string + // Value + Value *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const Condition__TYPE_IDENTIFIER = "Condition" +const Condition_KEY_TAG = "Tag" +const Condition_KEY_NAME = "Name" +const Condition_KEY_OSNAME = "OSName" +const Condition_KEY_COMPUTERNAME = "ComputerName" +const Condition_MEMBER_TYPE_IPSET = "IPSet" +const Condition_MEMBER_TYPE_VIRTUALMACHINE = "VirtualMachine" +const Condition_MEMBER_TYPE_LOGICALPORT = "LogicalPort" +const Condition_MEMBER_TYPE_LOGICALSWITCH = "LogicalSwitch" +const Condition_MEMBER_TYPE_SEGMENT = "Segment" +const Condition_MEMBER_TYPE_SEGMENTPORT = "SegmentPort" +const Condition_OPERATOR_EQUALS = "EQUALS" +const Condition_OPERATOR_CONTAINS = "CONTAINS" +const Condition_OPERATOR_STARTSWITH = "STARTSWITH" +const Condition_OPERATOR_ENDSWITH = "ENDSWITH" +const Condition_OPERATOR_NOTEQUALS = "NOTEQUALS" + +func (s Condition) GetType__() bindings.BindingType { + return ConditionBindingType() +} + +func (s Condition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Condition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the leaf level expression to restrict the target attribute value based on the set of existing values. Generally, used in combination with RelatedAttributeConditionalExpression to constraint the values related to another attribute on the same resource. This object is always used in conjunction with some exression. Example - { \"condition\" : { \"operator\":\"INCLUDES\", \"rhs_value\": [\"/infra/domains/mgw/groups/VCENTER\", \"/infra/domains/mgw/groups/SRM\", \"/infra/domains/mgw/groups/NSX\"], \"value_constraint\": { \"resource_type\": \"ValueConstraintExpression\", \"operator\":\"EXCLUDES\", \"values\":[\"/infra/domains/mgw/groups/VCENTER\", \"/infra/domains/mgw/groups/SRM\", \"/infra/domains/mgw/groups/NSX\"] } } +type ConditionalValueConstraintExpression struct { + // Possible values are: + // + // * ConditionalValueConstraintExpression#ConditionalValueConstraintExpression_OPERATOR_INCLUDES + // * ConditionalValueConstraintExpression#ConditionalValueConstraintExpression_OPERATOR_EXCLUDES + // * ConditionalValueConstraintExpression#ConditionalValueConstraintExpression_OPERATOR_EQUALS + // + // Set operation to constraint values. + Operator *string + // List of values. + RhsValue []string + // Values to apply the conditional constraint on target. + ValueConstraint *ValueConstraintExpression +} +const ConditionalValueConstraintExpression_OPERATOR_INCLUDES = "INCLUDES" +const ConditionalValueConstraintExpression_OPERATOR_EXCLUDES = "EXCLUDES" +const ConditionalValueConstraintExpression_OPERATOR_EQUALS = "EQUALS" + +func (s ConditionalValueConstraintExpression) GetType__() bindings.BindingType { + return ConditionalValueConstraintExpressionBindingType() +} + +func (s ConditionalValueConstraintExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConditionalValueConstraintExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Describes status of configuration of an entity +type ConfigurationState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * ConfigurationState#ConfigurationState_STATE_PENDING + // * ConfigurationState#ConfigurationState_STATE_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_SUCCESS + // * ConfigurationState#ConfigurationState_STATE_FAILED + // * ConfigurationState#ConfigurationState_STATE_PARTIAL_SUCCESS + // * ConfigurationState#ConfigurationState_STATE_ORPHANED + // * ConfigurationState#ConfigurationState_STATE_UNKNOWN + // * ConfigurationState#ConfigurationState_STATE_ERROR + // * ConfigurationState#ConfigurationState_STATE_IN_SYNC + // * ConfigurationState#ConfigurationState_STATE_NOT_AVAILABLE + // * ConfigurationState#ConfigurationState_STATE_VM_DEPLOYMENT_QUEUED + // * ConfigurationState#ConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_VM_DEPLOYMENT_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_VM_POWER_ON_FAILED + // * ConfigurationState#ConfigurationState_STATE_REGISTRATION_PENDING + // * ConfigurationState#ConfigurationState_STATE_NODE_NOT_READY + // * ConfigurationState#ConfigurationState_STATE_NODE_READY + // * ConfigurationState#ConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_VM_POWER_OFF_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_VM_UNDEPLOY_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * ConfigurationState#ConfigurationState_STATE_EDGE_CONFIG_ERROR + // * ConfigurationState#ConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED + // * ConfigurationState#ConfigurationState_STATE_REGISTRATION_FAILED + // * ConfigurationState#ConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * ConfigurationState#ConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * ConfigurationState#ConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * ConfigurationState#ConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * ConfigurationState#ConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * ConfigurationState#ConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR + // * ConfigurationState#ConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * ConfigurationState#ConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * ConfigurationState#ConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * ConfigurationState#ConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * ConfigurationState#ConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationState#ConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationState#ConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationState#ConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * ConfigurationState#ConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * ConfigurationState#ConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * ConfigurationState#ConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME + // * ConfigurationState#ConfigurationState_STATE_TRANSPORT_NODE_READY + // * ConfigurationState#ConfigurationState_STATE_VM_NETWORK_EDIT_PENDING + // * ConfigurationState#ConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * ConfigurationState#ConfigurationState_STATE_MPA_DISCONNECTED + // * ConfigurationState#ConfigurationState_STATE_VM_RENAME_PENDING + // * ConfigurationState#ConfigurationState_STATE_VM_CONFIG_EDIT_PENDING + // * ConfigurationState#ConfigurationState_STATE_VM_NETWORK_EDIT_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_RENAME_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_CONFIG_EDIT_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_CONFIG_DISCREPANCY + // * ConfigurationState#ConfigurationState_STATE_VM_NODE_REFRESH_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * ConfigurationState#ConfigurationState_STATE_REGISTRATION_TIMEDOUT + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string +} +const ConfigurationState_STATE_PENDING = "pending" +const ConfigurationState_STATE_IN_PROGRESS = "in_progress" +const ConfigurationState_STATE_SUCCESS = "success" +const ConfigurationState_STATE_FAILED = "failed" +const ConfigurationState_STATE_PARTIAL_SUCCESS = "partial_success" +const ConfigurationState_STATE_ORPHANED = "orphaned" +const ConfigurationState_STATE_UNKNOWN = "unknown" +const ConfigurationState_STATE_ERROR = "error" +const ConfigurationState_STATE_IN_SYNC = "in_sync" +const ConfigurationState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const ConfigurationState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const ConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const ConfigurationState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const ConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const ConfigurationState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const ConfigurationState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const ConfigurationState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const ConfigurationState_STATE_NODE_READY = "NODE_READY" +const ConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const ConfigurationState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const ConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const ConfigurationState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const ConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const ConfigurationState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const ConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const ConfigurationState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const ConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const ConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const ConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const ConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const ConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const ConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const ConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const ConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const ConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const ConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const ConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const ConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const ConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const ConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const ConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const ConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const ConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const ConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const ConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const ConfigurationState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const ConfigurationState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const ConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const ConfigurationState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const ConfigurationState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const ConfigurationState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const ConfigurationState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const ConfigurationState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const ConfigurationState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const ConfigurationState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const ConfigurationState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const ConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const ConfigurationState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" + +func (s ConfigurationState) GetType__() bindings.BindingType { + return ConfigurationStateBindingType() +} + +func (s ConfigurationState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConfigurationState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Describes status of configuration of an entity +type ConfigurationStateElement struct { + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * ConfigurationStateElement#ConfigurationStateElement_STATE_IN_PROGRESS + // * ConfigurationStateElement#ConfigurationStateElement_STATE_SUCCESS + // * ConfigurationStateElement#ConfigurationStateElement_STATE_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_PARTIAL_SUCCESS + // * ConfigurationStateElement#ConfigurationStateElement_STATE_IN_SYNC + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_DEPLOYMENT_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_POWER_ON_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_POWER_OFF_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_UNDEPLOY_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_EDGE_CONFIG_ERROR + // * ConfigurationStateElement#ConfigurationStateElement_STATE_REGISTRATION_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * ConfigurationStateElement#ConfigurationStateElement_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_NO_PNIC_PREPARED_IN_EDGE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_APPLIANCE_INTERNAL_ERROR + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VTEP_DHCP_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * ConfigurationStateElement#ConfigurationStateElement_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * ConfigurationStateElement#ConfigurationStateElement_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationStateElement#ConfigurationStateElement_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationStateElement#ConfigurationStateElement_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationStateElement#ConfigurationStateElement_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_NO_PNIC_SPECIFIED_IN_TN + // * ConfigurationStateElement#ConfigurationStateElement_STATE_INVALID_PNIC_DEVICE_NAME + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * ConfigurationStateElement#ConfigurationStateElement_STATE_MPA_DISCONNECTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_NETWORK_EDIT_PENDING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_RENAME_PENDING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_CONFIG_EDIT_PENDING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_NETWORK_EDIT_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_RENAME_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_CONFIG_EDIT_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_CONFIG_DISCREPANCY + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_NODE_REFRESH_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_PLACEMENT_REFRESH_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_NOT_AVAILABLE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_REGISTRATION_TIMEDOUT + // * ConfigurationStateElement#ConfigurationStateElement_STATE_PENDING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_ORPHANED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNKNOWN + // * ConfigurationStateElement#ConfigurationStateElement_STATE_ERROR + // + // State of configuration on this sub system + State *string + // URI of backing resource on sub system + SubSystemAddress *string + // Identifier of backing resource on sub system + SubSystemId *string + // Name of backing resource on sub system + SubSystemName *string + // Type of backing resource on sub system + SubSystemType *string +} +const ConfigurationStateElement_STATE_IN_PROGRESS = "in_progress" +const ConfigurationStateElement_STATE_SUCCESS = "success" +const ConfigurationStateElement_STATE_FAILED = "failed" +const ConfigurationStateElement_STATE_PARTIAL_SUCCESS = "partial_success" +const ConfigurationStateElement_STATE_IN_SYNC = "in_sync" +const ConfigurationStateElement_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const ConfigurationStateElement_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const ConfigurationStateElement_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const ConfigurationStateElement_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const ConfigurationStateElement_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const ConfigurationStateElement_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const ConfigurationStateElement_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const ConfigurationStateElement_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const ConfigurationStateElement_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const ConfigurationStateElement_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const ConfigurationStateElement_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const ConfigurationStateElement_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const ConfigurationStateElement_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const ConfigurationStateElement_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const ConfigurationStateElement_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const ConfigurationStateElement_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationStateElement_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationStateElement_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationStateElement_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const ConfigurationStateElement_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const ConfigurationStateElement_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const ConfigurationStateElement_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const ConfigurationStateElement_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const ConfigurationStateElement_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const ConfigurationStateElement_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const ConfigurationStateElement_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const ConfigurationStateElement_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const ConfigurationStateElement_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const ConfigurationStateElement_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const ConfigurationStateElement_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const ConfigurationStateElement_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const ConfigurationStateElement_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const ConfigurationStateElement_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const ConfigurationStateElement_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const ConfigurationStateElement_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const ConfigurationStateElement_STATE_PENDING = "pending" +const ConfigurationStateElement_STATE_ORPHANED = "orphaned" +const ConfigurationStateElement_STATE_UNKNOWN = "unknown" +const ConfigurationStateElement_STATE_ERROR = "error" + +func (s ConfigurationStateElement) GetType__() bindings.BindingType { + return ConfigurationStateElementBindingType() +} + +func (s ConfigurationStateElement) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConfigurationStateElement._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the operators AND or OR. +type ConjunctionOperator struct { + // Possible values are: + // + // * ConjunctionOperator#ConjunctionOperator_CONJUNCTION_OPERATOR_OR + // * ConjunctionOperator#ConjunctionOperator_CONJUNCTION_OPERATOR_AND + // + // Conjunction Operator Node + ConjunctionOperator *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ConjunctionOperator__TYPE_IDENTIFIER = "ConjunctionOperator" +const ConjunctionOperator_CONJUNCTION_OPERATOR_OR = "OR" +const ConjunctionOperator_CONJUNCTION_OPERATOR_AND = "AND" + +func (s ConjunctionOperator) GetType__() bindings.BindingType { + return ConjunctionOperatorBindingType() +} + +func (s ConjunctionOperator) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConjunctionOperator._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Advanced configuration for Policy connectivity +type ConnectivityAdvancedConfig struct { + // Possible values are: + // + // * ConnectivityAdvancedConfig#ConnectivityAdvancedConfig_CONNECTIVITY_ON + // * ConnectivityAdvancedConfig#ConnectivityAdvancedConfig_CONNECTIVITY_OFF + // + // Connectivity configuration to manually connect (ON) or disconnect (OFF) a logical entity from network topology. Only valid for Tier1 Segment. + Connectivity *string +} +const ConnectivityAdvancedConfig_CONNECTIVITY_ON = "ON" +const ConnectivityAdvancedConfig_CONNECTIVITY_OFF = "OFF" + +func (s ConnectivityAdvancedConfig) GetType__() bindings.BindingType { + return ConnectivityAdvancedConfigBindingType() +} + +func (s ConnectivityAdvancedConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConnectivityAdvancedConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Consolidated Realized Status of an intent object across enforcement points. +type ConsolidatedRealizedStatus struct { + // Intent path of object, forward slashes must be escaped using %2F. + IntentPath *string + // Consolidated Realized Status across enforcement points. + ConsolidatedStatus *ConsolidatedStatus + // List of Consolidated Realized Status per enforcement point. + ConsolidatedStatusPerEnforcementPoint []ConsolidatedStatusPerEnforcementPoint +} + +func (s ConsolidatedRealizedStatus) GetType__() bindings.BindingType { + return ConsolidatedRealizedStatusBindingType() +} + +func (s ConsolidatedRealizedStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConsolidatedRealizedStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Consolidated Status of an intent object. Status Consolidation of an intent happens at multiple levels: - Per Enforcement Point: calculation of the consolidated status is performed using all realized entities that the intent objet maps to on a specific enforcement point. - Across Enforcement Points: calculation of the consolidated status is performend aggregating the consolidated status from each enforcement point. +type ConsolidatedStatus struct { + // Possible values are: + // + // * ConsolidatedStatus#ConsolidatedStatus_CONSOLIDATED_STATUS_SUCCESS + // * ConsolidatedStatus#ConsolidatedStatus_CONSOLIDATED_STATUS_IN_PROGRESS + // * ConsolidatedStatus#ConsolidatedStatus_CONSOLIDATED_STATUS_ERROR + // * ConsolidatedStatus#ConsolidatedStatus_CONSOLIDATED_STATUS_UNKNOWN + // * ConsolidatedStatus#ConsolidatedStatus_CONSOLIDATED_STATUS_UNINITIALIZED + // + // Consolidated Realized Status of an intent object. + ConsolidatedStatus *string +} +const ConsolidatedStatus_CONSOLIDATED_STATUS_SUCCESS = "SUCCESS" +const ConsolidatedStatus_CONSOLIDATED_STATUS_IN_PROGRESS = "IN_PROGRESS" +const ConsolidatedStatus_CONSOLIDATED_STATUS_ERROR = "ERROR" +const ConsolidatedStatus_CONSOLIDATED_STATUS_UNKNOWN = "UNKNOWN" +const ConsolidatedStatus_CONSOLIDATED_STATUS_UNINITIALIZED = "UNINITIALIZED" + +func (s ConsolidatedStatus) GetType__() bindings.BindingType { + return ConsolidatedStatusBindingType() +} + +func (s ConsolidatedStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConsolidatedStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed Realized Status of an intent object on an NSX-T type of enforcement point. +type ConsolidatedStatusNsxt struct { + // Detailed Realized Status inherent to an NSX-T Enforcement Point. + EnforcedStatus *EnforcedStatusDetailsNsxt + // Alarm information details. + Alarm *PolicyRuntimeAlarm + // Policy Path referencing the enforcement point where the info is fetched. + EnforcementPointPath *string + // Consolidated Realized Status of an Intent object per enforcement point. + ConsolidatedStatus *ConsolidatedStatus + // Enforcement Point Id. + EnforcementPointId *string + ResourceType string + // The site where this enforcement point resides. + SitePath *string +} + +func (s ConsolidatedStatusNsxt) GetType__() bindings.BindingType { + return ConsolidatedStatusNsxtBindingType() +} + +func (s ConsolidatedStatusNsxt) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConsolidatedStatusNsxt._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Consolidated Realized Status Per Enforcement Point. +type ConsolidatedStatusPerEnforcementPoint struct { + // Alarm information details. + Alarm *PolicyRuntimeAlarm + // Policy Path referencing the enforcement point where the info is fetched. + EnforcementPointPath *string + // Consolidated Realized Status of an Intent object per enforcement point. + ConsolidatedStatus *ConsolidatedStatus + // Enforcement Point Id. + EnforcementPointId *string + ResourceType string + // The site where this enforcement point resides. + SitePath *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ConsolidatedStatusPerEnforcementPoint__TYPE_IDENTIFIER = "ConsolidatedStatusPerEnforcementPoint" + +func (s ConsolidatedStatusPerEnforcementPoint) GetType__() bindings.BindingType { + return ConsolidatedStatusPerEnforcementPointBindingType() +} + +func (s ConsolidatedStatusPerEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConsolidatedStatusPerEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Constant Field Value. +type ConstantFieldValue struct { + // Constant Value that the field must be set to. + Constant *data.StructValue + // Possible values are: + // + // * FieldSettingValue#FieldSettingValue_RESOURCE_TYPE_CONSTANTFIELDVALUE + // + // Field Setting Value resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ConstantFieldValue__TYPE_IDENTIFIER = "ConstantFieldValue" + +func (s ConstantFieldValue) GetType__() bindings.BindingType { + return ConstantFieldValueBindingType() +} + +func (s ConstantFieldValue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConstantFieldValue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Constraint object to constraint any attribute on a resource based on specified expression. Example- Restrict the allowed services in Edge Communication Entry to list of services, if the destinationGroups contain vCenter. { \"target\":{ \"target_resource_type\":\"CommunicationEntry\", \"attribute\":\"services\", \"path_prefix\":\"/infra/domains/vmc-domain/edge-communication-maps/default/communication-entries\" } \"constraint_expression\":{ \"related_attribute\":{ \"attribute\":\"destinationGroups\" } \"condition\":{ \"operator\":\"INCLUDES\", \"rhs_value\":{\"vCenter\"} \"value_constraint\":{ \"operator\":\"ALLOW\", \"values\":{\"/ref/services/HTTPS\", \"/ref/services/HTTOP\", ...} } } } } +type Constraint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Expression to constrain the target attribute value. + ConstraintExpression *data.StructValue + // User friendly message to be shown to users upon violation. + Message *string + // Target resource attribute details. + Target *ConstraintTarget +} + +func (s Constraint) GetType__() bindings.BindingType { + return ConstraintBindingType() +} + +func (s Constraint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Constraint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// All the types of the expression extend from this abstract class. This is present for extensibility. +type ConstraintExpression struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_VALUECONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_RELATEDATTRIBUTECONDITIONALEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_ENTITYINSTANCECOUNTCONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_FIELDSANITYCONSTRAINTEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ConstraintExpression__TYPE_IDENTIFIER = "ConstraintExpression" +const ConstraintExpression_RESOURCE_TYPE_VALUECONSTRAINTEXPRESSION = "ValueConstraintExpression" +const ConstraintExpression_RESOURCE_TYPE_RELATEDATTRIBUTECONDITIONALEXPRESSION = "RelatedAttributeConditionalExpression" +const ConstraintExpression_RESOURCE_TYPE_ENTITYINSTANCECOUNTCONSTRAINTEXPRESSION = "EntityInstanceCountConstraintExpression" +const ConstraintExpression_RESOURCE_TYPE_FIELDSANITYCONSTRAINTEXPRESSION = "FieldSanityConstraintExpression" + +func (s ConstraintExpression) GetType__() bindings.BindingType { + return ConstraintExpressionBindingType() +} + +func (s ConstraintExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConstraintExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Constraints +type ConstraintListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Constraint list results + Results []Constraint +} + +func (s ConstraintListResult) GetType__() bindings.BindingType { + return ConstraintListResultBindingType() +} + +func (s ConstraintListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConstraintListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Resource attribute on which constraint should be applied. Example - sourceGroups attribute of Edge CommunicationEntry to be restricted, is given as: { \"target_resource_type\":\"CommunicationEntry\", \"attribute\":\"sourceGroups\", \"path_prefix\":\"/infra/domains/vmc-domain/edge-communication-maps/default/communication-entries\" } +type ConstraintTarget struct { + // Attribute name of the target entity. + Attribute *string + // Path prefix of the entity to apply constraint. This is required to further disambiguiate if multiple policy entities share the same resource type. Example - Edge FW and DFW use the same resource type CommunicationMap, CommunicationEntry, Group, etc. + PathPrefix *string + // Resource type of the target entity. + TargetResourceType *string +} + +func (s ConstraintTarget) GetType__() bindings.BindingType { + return ConstraintTargetBindingType() +} + +func (s ConstraintTarget) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConstraintTarget._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Container application within a project. +type ContainerApplication struct { + // Identifier of the container cluster this container application belongs to. + ContainerClusterId *string + // Identifier of the project which this container application belongs to. + ContainerProjectId *string + // Identifier of the container application on container cluster e.g. PCF app id, k8s service id. + ExternalId *string + // List of network errors related to container application. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerApplication#ContainerApplication_NETWORK_STATUS_HEALTHY + // * ContainerApplication#ContainerApplication_NETWORK_STATUS_UNHEALTHY + // + // Network status of container application. + NetworkStatus *string + // Array of additional specific properties of container application in key-value format. + OriginProperties []KeyValuePair + // Possible values are: + // + // * ContainerApplication#ContainerApplication_STATUS_UNKNOWN + // * ContainerApplication#ContainerApplication_STATUS_HEALTHY + // * ContainerApplication#ContainerApplication_STATUS_UP + // * ContainerApplication#ContainerApplication_STATUS_DOWN + // * ContainerApplication#ContainerApplication_STATUS_DEGRADED + // + // Status of the container application. + Status *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerApplication__TYPE_IDENTIFIER = "ContainerApplication" +const ContainerApplication_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerApplication_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" +const ContainerApplication_STATUS_UNKNOWN = "UNKNOWN" +const ContainerApplication_STATUS_HEALTHY = "HEALTHY" +const ContainerApplication_STATUS_UP = "UP" +const ContainerApplication_STATUS_DOWN = "DOWN" +const ContainerApplication_STATUS_DEGRADED = "DEGRADED" + +func (s ContainerApplication) GetType__() bindings.BindingType { + return ContainerApplicationBindingType() +} + +func (s ContainerApplication) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerApplication._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Container application instance within a project. +type ContainerApplicationInstance struct { + // Cluster node id where application instance is running. + ClusterNodeId *string + // List of identifiers of the container application. + ContainerApplicationIds []string + // Identifier of the container cluster this application instance belongs to. + ContainerClusterId *string + // Identifier of the container project which this container application instance belongs to. + ContainerProjectId *string + // Identifier of the container application instance on container cluster. + ExternalId *string + // List of network errors related to container application instance. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerApplicationInstance#ContainerApplicationInstance_NETWORK_STATUS_HEALTHY + // * ContainerApplicationInstance#ContainerApplicationInstance_NETWORK_STATUS_UNHEALTHY + // + // Network status of container application instance. + NetworkStatus *string + // Array of additional specific properties of container application instance in key-value format. + OriginProperties []KeyValuePair + // Possible values are: + // + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_UNKNOWN + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_HEALTHY + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_UP + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_DOWN + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_DEGRADED + // + // Status of the container application instance. + Status *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerApplicationInstance__TYPE_IDENTIFIER = "ContainerApplicationInstance" +const ContainerApplicationInstance_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerApplicationInstance_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" +const ContainerApplicationInstance_STATUS_UNKNOWN = "UNKNOWN" +const ContainerApplicationInstance_STATUS_HEALTHY = "HEALTHY" +const ContainerApplicationInstance_STATUS_UP = "UP" +const ContainerApplicationInstance_STATUS_DOWN = "DOWN" +const ContainerApplicationInstance_STATUS_DEGRADED = "DEGRADED" + +func (s ContainerApplicationInstance) GetType__() bindings.BindingType { + return ContainerApplicationInstanceBindingType() +} + +func (s ContainerApplicationInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerApplicationInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Details of container cluster. +type ContainerCluster struct { + // Possible values are: + // + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_PAS + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_PKS + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_KUBERNETES + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_OPENSHIFT + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_WCP + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_WCP_GUEST + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_OTHER + // + // Type of the container cluster. In case of creating container cluster first time, it is expected to pass the valid cluster-type. In case of update, if there is no change in cluster-type, then this field can be omitted in the request. + ClusterType *string + // External identifier of the container cluster. + ExternalId *string + // Details of underlying infrastructure that hosts the container cluster. In case of creating container cluster first time, it is expected to pass the valid infrastructure. In case of update, if there is no change in cluster-type, then this field can be omitted in the request. + Infrastructure *ContainerInfrastructureInfo + // List of network errors related to container cluster. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerCluster#ContainerCluster_NETWORK_STATUS_HEALTHY + // * ContainerCluster#ContainerCluster_NETWORK_STATUS_UNHEALTHY + // + // Network status of container cluster. + NetworkStatus *string + // Array of additional specific properties of container cluster in key-value format. + OriginProperties []KeyValuePair + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerCluster__TYPE_IDENTIFIER = "ContainerCluster" +const ContainerCluster_CLUSTER_TYPE_PAS = "PAS" +const ContainerCluster_CLUSTER_TYPE_PKS = "PKS" +const ContainerCluster_CLUSTER_TYPE_KUBERNETES = "Kubernetes" +const ContainerCluster_CLUSTER_TYPE_OPENSHIFT = "Openshift" +const ContainerCluster_CLUSTER_TYPE_WCP = "WCP" +const ContainerCluster_CLUSTER_TYPE_WCP_GUEST = "WCP_Guest" +const ContainerCluster_CLUSTER_TYPE_OTHER = "Other" +const ContainerCluster_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerCluster_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" + +func (s ContainerCluster) GetType__() bindings.BindingType { + return ContainerClusterBindingType() +} + +func (s ContainerCluster) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerCluster._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Details of container cluster node i.e. container host. +type ContainerClusterNode struct { + // External identifier of the container cluster. + ContainerClusterId *string + // External identifier of the container cluster node in K8S/PAS. + ExternalId *string + // List of IP addresses of container cluster node. format: ip + IpAddresses []string + // List of network errors related to container cluster node. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerClusterNode#ContainerClusterNode_NETWORK_STATUS_HEALTHY + // * ContainerClusterNode#ContainerClusterNode_NETWORK_STATUS_UNHEALTHY + // + // Network status of container cluster node. + NetworkStatus *string + // Array of additional specific properties of container cluster node in key-value format. + OriginProperties []KeyValuePair + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerClusterNode__TYPE_IDENTIFIER = "ContainerClusterNode" +const ContainerClusterNode_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerClusterNode_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" + +func (s ContainerClusterNode) GetType__() bindings.BindingType { + return ContainerClusterNodeBindingType() +} + +func (s ContainerClusterNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerClusterNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a container to group widgets that belong to a common category or have a common purpose. +type ContainerConfiguration struct { + Header *Header + // Labels for the container. + Labels []Label + // Layout of widgets can be either vertical or horizontal. If layout is not specified a default horizontal layout is applied. + Layout *Layout + // Hyperlink of the specified UI page that provides details. + Navigation *string + // If not specified, creates an empty container. + Widgets []WidgetItem + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerConfiguration__TYPE_IDENTIFIER = "ContainerConfiguration" + +func (s ContainerConfiguration) GetType__() bindings.BindingType { + return ContainerConfigurationBindingType() +} + +func (s ContainerConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Details of infrastructure hosting the container cluster e.g. vSphere, AWS, VMC etc.. +type ContainerInfrastructureInfo struct { + // Possible values are: + // + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_VSPHERE + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_AWS + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_AZURE + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_VMC + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_KVM + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_BAREMETAL + // + // Type of the infrastructure. + InfraType *string +} +const ContainerInfrastructureInfo_INFRA_TYPE_VSPHERE = "vSphere" +const ContainerInfrastructureInfo_INFRA_TYPE_AWS = "AWS" +const ContainerInfrastructureInfo_INFRA_TYPE_AZURE = "Azure" +const ContainerInfrastructureInfo_INFRA_TYPE_VMC = "VMC" +const ContainerInfrastructureInfo_INFRA_TYPE_KVM = "KVM" +const ContainerInfrastructureInfo_INFRA_TYPE_BAREMETAL = "Baremetal" + +func (s ContainerInfrastructureInfo) GetType__() bindings.BindingType { + return ContainerInfrastructureInfoBindingType() +} + +func (s ContainerInfrastructureInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerInfrastructureInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Details of Container Ingress Policy. +type ContainerIngressPolicy struct { + // List of identifiers of the container application , on which ingress policy is applied. e.g. IDs of all services on which the ingress is applied in kubernetes. + ContainerApplicationIds []string + // Identifier of the container cluster this ingress policy belongs to. + ContainerClusterId *string + // Identifier of the project which this container ingress belongs to. + ContainerProjectId *string + // Identifier of the container ingress policy. + ExternalId *string + // List of network errors related to container ingress. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerIngressPolicy#ContainerIngressPolicy_NETWORK_STATUS_HEALTHY + // * ContainerIngressPolicy#ContainerIngressPolicy_NETWORK_STATUS_UNHEALTHY + // + // Network status of container ingress. + NetworkStatus *string + // Array of additional specific properties of container ingress in key-value format. + OriginProperties []KeyValuePair + // Container ingress policy specification. + Spec *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerIngressPolicy__TYPE_IDENTIFIER = "ContainerIngressPolicy" +const ContainerIngressPolicy_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerIngressPolicy_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" + +func (s ContainerIngressPolicy) GetType__() bindings.BindingType { + return ContainerIngressPolicyBindingType() +} + +func (s ContainerIngressPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerIngressPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Network policy applied to container. +type ContainerNetworkPolicy struct { + // Identifier of the container cluster this network policy belongs to. + ContainerClusterId *string + // Identifier of the project which this network policy belongs to. + ContainerProjectId *string + // Identifier of the container network policy. + ExternalId *string + // List of network errors related to container network policy. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerNetworkPolicy#ContainerNetworkPolicy_NETWORK_STATUS_HEALTHY + // * ContainerNetworkPolicy#ContainerNetworkPolicy_NETWORK_STATUS_UNHEALTHY + // + // Network status of container network policy. + NetworkStatus *string + // Array of additional specific properties of container network policy in key-value format. + OriginProperties []KeyValuePair + // Possible values are: + // + // * ContainerNetworkPolicy#ContainerNetworkPolicy_POLICY_TYPE_NETWORK_POLICY + // * ContainerNetworkPolicy#ContainerNetworkPolicy_POLICY_TYPE_ASG + // + // Type e.g. Network Policy, ASG. + PolicyType *string + // Container network policy specification. + Spec *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerNetworkPolicy__TYPE_IDENTIFIER = "ContainerNetworkPolicy" +const ContainerNetworkPolicy_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerNetworkPolicy_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" +const ContainerNetworkPolicy_POLICY_TYPE_NETWORK_POLICY = "NETWORK_POLICY" +const ContainerNetworkPolicy_POLICY_TYPE_ASG = "ASG" + +func (s ContainerNetworkPolicy) GetType__() bindings.BindingType { + return ContainerNetworkPolicyBindingType() +} + +func (s ContainerNetworkPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerNetworkPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Details of org/namespace within a container cluster. +type ContainerProject struct { + // Identifier of the container cluster to which this project/namespace belongs. + ContainerClusterId *string + // External identifier of the container project. + ExternalId *string + // List of network errors related to container project. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerProject#ContainerProject_NETWORK_STATUS_HEALTHY + // * ContainerProject#ContainerProject_NETWORK_STATUS_UNHEALTHY + // + // Network status of container project. + NetworkStatus *string + // Array of additional specific properties of container project in key-value format. + OriginProperties []KeyValuePair + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerProject__TYPE_IDENTIFIER = "ContainerProject" +const ContainerProject_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerProject_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" + +func (s ContainerProject) GetType__() bindings.BindingType { + return ContainerProjectBindingType() +} + +func (s ContainerProject) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerProject._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Event Criterion is the logical evaluations by which the event may be deemed fulfilled. All the evaluations must be met in order for the criterion to be met (implicit AND). +type Criterion struct { + // Criterion Evaluations. + Evaluations []*data.StructValue +} + +func (s Criterion) GetType__() bindings.BindingType { + return CriterionBindingType() +} + +func (s Criterion) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Criterion._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base type for CSV result. +type CsvListResult struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string +} + +func (s CsvListResult) GetType__() bindings.BindingType { + return CsvListResultBindingType() +} + +func (s CsvListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CsvListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base type for CSV records. +type CsvRecord struct { +} + +func (s CsvRecord) GetType__() bindings.BindingType { + return CsvRecordBindingType() +} + +func (s CsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Current backup operation status +type CurrentBackupOperationStatus struct { + // Unique identifier of current backup + BackupId *string + // Possible values are: + // + // * CurrentBackupOperationStatus#CurrentBackupOperationStatus_CURRENT_STEP_CLUSTER_BACKUP + // * CurrentBackupOperationStatus#CurrentBackupOperationStatus_CURRENT_STEP_NODE_BACKUP + // + // Current step of operation + CurrentStep *string + // Additional human-readable status information about current step + CurrentStepMessage *string + // Time when operation is expected to end format: int64 + EndTime *int64 + // Possible values are: + // + // * CurrentBackupOperationStatus#CurrentBackupOperationStatus_OPERATION_TYPE_NONE + // * CurrentBackupOperationStatus#CurrentBackupOperationStatus_OPERATION_TYPE_BACKUP + // + // Type of operation that is in progress. Returns none if no operation is in progress, in which case none of the other fields will be set. + OperationType *string + // Time when operation was started format: int64 + StartTime *int64 +} +const CurrentBackupOperationStatus_CURRENT_STEP_CLUSTER_BACKUP = "BACKUP_CREATING_CLUSTER_BACKUP" +const CurrentBackupOperationStatus_CURRENT_STEP_NODE_BACKUP = "BACKUP_CREATING_NODE_BACKUP" +const CurrentBackupOperationStatus_OPERATION_TYPE_NONE = "NONE" +const CurrentBackupOperationStatus_OPERATION_TYPE_BACKUP = "BACKUP" + +func (s CurrentBackupOperationStatus) GetType__() bindings.BindingType { + return CurrentBackupOperationStatusBindingType() +} + +func (s CurrentBackupOperationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CurrentBackupOperationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence is enabled on a PolicyLbVirtualServer by binding a persistence profile to it. +type CustomPolicyLbPersistenceProfile struct { + // Possible values are: + // + // * CustomPolicyLbPersistenceProfile#CustomPolicyLbPersistenceProfile_PERSISTENCE_COOKIE + // * CustomPolicyLbPersistenceProfile#CustomPolicyLbPersistenceProfile_PERSISTENCE_SOURCE_IP + // + // This field indicates the persistence method used for the PolicyLbVirtualServer. - COOKIE persistence allows related client connections, identified by the same cookie in HTTP requests [Refer to HTTP Cookie for details on HTTP cookies], to be redirected to the same server. Load balancer does not maintain any persistence table for cookie persistence. Instead, it encodes the necessary information in the HTTP cookie value sent to client and relies on the client to store it and send it back in subsequent related HTTP requests. Hence there is no limit on the number of cookie persistence entries that can be supported. - SOURCE_IP persistence ensures all connections from a client (identified by IP address) are sent to the same backend server for a specified period. - This object is not required and without creation of this object the virtual server persistence is disabled by default + Persistence *string + // Persistence shared setting indicates that all PolicyLbVirtualServers that consume this PolicyLbPersistenceProfile should share the same persistence mechanism when enabled. Meaning, persistence entries of a client accessing one virtual server will also affect the same client's connections to a different virtual server. For example, say there are two virtual servers vip-ip1:80 and vip-ip1:8080 bound to the same Group g1 consisting of two servers (s11:80 and s12:80). By default, each virtual server will have its own persistence table or cookie. So, in the earlier example, there will be two tables (vip-ip1:80, p1) and (vip-ip1:8080, p1) or cookies. So, if a client connects to vip1:80 and later connects to vip1:8080, the second connection may be sent to a different server than the first. When persistence_shared is enabled, then the second connection will always connect to the same server as the original connection. For COOKIE persistence type, the same cookie will be shared by multiple virtual servers. For SOURCE_IP persistenct type, the persistence table will be shared across virtual servers. + PersistenceShared *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_L4POLICYLBPERSISTENCEPROFILE + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_L7POLICYLBPERSISTENCEPROFILE + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_CUSTOMPOLICYLBPERSISTENCEPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const CustomPolicyLbPersistenceProfile__TYPE_IDENTIFIER = "CustomPolicyLbPersistenceProfile" +const CustomPolicyLbPersistenceProfile_PERSISTENCE_COOKIE = "COOKIE" +const CustomPolicyLbPersistenceProfile_PERSISTENCE_SOURCE_IP = "SOURCE_IP" + +func (s CustomPolicyLbPersistenceProfile) GetType__() bindings.BindingType { + return CustomPolicyLbPersistenceProfileBindingType() +} + +func (s CustomPolicyLbPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CustomPolicyLbPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Virtual server acts as a facade to an application, receives all client connections over a specified protocol and distributes them among the backend servers. This custom type allows for more complex settings than the simplified PolicyLbVirtualServer types. This object allows for complex configurations for PolicyLbVirtualServers of all types. All HTTP specific inputs will be rejected when combined with TPC or UDP protocols. +type CustomPolicyLbVirtualServer struct { + // Possible values are: + // + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_APP_PROTOCOL_TCP + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_APP_PROTOCOL_UDP + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_APP_PROTOCOL_HTTP + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_APP_PROTOCOL_HTTPS + // + // As the custom type allows for more complex settings than the simplified PolicyLbVirtualServer types, also specify the desired protocol for receiving all client connections. + AppProtocol *string + // Client-side SSL profile binding allows multiple certificates, for different hostnames, to be bound to the same virtual server. The setting is used when load balancer acts as an SSL server and terminating the client SSL connection + ClientSslCertificateIds []string + // Possible values are: + // + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_BASE_SECURE_111317 + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_MODERATE_SECURE_111317 + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_HIGH_SECURE_111317 + // + // Security settings representing various security settings when the VirtualServer acts as an SSL server - BASE_SECURE_111317 - MODERATE_SECURE_111317 - HIGH_SECURE_111317 + ClientSslSettings *string + // The setting is used when load balancer acts as an SSL server and terminating the client SSL connection. A default certificate should be specified which will be used if the server does not host multiple hostnames on the same IP address or if the client does not support SNI extension. + DefaultClientSslCertificateId *string + // To support client authentication (load balancer acting as a client authenticating to the backend server), server_ssl_certificate_id can be specified. When supplied, the backend server certificate must be signed by one of the trusted Certificate Authorities (CAs), also referred to as root CAs, whose self signed certificates are specified. This setting is only applicable for L7 protocols and will be rejected in combination with TCP or UDP. + ServerAuthCaCertificateIds []string + // Possible values are: + // + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_SERVER_SSL_SETTINGS_BASE_SECURE_111317 + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_SERVER_SSL_SETTINGS_MODERATE_SECURE_111317 + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_SERVER_SSL_SETTINGS_HIGH_SECURE_111317 + // * CustomPolicyLbVirtualServer#CustomPolicyLbVirtualServer_SERVER_SSL_SETTINGS_DISABLED + // + // Indicates whether to enable server side SSL. Server side SSL will be enabled when a specific security setting is selected. The selected security setting or profile represents various configurations related to SSL when the VirtualServer acts as a client connecting over SSL to the backend server. This setting is only applicable for L7 protocols and will be rejected in combination with TCP or UDP. - BASE_SECURE_111317 - MODERATE_SECURE_111317 - HIGH_SECURE_111317 - DISABLED + ServerSslSettings *string + // Backend web servers typically log each request they handle along with the requesting client IP address. These logs are used for debugging, analytics and other such purposes. If the deployment topology requires enabling SNAT on the load balancer, then server will see the client as the SNAT IP which defeats the purpose of logging. To work around this issue, load balancer can be configured to insert XFF HTTP header with the original client IP address. Backend servers can then be configured to log the IP address in XFF header instead of the source IP address of the connection. If XFF header is not present in the incoming request, load balancer inserts a new XFF header with the client IP address. + InsertClientIpHeader *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_TCPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_UDPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPSPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_CUSTOMPOLICYLBVIRTUALSERVER + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If access log is enabled, all HTTP requests sent to an L7 virtual server are logged to the access log file. Both successful requests (backend server returns 2xx) and unsuccessful requests (backend server returns 4xx or 5xx) are logged to access log, if enabled. + AccessLogEnabled *bool + // Configures the IP address of the PolicyLbVirtualServer where it receives all client connections and distributes them among the backend servers. format: ip + IpAddress *string + // Path to optional object that enables persistence on a virtual server allowing related client connections to be sent to the same backend server. Persistence is disabled by default. + LbPersistenceProfile *string + // Ports contains a list of at least one port or port range such as \"80\", \"1234-1236\". Each port element in the list should be a single port or a single port range. format: port-or-range + Ports []string + // Path to router type object that PolicyLbVirtualServer connects to. The only supported router object is Network. + RouterPath *string + TrafficSource *string +} +const CustomPolicyLbVirtualServer_APP_PROTOCOL_TCP = "TCP" +const CustomPolicyLbVirtualServer_APP_PROTOCOL_UDP = "UDP" +const CustomPolicyLbVirtualServer_APP_PROTOCOL_HTTP = "HTTP" +const CustomPolicyLbVirtualServer_APP_PROTOCOL_HTTPS = "HTTPS" +const CustomPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_BASE_SECURE_111317 = "BASE_SECURE_111317" +const CustomPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_MODERATE_SECURE_111317 = "MODERATE_SECURE_111317" +const CustomPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_HIGH_SECURE_111317 = "HIGH_SECURE_111317" +const CustomPolicyLbVirtualServer_SERVER_SSL_SETTINGS_BASE_SECURE_111317 = "BASE_SECURE_111317" +const CustomPolicyLbVirtualServer_SERVER_SSL_SETTINGS_MODERATE_SECURE_111317 = "MODERATE_SECURE_111317" +const CustomPolicyLbVirtualServer_SERVER_SSL_SETTINGS_HIGH_SECURE_111317 = "HIGH_SECURE_111317" +const CustomPolicyLbVirtualServer_SERVER_SSL_SETTINGS_DISABLED = "DISABLED" + +func (s CustomPolicyLbVirtualServer) GetType__() bindings.BindingType { + return CustomPolicyLbVirtualServerBindingType() +} + +func (s CustomPolicyLbVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CustomPolicyLbVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents configuration for custom widget. For this widget the data source is not applicable. It defines ui identifer to identify UI component and render it on dashboard view. This configuration can only be used for system owned widgets. +type CustomWidgetConfiguration struct { + // User defined component selector to be rendered inside view/container. + UiComponentIdentifier *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const CustomWidgetConfiguration__TYPE_IDENTIFIER = "CustomWidgetConfiguration" + +func (s CustomWidgetConfiguration) GetType__() bindings.BindingType { + return CustomWidgetConfigurationBindingType() +} + +func (s CustomWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CustomWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Credential info to connect to a CVX type of enforcement point. +type CvxConnectionInfo struct { + // Password. + Password *string + // Thumbprint of EnforcementPoint in the form of a SHA-256 hash represented in lower case HEX. + Thumbprint *string + // Username. + Username *string + // Value of this property could be Hostname or IP. For instance: - On an NSX-T MP running on default port, the value could be \"10.192.1.1\" - On an NSX-T MP running on custom port, the value could be \"192.168.1.1:32789\" - On an NSX-T MP in VMC deployments, the value could be \"192.168.1.1:5480/nsxapi\" + EnforcementPointAddress *string + // Possible values are: + // + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXTCONNECTIONINFO + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXVCONNECTIONINFO + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_CVXCONNECTIONINFO + // + // Resource Type of Enforcement Point Connection Info. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const CvxConnectionInfo__TYPE_IDENTIFIER = "CvxConnectionInfo" + +func (s CvxConnectionInfo) GetType__() bindings.BindingType { + return CvxConnectionInfoBindingType() +} + +func (s CvxConnectionInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CvxConnectionInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DNS forwarder statistics per enforcement point. +type DNSForwarderStatisticsPerEnforcementPoint struct { + // Policy path referencing the enforcement point from where the statistics are fetched. + EnforcementPointPath *string + // Possible values are: + // + // * DNSForwarderStatisticsPerEnforcementPoint#DNSForwarderStatisticsPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSFORWARDERSTATISTICS + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DNSForwarderStatisticsPerEnforcementPoint__TYPE_IDENTIFIER = "DNSForwarderStatisticsPerEnforcementPoint" +const DNSForwarderStatisticsPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSFORWARDERSTATISTICS = "NsxTDNSForwarderStatistics" + +func (s DNSForwarderStatisticsPerEnforcementPoint) GetType__() bindings.BindingType { + return DNSForwarderStatisticsPerEnforcementPointBindingType() +} + +func (s DNSForwarderStatisticsPerEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DNSForwarderStatisticsPerEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DNS forwarder status per enforcement point. +type DNSForwarderStatusPerEnforcementPoint struct { + // Policy path referencing the enforcement point from where the status is fetched. + EnforcementPointPath *string + // Possible values are: + // + // * DNSForwarderStatusPerEnforcementPoint#DNSForwarderStatusPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSFORWARDERSTATUS + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DNSForwarderStatusPerEnforcementPoint__TYPE_IDENTIFIER = "DNSForwarderStatusPerEnforcementPoint" +const DNSForwarderStatusPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSFORWARDERSTATUS = "NsxTDNSForwarderStatus" + +func (s DNSForwarderStatusPerEnforcementPoint) GetType__() bindings.BindingType { + return DNSForwarderStatusPerEnforcementPointBindingType() +} + +func (s DNSForwarderStatusPerEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DNSForwarderStatusPerEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DataCounter struct { + // The dropped packets or bytes format: int64 + Dropped *int64 + // The multicast and broadcast packets or bytes format: int64 + MulticastBroadcast *int64 + // The total packets or bytes format: int64 + Total *int64 +} + +func (s DataCounter) GetType__() bindings.BindingType { + return DataCounterBindingType() +} + +func (s DataCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DataCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// An instance of a datasource configuration. +type Datasource struct { + // Name of a datasource instance. + DisplayName *string + // Array of urls relative to the datasource configuration. For example, api/v1/fabric/nodes is a relative url of nsx-manager instance. + Urls []UrlAlias +} + +func (s Datasource) GetType__() bindings.BindingType { + return DatasourceBindingType() +} + +func (s Datasource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Datasource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// An instance of a datasource configuration. +type DefaultFilterValue struct { + // Filter alias. + Alias *string + // Filter default value. + Value *string +} + +func (s DefaultFilterValue) GetType__() bindings.BindingType { + return DefaultFilterValueBindingType() +} + +func (s DefaultFilterValue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DefaultFilterValue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Parameters that affect how delete operations are processed +type DeleteRequestParameters struct { + // If true, deleting the resource succeeds even if it is being referred as a resource reference. + Force *bool +} + +func (s DeleteRequestParameters) GetType__() bindings.BindingType { + return DeleteRequestParametersBindingType() +} + +func (s DeleteRequestParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DeleteRequestParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Logical grouping of enforcement points. This is a deprecated type. DeploymentZone has been renamed to Site. Use Site. +type DeploymentZone struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Logical grouping of enforcement points + EnforcementPoints []EnforcementPoint +} + +func (s DeploymentZone) GetType__() bindings.BindingType { + return DeploymentZoneBindingType() +} + +func (s DeploymentZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DeploymentZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DFW Firewall related configurations +type DfwFirewallConfiguration struct { + // If set to true, identity firewall is enabled. + IdfwEnabled *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * FirewallConfiguration#FirewallConfiguration_RESOURCE_TYPE_DFWFIREWALLCONFIGURATION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // To disable auto drafts, set it to true. By default, auto drafts are enabled. + DisableAutoDrafts *bool + // If set to true, Firewall is enabled. + EnableFirewall *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DfwFirewallConfiguration__TYPE_IDENTIFIER = "DfwFirewallConfiguration" + +func (s DfwFirewallConfiguration) GetType__() bindings.BindingType { + return DfwFirewallConfigurationBindingType() +} + +func (s DfwFirewallConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DfwFirewallConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpHeader struct { + // Possible values are: + // + // * DhcpHeader#DhcpHeader_OP_CODE_BOOTREQUEST + // * DhcpHeader#DhcpHeader_OP_CODE_BOOTREPLY + // + // This is used to specify the general type of message. A client sending request to a server uses an op code of BOOTREQUEST, while a server replying uses an op code of BOOTREPLY. + OpCode *string +} +const DhcpHeader_OP_CODE_BOOTREQUEST = "BOOTREQUEST" +const DhcpHeader_OP_CODE_BOOTREPLY = "BOOTREPLY" + +func (s DhcpHeader) GetType__() bindings.BindingType { + return DhcpHeaderBindingType() +} + +func (s DhcpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpIpPoolUsage struct { + // allocated number. COULD BE INACCURATE, REFERENCE ONLY. format: int64 + AllocatedNumber *int64 + // allocated percentage. COULD BE INACCURATE, REFERENCE ONLY. format: int64 + AllocatedPercentage *int64 + // uuid of dhcp ip pool + DhcpIpPoolId *string + // pool size format: int64 + PoolSize *int64 +} + +func (s DhcpIpPoolUsage) GetType__() bindings.BindingType { + return DhcpIpPoolUsageBindingType() +} + +func (s DhcpIpPoolUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpIpPoolUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpLeasePerIP struct { + // expire time of the lease + ExpireTime *string + // ip address of client + IpAddress *string + // lease time of the ip address, in seconds + LeaseTime *string + // mac address of client + MacAddress *string + // start time of lease + StartTime *string + // subnet of client network + Subnet *string +} + +func (s DhcpLeasePerIP) GetType__() bindings.BindingType { + return DhcpLeasePerIPBindingType() +} + +func (s DhcpLeasePerIP) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpLeasePerIP._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpLeases struct { + // dhcp server uuid + DhcpServerId *string + // The lease info list of the server + Leases []DhcpLeasePerIP + // timestamp of the lease info format: int64 + Timestamp *int64 +} + +func (s DhcpLeases) GetType__() bindings.BindingType { + return DhcpLeasesBindingType() +} + +func (s DhcpLeases) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpLeases._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpLeasesResult struct { + // dhcp server uuid + DhcpServerId *string + // The lease info list of the server + Leases []DhcpLeasePerIP + // timestamp of the lease info format: int64 + Timestamp *int64 + // Policy path to Segment, Tier0 or Tier1 gateway where DHCP server is attached. + ConnectivityPath *string +} + +func (s DhcpLeasesResult) GetType__() bindings.BindingType { + return DhcpLeasesResultBindingType() +} + +func (s DhcpLeasesResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpLeasesResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP option 121 to define classless static route. +type DhcpOption121 struct { + // Classless static route of DHCP option 121. + StaticRoutes []ClasslessStaticRoute +} + +func (s DhcpOption121) GetType__() bindings.BindingType { + return DhcpOption121BindingType() +} + +func (s DhcpOption121) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpOption121._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP relay configuration. Please note, the realized-state of this entity returned by the \"GET /policy/api/v1/infra/realized-state/realized-entity\" with this entity policy-path is irrelevant with the application status of this entity. Please do not rely on this returned realized-state to determine how this dhcp-relay-config was applied. The dhcp realization information was reflected in the realization states of the referencing Segment or T0/T1 gateway. +type DhcpRelayConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // DHCP server IP addresses for DHCP relay configuration. Both IPv4 and IPv6 addresses are supported. format: ip + ServerAddresses []string +} + +func (s DhcpRelayConfig) GetType__() bindings.BindingType { + return DhcpRelayConfigBindingType() +} + +func (s DhcpRelayConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpRelayConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of DhcpRelayConfigs +type DhcpRelayConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // DhcpRelayConfig results + Results []DhcpRelayConfig +} + +func (s DhcpRelayConfigListResult) GetType__() bindings.BindingType { + return DhcpRelayConfigListResultBindingType() +} + +func (s DhcpRelayConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpRelayConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP server configuration. Please note, the realized-state of this entity returned by the \"GET /policy/api/v1/infra/realized-state/realized-entity\" with this entity policy-path is irrelevant with the application status of this entity. Please do not rely on this returned realized-state to determine how this dhcp-server-config was applied. The dhcp realization information was reflected in the realization states of the referencing Segment or T0/T1 gateway. +type DhcpServerConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Edge cluster path. Auto assigned if only one edge cluster is configured on enforcement-point. Modifying edge cluster will reallocate DHCP server to the new edge cluster. Please note that re-allocating edge-cluster will result in losing of all exisitng DHCP lease information. Change edge cluster only when losing DHCP leases is not a real problem, e.g. cross-site migration or failover and all client hosts will be reboot and get new IP addresses. + EdgeClusterPath *string + // IP address lease time in seconds. format: int64 + LeaseTime *int64 + // Policy paths to edge nodes on which the DHCP servers run. The first edge node is assigned as active edge, and second one as stanby edge. If only one edge node is specified, the DHCP servers will run without HA support. When this property is not specified, edge nodes are auto-assigned during realization of the DHCP server. + PreferredEdgePaths []string + // DHCP server address in CIDR format. Prefix length should be less than or equal to 30. DHCP server is deployed as DHCP relay service. This property is deprecated, use server_addresses instead. Both properties cannot be specified together with different new values. format: ip-cidr-block + ServerAddress *string + // DHCP server address in CIDR format. Both IPv4 and IPv6 address families are supported. Prefix length should be less than or equal to 30 for IPv4 address family and less than or equal to 126 for IPv6. When not specified, IPv4 value is auto-assigned to 100.96.0.1/30. Ignored when this object is configured at a Segment. format: ip-cidr-block + ServerAddresses []string +} + +func (s DhcpServerConfig) GetType__() bindings.BindingType { + return DhcpServerConfigBindingType() +} + +func (s DhcpServerConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpServerConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of DhcpServerConfigs +type DhcpServerConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // DhcpServerConfig results + Results []DhcpServerConfig +} + +func (s DhcpServerConfigListResult) GetType__() bindings.BindingType { + return DhcpServerConfigListResultBindingType() +} + +func (s DhcpServerConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpServerConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpServerState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * DhcpServerState#DhcpServerState_STATE_PENDING + // * DhcpServerState#DhcpServerState_STATE_IN_PROGRESS + // * DhcpServerState#DhcpServerState_STATE_SUCCESS + // * DhcpServerState#DhcpServerState_STATE_FAILED + // * DhcpServerState#DhcpServerState_STATE_PARTIAL_SUCCESS + // * DhcpServerState#DhcpServerState_STATE_ORPHANED + // * DhcpServerState#DhcpServerState_STATE_UNKNOWN + // * DhcpServerState#DhcpServerState_STATE_ERROR + // * DhcpServerState#DhcpServerState_STATE_IN_SYNC + // * DhcpServerState#DhcpServerState_STATE_NOT_AVAILABLE + // * DhcpServerState#DhcpServerState_STATE_VM_DEPLOYMENT_QUEUED + // * DhcpServerState#DhcpServerState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * DhcpServerState#DhcpServerState_STATE_VM_DEPLOYMENT_FAILED + // * DhcpServerState#DhcpServerState_STATE_VM_POWER_ON_IN_PROGRESS + // * DhcpServerState#DhcpServerState_STATE_VM_POWER_ON_FAILED + // * DhcpServerState#DhcpServerState_STATE_REGISTRATION_PENDING + // * DhcpServerState#DhcpServerState_STATE_NODE_NOT_READY + // * DhcpServerState#DhcpServerState_STATE_NODE_READY + // * DhcpServerState#DhcpServerState_STATE_VM_POWER_OFF_IN_PROGRESS + // * DhcpServerState#DhcpServerState_STATE_VM_POWER_OFF_FAILED + // * DhcpServerState#DhcpServerState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * DhcpServerState#DhcpServerState_STATE_VM_UNDEPLOY_FAILED + // * DhcpServerState#DhcpServerState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * DhcpServerState#DhcpServerState_STATE_EDGE_CONFIG_ERROR + // * DhcpServerState#DhcpServerState_STATE_VM_DEPLOYMENT_RESTARTED + // * DhcpServerState#DhcpServerState_STATE_REGISTRATION_FAILED + // * DhcpServerState#DhcpServerState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * DhcpServerState#DhcpServerState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * DhcpServerState#DhcpServerState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * DhcpServerState#DhcpServerState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * DhcpServerState#DhcpServerState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * DhcpServerState#DhcpServerState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * DhcpServerState#DhcpServerState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * DhcpServerState#DhcpServerState_STATE_APPLIANCE_INTERNAL_ERROR + // * DhcpServerState#DhcpServerState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * DhcpServerState#DhcpServerState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * DhcpServerState#DhcpServerState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * DhcpServerState#DhcpServerState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * DhcpServerState#DhcpServerState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * DhcpServerState#DhcpServerState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * DhcpServerState#DhcpServerState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * DhcpServerState#DhcpServerState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * DhcpServerState#DhcpServerState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * DhcpServerState#DhcpServerState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * DhcpServerState#DhcpServerState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * DhcpServerState#DhcpServerState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * DhcpServerState#DhcpServerState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * DhcpServerState#DhcpServerState_STATE_INVALID_PNIC_DEVICE_NAME + // * DhcpServerState#DhcpServerState_STATE_TRANSPORT_NODE_READY + // * DhcpServerState#DhcpServerState_STATE_VM_NETWORK_EDIT_PENDING + // * DhcpServerState#DhcpServerState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * DhcpServerState#DhcpServerState_STATE_MPA_DISCONNECTED + // * DhcpServerState#DhcpServerState_STATE_VM_RENAME_PENDING + // * DhcpServerState#DhcpServerState_STATE_VM_CONFIG_EDIT_PENDING + // * DhcpServerState#DhcpServerState_STATE_VM_NETWORK_EDIT_FAILED + // * DhcpServerState#DhcpServerState_STATE_VM_RENAME_FAILED + // * DhcpServerState#DhcpServerState_STATE_VM_CONFIG_EDIT_FAILED + // * DhcpServerState#DhcpServerState_STATE_VM_CONFIG_DISCREPANCY + // * DhcpServerState#DhcpServerState_STATE_VM_NODE_REFRESH_FAILED + // * DhcpServerState#DhcpServerState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * DhcpServerState#DhcpServerState_STATE_REGISTRATION_TIMEDOUT + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string +} +const DhcpServerState_STATE_PENDING = "pending" +const DhcpServerState_STATE_IN_PROGRESS = "in_progress" +const DhcpServerState_STATE_SUCCESS = "success" +const DhcpServerState_STATE_FAILED = "failed" +const DhcpServerState_STATE_PARTIAL_SUCCESS = "partial_success" +const DhcpServerState_STATE_ORPHANED = "orphaned" +const DhcpServerState_STATE_UNKNOWN = "unknown" +const DhcpServerState_STATE_ERROR = "error" +const DhcpServerState_STATE_IN_SYNC = "in_sync" +const DhcpServerState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const DhcpServerState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const DhcpServerState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const DhcpServerState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const DhcpServerState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const DhcpServerState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const DhcpServerState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const DhcpServerState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const DhcpServerState_STATE_NODE_READY = "NODE_READY" +const DhcpServerState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const DhcpServerState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const DhcpServerState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const DhcpServerState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const DhcpServerState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const DhcpServerState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const DhcpServerState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const DhcpServerState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const DhcpServerState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const DhcpServerState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const DhcpServerState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const DhcpServerState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const DhcpServerState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const DhcpServerState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const DhcpServerState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const DhcpServerState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const DhcpServerState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const DhcpServerState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const DhcpServerState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const DhcpServerState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const DhcpServerState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const DhcpServerState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const DhcpServerState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const DhcpServerState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const DhcpServerState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const DhcpServerState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const DhcpServerState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const DhcpServerState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const DhcpServerState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const DhcpServerState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const DhcpServerState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const DhcpServerState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const DhcpServerState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const DhcpServerState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const DhcpServerState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const DhcpServerState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const DhcpServerState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const DhcpServerState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const DhcpServerState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const DhcpServerState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const DhcpServerState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const DhcpServerState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const DhcpServerState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" + +func (s DhcpServerState) GetType__() bindings.BindingType { + return DhcpServerStateBindingType() +} + +func (s DhcpServerState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpServerState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpServerStatistics struct { + // The total number of DHCP ACK packets format: int64 + Acks *int64 + // The total number of DHCP DECLINE packets format: int64 + Declines *int64 + // dhcp server uuid + DhcpServerId *string + // The total number of DHCP DISCOVER packets format: int64 + Discovers *int64 + // The total number of DHCP errors format: int64 + Errors *int64 + // The total number of DHCP INFORM packets format: int64 + Informs *int64 + // The DHCP ip pool usage statistics + IpPoolStats []DhcpIpPoolUsage + // The total number of DHCP NACK packets format: int64 + Nacks *int64 + // The total number of DHCP OFFER packets format: int64 + Offers *int64 + // The total number of DHCP RELEASE packets format: int64 + Releases *int64 + // The total number of DHCP REQUEST packets format: int64 + Requests *int64 + // timestamp of the statistics format: int64 + Timestamp *int64 +} + +func (s DhcpServerStatistics) GetType__() bindings.BindingType { + return DhcpServerStatisticsBindingType() +} + +func (s DhcpServerStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpServerStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpServerStatus struct { + // uuid of active transport node + ActiveNode *string + // Error message, if available + ErrorMessage *string + // Possible values are: + // + // * DhcpServerStatus#DhcpServerStatus_SERVICE_STATUS_UP + // * DhcpServerStatus#DhcpServerStatus_SERVICE_STATUS_DOWN + // * DhcpServerStatus#DhcpServerStatus_SERVICE_STATUS_ERROR + // * DhcpServerStatus#DhcpServerStatus_SERVICE_STATUS_NO_STANDBY + // + // UP means the dhcp service is working fine on both active transport-node and stand-by transport-node (if have), hence fail-over can work at this time if there is failure happens on one of the transport-node; DOWN means the dhcp service is down on both active transport-node and stand-by node (if have), hence the dhcp-service will not repsonse any dhcp request; Error means error happens on transport-node(s) or no status is reported from transport-node(s). The dhcp service may be working (or not working); NO_STANDBY means dhcp service is working in one of the transport node while not in the other transport-node (if have). Hence if the dhcp service in the working transport-node is down, fail-over will not happen and the dhcp service will go down. + ServiceStatus *string + // uuid of stand_by transport node. null if non-HA mode + StandByNode *string +} +const DhcpServerStatus_SERVICE_STATUS_UP = "UP" +const DhcpServerStatus_SERVICE_STATUS_DOWN = "DOWN" +const DhcpServerStatus_SERVICE_STATUS_ERROR = "ERROR" +const DhcpServerStatus_SERVICE_STATUS_NO_STANDBY = "NO_STANDBY" + +func (s DhcpServerStatus) GetType__() bindings.BindingType { + return DhcpServerStatusBindingType() +} + +func (s DhcpServerStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpServerStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP IPv4 and IPv6 static bindings are extended from this abstract class. +type DhcpStaticBindingConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * DhcpStaticBindingConfig#DhcpStaticBindingConfig_RESOURCE_TYPE_DHCPV4STATICBINDINGCONFIG + // * DhcpStaticBindingConfig#DhcpStaticBindingConfig_RESOURCE_TYPE_DHCPV6STATICBINDINGCONFIG + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DhcpStaticBindingConfig__TYPE_IDENTIFIER = "DhcpStaticBindingConfig" +const DhcpStaticBindingConfig_RESOURCE_TYPE_DHCPV4STATICBINDINGCONFIG = "DhcpV4StaticBindingConfig" +const DhcpStaticBindingConfig_RESOURCE_TYPE_DHCPV6STATICBINDINGCONFIG = "DhcpV6StaticBindingConfig" + +func (s DhcpStaticBindingConfig) GetType__() bindings.BindingType { + return DhcpStaticBindingConfigBindingType() +} + +func (s DhcpStaticBindingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpStaticBindingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpStaticBindingConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of DhcpStaticBindingConfig + Results []*data.StructValue +} + +func (s DhcpStaticBindingConfigListResult) GetType__() bindings.BindingType { + return DhcpStaticBindingConfigListResultBindingType() +} + +func (s DhcpStaticBindingConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpStaticBindingConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpStaticBindingState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_PENDING + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_IN_PROGRESS + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_SUCCESS + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_PARTIAL_SUCCESS + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_ORPHANED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_UNKNOWN + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_ERROR + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_IN_SYNC + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_NOT_AVAILABLE + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_DEPLOYMENT_QUEUED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_DEPLOYMENT_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_POWER_ON_IN_PROGRESS + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_POWER_ON_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_REGISTRATION_PENDING + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_NODE_NOT_READY + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_NODE_READY + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_POWER_OFF_IN_PROGRESS + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_POWER_OFF_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_UNDEPLOY_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_EDGE_CONFIG_ERROR + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_DEPLOYMENT_RESTARTED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_REGISTRATION_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_APPLIANCE_INTERNAL_ERROR + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_INVALID_PNIC_DEVICE_NAME + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_TRANSPORT_NODE_READY + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_NETWORK_EDIT_PENDING + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_MPA_DISCONNECTED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_RENAME_PENDING + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_CONFIG_EDIT_PENDING + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_NETWORK_EDIT_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_RENAME_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_CONFIG_EDIT_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_CONFIG_DISCREPANCY + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_NODE_REFRESH_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * DhcpStaticBindingState#DhcpStaticBindingState_STATE_REGISTRATION_TIMEDOUT + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string +} +const DhcpStaticBindingState_STATE_PENDING = "pending" +const DhcpStaticBindingState_STATE_IN_PROGRESS = "in_progress" +const DhcpStaticBindingState_STATE_SUCCESS = "success" +const DhcpStaticBindingState_STATE_FAILED = "failed" +const DhcpStaticBindingState_STATE_PARTIAL_SUCCESS = "partial_success" +const DhcpStaticBindingState_STATE_ORPHANED = "orphaned" +const DhcpStaticBindingState_STATE_UNKNOWN = "unknown" +const DhcpStaticBindingState_STATE_ERROR = "error" +const DhcpStaticBindingState_STATE_IN_SYNC = "in_sync" +const DhcpStaticBindingState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const DhcpStaticBindingState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const DhcpStaticBindingState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const DhcpStaticBindingState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const DhcpStaticBindingState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const DhcpStaticBindingState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const DhcpStaticBindingState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const DhcpStaticBindingState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const DhcpStaticBindingState_STATE_NODE_READY = "NODE_READY" +const DhcpStaticBindingState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const DhcpStaticBindingState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const DhcpStaticBindingState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const DhcpStaticBindingState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const DhcpStaticBindingState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const DhcpStaticBindingState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const DhcpStaticBindingState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const DhcpStaticBindingState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const DhcpStaticBindingState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const DhcpStaticBindingState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const DhcpStaticBindingState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const DhcpStaticBindingState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const DhcpStaticBindingState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const DhcpStaticBindingState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const DhcpStaticBindingState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const DhcpStaticBindingState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const DhcpStaticBindingState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const DhcpStaticBindingState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const DhcpStaticBindingState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const DhcpStaticBindingState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const DhcpStaticBindingState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const DhcpStaticBindingState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const DhcpStaticBindingState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const DhcpStaticBindingState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const DhcpStaticBindingState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const DhcpStaticBindingState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const DhcpStaticBindingState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const DhcpStaticBindingState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const DhcpStaticBindingState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const DhcpStaticBindingState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const DhcpStaticBindingState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const DhcpStaticBindingState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const DhcpStaticBindingState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const DhcpStaticBindingState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const DhcpStaticBindingState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const DhcpStaticBindingState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const DhcpStaticBindingState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const DhcpStaticBindingState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const DhcpStaticBindingState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const DhcpStaticBindingState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const DhcpStaticBindingState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const DhcpStaticBindingState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const DhcpStaticBindingState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" + +func (s DhcpStaticBindingState) GetType__() bindings.BindingType { + return DhcpStaticBindingStateBindingType() +} + +func (s DhcpStaticBindingState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpStaticBindingState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DhcpStatistics struct { + // The total number of DHCP ACK packets format: int64 + Acks *int64 + // The total number of DHCP DECLINE packets format: int64 + Declines *int64 + // dhcp server uuid + DhcpServerId *string + // The total number of DHCP DISCOVER packets format: int64 + Discovers *int64 + // The total number of DHCP errors format: int64 + Errors *int64 + // The total number of DHCP INFORM packets format: int64 + Informs *int64 + // The DHCP ip pool usage statistics + IpPoolStats []DhcpIpPoolUsage + // The total number of DHCP NACK packets format: int64 + Nacks *int64 + // The total number of DHCP OFFER packets format: int64 + Offers *int64 + // The total number of DHCP RELEASE packets format: int64 + Releases *int64 + // The total number of DHCP REQUEST packets format: int64 + Requests *int64 + // timestamp of the statistics format: int64 + Timestamp *int64 +} + +func (s DhcpStatistics) GetType__() bindings.BindingType { + return DhcpStatisticsBindingType() +} + +func (s DhcpStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP options for IPv4 server. +type DhcpV4Options struct { + // DHCP option 121 to define classless static routes. + Option121 *DhcpOption121 + // To define DHCP options other than option 121 in generic format. Please note, only the following options can be defined in generic format. Those other options will be accepted without validation but will not take effect. -------------------------- Code Name -------------------------- 2 Time Offset 6 Domain Name Server 13 Boot File Size 19 Forward On/Off 26 MTU Interface 28 Broadcast Address 35 ARP Timeout 40 NIS Domain 41 NIS Servers 42 NTP Servers 44 NETBIOS Name Srv 45 NETBIOS Dist Srv 46 NETBIOS Node Type 47 NETBIOS Scope 58 Renewal Time 59 Rebinding Time 64 NIS+-Domain-Name 65 NIS+-Server-Addr 66 TFTP Server-Name (used by PXE) 67 Bootfile-Name (used by PXE) 93 PXE: Client system architecture 94 PXE: Client NDI 97 PXE: UUID/UNDI 117 Name Service Search 119 Domain Search 150 TFTP server address (used by PXE) 175 Etherboot 209 PXE Configuration File 210 PXE Path Prefix 211 PXE Reboot Time + Others []GenericDhcpOption +} + +func (s DhcpV4Options) GetType__() bindings.BindingType { + return DhcpV4OptionsBindingType() +} + +func (s DhcpV4Options) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV4Options._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP IPv4 static bindings are configured for each segment. +type DhcpV4StaticBindingConfig struct { + // When not specified, gateway address is auto-assigned from segment configuration. format: ipv4 + GatewayAddress *string + // Hostname to assign to the host. + HostName *string + // IP assigned to host. The IP address must belong to the subnet, if any, configured on Segment. format: ipv4 + IpAddress *string + // DHCP lease time in seconds. format: int64 + LeaseTime *int64 + // MAC address of the host. format: mac-address + MacAddress *string + // IPv4 DHCP options. + Options *DhcpV4Options + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * DhcpStaticBindingConfig#DhcpStaticBindingConfig_RESOURCE_TYPE_DHCPV4STATICBINDINGCONFIG + // * DhcpStaticBindingConfig#DhcpStaticBindingConfig_RESOURCE_TYPE_DHCPV6STATICBINDINGCONFIG + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DhcpV4StaticBindingConfig__TYPE_IDENTIFIER = "DhcpV4StaticBindingConfig" + +func (s DhcpV4StaticBindingConfig) GetType__() bindings.BindingType { + return DhcpV4StaticBindingConfigBindingType() +} + +func (s DhcpV4StaticBindingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV4StaticBindingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP options for IPv6 server. +type DhcpV6Options struct { +} + +func (s DhcpV6Options) GetType__() bindings.BindingType { + return DhcpV6OptionsBindingType() +} + +func (s DhcpV6Options) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV6Options._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP IPv6 static bindings are configured for each segment. +type DhcpV6StaticBindingConfig struct { + // When not specified, no DNS nameserver will be set to client host. + DnsNameservers []string + // When not specified, no domain name will be assigned to client host. + DomainNames []string + // When not specified, no ip address will be assigned to client host. format: ipv6 + IpAddresses []string + // Lease time, in seconds. format: int64 + LeaseTime *int64 + // The MAC address of the client host. Either client-duid or mac-address, but not both. format: mac-address + MacAddress *string + // Preferred time, in seconds. If this value is not provided, the value of lease_time\*0.8 will be used. format: int64 + PreferredTime *int64 + // SNTP server IP addresses. format: ipv6 + SntpServers []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * DhcpStaticBindingConfig#DhcpStaticBindingConfig_RESOURCE_TYPE_DHCPV4STATICBINDINGCONFIG + // * DhcpStaticBindingConfig#DhcpStaticBindingConfig_RESOURCE_TYPE_DHCPV6STATICBINDINGCONFIG + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DhcpV6StaticBindingConfig__TYPE_IDENTIFIER = "DhcpV6StaticBindingConfig" + +func (s DhcpV6StaticBindingConfig) GetType__() bindings.BindingType { + return DhcpV6StaticBindingConfigBindingType() +} + +func (s DhcpV6StaticBindingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV6StaticBindingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type Dhcpv6Header struct { + // Possible values are: + // + // * Dhcpv6Header#Dhcpv6Header_MSG_TYPE_SOLICIT + // * Dhcpv6Header#Dhcpv6Header_MSG_TYPE_ADVERTISE + // * Dhcpv6Header#Dhcpv6Header_MSG_TYPE_REQUEST + // * Dhcpv6Header#Dhcpv6Header_MSG_TYPE_REPLY + // + // This is used to specify the DHCP v6 message. To request the assignment of one or more IPv6 addresses, a client first locates a DHCP server and then requests the assignment of addresses and other configuration information from the server. The client sends a Solicit message to the All_DHCP_Relay_Agents_and_Servers address to find available DHCP servers. Any server that can meet the client's requirements responds with an Advertise message. The client then chooses one of the servers and sends a Request message to the server asking for confirmed assignment of addresses and other configuration information. The server responds with a Reply message that contains the confirmed addresses and configuration. SOLICIT - A client sends a Solicit message to locate servers. ADVERTISE - A server sends and Advertise message to indicate that it is available. REQUEST - A client sends a Request message to request configuration parameters. REPLY - A server sends a Reply message containing assigned addresses and configuration parameters. + MsgType *string +} +const Dhcpv6Header_MSG_TYPE_SOLICIT = "SOLICIT" +const Dhcpv6Header_MSG_TYPE_ADVERTISE = "ADVERTISE" +const Dhcpv6Header_MSG_TYPE_REQUEST = "REQUEST" +const Dhcpv6Header_MSG_TYPE_REPLY = "REPLY" + +func (s Dhcpv6Header) GetType__() bindings.BindingType { + return Dhcpv6HeaderBindingType() +} + +func (s Dhcpv6Header) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Dhcpv6Header._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DiscoveredNode struct { + // Certificate of the discovered node + Certificate *string + // Local Id of the discovered node in the Compute Manager + CmLocalId *string + // External id of the discovered node, ex. a mo-ref from VC + ExternalId *string + // Hardware Id is generated using system hardware info. It is used to retrieve fabric node of the esx. + HardwareId *string + // IP Addresses of the the discovered node. format: ip + IpAddresses []string + // Discovered Node type like Host + NodeType *string + // Id of the compute manager from where this node was discovered + OriginId *string + // Key-Value map of additional specific properties of discovered node in the Compute Manager + OriginProperties []KeyValuePair + // OS type of the discovered node + OsType *string + // OS version of the discovered node + OsVersion *string + // External id of the compute collection to which this node belongs + ParentComputeCollection *string + // The stateless property describes whether host persists its state across reboot or not. If state persists, value is set as false otherwise true. + Stateless *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DiscoveredNode__TYPE_IDENTIFIER = "DiscoveredNode" + +func (s DiscoveredNode) GetType__() bindings.BindingType { + return DiscoveredNodeBindingType() +} + +func (s DiscoveredNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveredNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base class for resources that are discovered and automatically updated +type DiscoveredResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DiscoveredResource__TYPE_IDENTIFIER = "DiscoveredResource" + +func (s DiscoveredResource) GetType__() bindings.BindingType { + return DiscoveredResourceBindingType() +} + +func (s DiscoveredResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveredResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base Discovery Profile Binding Map +type DiscoveryProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s DiscoveryProfileBindingMap) GetType__() bindings.BindingType { + return DiscoveryProfileBindingMapBindingType() +} + +func (s DiscoveryProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveryProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DistributedFloodProtectionProfile struct { + // If set to true, rst spoofing will be enabled. Flag is used only for distributed firewall profiles. + EnableRstSpoofing *bool + // If set to true, sync cache will be enabled. Flag is used only for distributed firewall profiles. + EnableSyncache *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * FloodProtectionProfile#FloodProtectionProfile_RESOURCE_TYPE_GATEWAYFLOODPROTECTIONPROFILE + // * FloodProtectionProfile#FloodProtectionProfile_RESOURCE_TYPE_DISTRIBUTEDFLOODPROTECTIONPROFILE + // + // GatewayFloodProtectionProfile is used for all Tier0 and Tier1 gateways. DistributedFloodProtectionProfile is used for all Transport Nodes. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If this field is empty, firewall will not set a limit to active ICMP connections. format: int64 + IcmpActiveFlowLimit *int64 + // If this field is empty, firewall will not set a limit to other active connections. besides UDP, ICMP and half open TCP connections. format: int64 + OtherActiveConnLimit *int64 + // If this field is empty, firewall will not set a limit to half open TCP connections. format: int64 + TcpHalfOpenConnLimit *int64 + // If this field is empty, firewall will not set a limit to active UDP connections. format: int64 + UdpActiveFlowLimit *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DistributedFloodProtectionProfile__TYPE_IDENTIFIER = "DistributedFloodProtectionProfile" + +func (s DistributedFloodProtectionProfile) GetType__() bindings.BindingType { + return DistributedFloodProtectionProfileBindingType() +} + +func (s DistributedFloodProtectionProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DistributedFloodProtectionProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Distributed virtual portgroup on a VC +type DistributedVirtualPortgroup struct { + // For distributed virtual portgroup, backing type is standard. For logical switch portgroup, the backing type is set to nsx. + BackingType *string + // Generated UUID of the portgroup + Key *string + // Possible values are: + // + // * DistributedVirtualPortgroup#DistributedVirtualPortgroup_OVERALL_STATUS_RED + // * DistributedVirtualPortgroup#DistributedVirtualPortgroup_OVERALL_STATUS_YELLOW + // * DistributedVirtualPortgroup#DistributedVirtualPortgroup_OVERALL_STATUS_GREEN + // * DistributedVirtualPortgroup#DistributedVirtualPortgroup_OVERALL_STATUS_GRAY + // + // This parameters reflects the managed entity status of the portgroup as reported by VC. + OverallStatus *string + // Id of the portgroup, eg. a mo-ref from VC. + CmLocalId *string + // External id of the virtual portgroup + ExternalId *string + // Portgroup type like DistributedVirtualPortgroup + OriginType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +const DistributedVirtualPortgroup_OVERALL_STATUS_RED = "RED" +const DistributedVirtualPortgroup_OVERALL_STATUS_YELLOW = "YELLOW" +const DistributedVirtualPortgroup_OVERALL_STATUS_GREEN = "GREEN" +const DistributedVirtualPortgroup_OVERALL_STATUS_GRAY = "GRAY" + +func (s DistributedVirtualPortgroup) GetType__() bindings.BindingType { + return DistributedVirtualPortgroupBindingType() +} + +func (s DistributedVirtualPortgroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DistributedVirtualPortgroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DistributedVirtualSwitch on a VC +type DistributedVirtualSwitch struct { + // Array of discovered nodes connected to this switch. + DiscoveredNodes []DiscoveredNode + // It contains information about VMware specific multiple dynamic LACP groups. + LacpGroupConfigs []LacpGroupConfigInfo + // Key-Value map of additional properties of switch + OriginProperties []KeyValuePair + // The uniform name of uplink ports on each host. + UplinkPortNames []string + // Uplink portgroup of distributed virtual switch + UplinkPortgroup *DistributedVirtualPortgroup + // UUID of the switch + Uuid *string + // ID of the virtual switch in compute manager + CmLocalId *string + // External id of the virtual switch + ExternalId *string + // ID of the compute manager where this virtual switch is discovered. + OriginId *string + // Switch type like VmwareDistributedVirtualSwitch + OriginType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s DistributedVirtualSwitch) GetType__() bindings.BindingType { + return DistributedVirtualSwitchBindingType() +} + +func (s DistributedVirtualSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DistributedVirtualSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type DnsHeader struct { + // This is used to define what is being asked or responded. format: hostname-or-ip + Address *string + // Possible values are: + // + // * DnsHeader#DnsHeader_ADDRESS_TYPE_V4 + // * DnsHeader#DnsHeader_ADDRESS_TYPE_V6 + // + // This is used to specify the type of the address. V4 - The address provided is an IPv4 domain name/IP address, the Type in query or response will be A V6 - The address provided is an IPv6 domain name/IP address, the Type in query or response will be AAAA + AddressType *string + // Possible values are: + // + // * DnsHeader#DnsHeader_MESSAGE_TYPE_QUERY + // * DnsHeader#DnsHeader_MESSAGE_TYPE_RESPONSE + // + // Specifies the message type whether it is a query or a response. + MessageType *string +} +const DnsHeader_ADDRESS_TYPE_V4 = "V4" +const DnsHeader_ADDRESS_TYPE_V6 = "V6" +const DnsHeader_MESSAGE_TYPE_QUERY = "QUERY" +const DnsHeader_MESSAGE_TYPE_RESPONSE = "RESPONSE" + +func (s DnsHeader) GetType__() bindings.BindingType { + return DnsHeaderBindingType() +} + +func (s DnsHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Used to configure DNS security profile +type DnsSecurityProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Time to live for DNS cache entry in seconds. Valid TTL values are between 3600 to 864000. However, this field accepts values between 0 through 864000. We define TTL type based on the value of TTL as follows: TTL 0 - cached entry never expires. TTL 1 to 3599 - invalid input and error is thrown TTL 3600 to 864000 - ttl is set to user input TTL field not set by user - TTL type is 'AUTO' and ttl value is set from DNS response packet. User defined TTL value is used only when it is betweeen 3600 to 864000. format: int64 + Ttl *int64 +} + +func (s DnsSecurityProfile) GetType__() bindings.BindingType { + return DnsSecurityProfileBindingType() +} + +func (s DnsSecurityProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsSecurityProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between DNS security profile and Group. With this entity, user can specify intent for applying DNS security profile profile to particular Group. +type DnsSecurityProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated Profile + ProfilePath *string + // Sequence number used to resolve conflicts betweeen two profiles applied on the same group. Lower sequence number takes higher precedence. Two binding maps applied to the same profile must have the same sequence number. User defined sequence numbers range from 1 through 100,000. System defined sequence numbers range from 100,001 through 200,000. format: int64 + SequenceNumber *int64 +} + +func (s DnsSecurityProfileBindingMap) GetType__() bindings.BindingType { + return DnsSecurityProfileBindingMapBindingType() +} + +func (s DnsSecurityProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsSecurityProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of DNS Security Profile Binding Map +type DnsSecurityProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // DNS Security Profile Binding Map List Results + Results []DnsSecurityProfileBindingMap +} + +func (s DnsSecurityProfileBindingMapListResult) GetType__() bindings.BindingType { + return DnsSecurityProfileBindingMapListResultBindingType() +} + +func (s DnsSecurityProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsSecurityProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of DnsSecurityProfile +type DnsSecurityProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // DnsSecurityProfile list results + Results []DnsSecurityProfile +} + +func (s DnsSecurityProfileListResult) GetType__() bindings.BindingType { + return DnsSecurityProfileListResultBindingType() +} + +func (s DnsSecurityProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsSecurityProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Domain. +type Domain struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s Domain) GetType__() bindings.BindingType { + return DomainBindingType() +} + +func (s Domain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Domain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Binding of domain to the enforcement point. +type DomainDeploymentMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Path of enforcement point on which domain shall be enforced. + EnforcementPointPath *string +} + +func (s DomainDeploymentMap) GetType__() bindings.BindingType { + return DomainDeploymentMapBindingType() +} + +func (s DomainDeploymentMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DomainDeploymentMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Domain Deployment Map. +type DomainDeploymentMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Domain Deployment Map list result. + Results []DomainDeploymentMap +} + +func (s DomainDeploymentMapListResult) GetType__() bindings.BindingType { + return DomainDeploymentMapListResultBindingType() +} + +func (s DomainDeploymentMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DomainDeploymentMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Domains +type DomainListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Domain list results + Results []Domain +} + +func (s DomainListResult) GetType__() bindings.BindingType { + return DomainListResultBindingType() +} + +func (s DomainListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DomainListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents configuration of a Donut +type DonutConfiguration struct { + // Expression to retrieve count to be shown on Donut. + Count *string + // If true, displays the count of entities in the donut + DisplayCount *bool + // Displayed at the middle of the donut, by default. It labels the entities of donut. + Label *Label + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Sections + Sections []DonutSection + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DonutConfiguration__TYPE_IDENTIFIER = "DonutConfiguration" + +func (s DonutConfiguration) GetType__() bindings.BindingType { + return DonutConfigurationBindingType() +} + +func (s DonutConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DonutConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents an entity or portion to be plotted on a donut or stats chart. +type DonutPart struct { + // If the condition is met then the part will be displayed. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // A numerical value that represents the portion or entity of the donut or stats chart. + Field *string + // If true, legend will be shown only if the data for the part is available. This is applicable only if legends are specified in widget configuration. + HideEmptyLegend *bool + // If a section 'template' holds this donut or stats part, then the label is auto-generated from the fetched field values after applying the template. + Label *Label + // Hyperlink of the specified UI page that provides details. If drilldown_id is provided, then navigation cannot be used. + Navigation *string + // Additional rendering or conditional evaluation of the field values to be performed, if any. + RenderConfiguration []RenderConfiguration + // Multi-line text to be shown on tooltip while hovering over the portion. + Tooltip []Tooltip +} + +func (s DonutPart) GetType__() bindings.BindingType { + return DonutPartBindingType() +} + +func (s DonutPart) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DonutPart._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents high level logical grouping of portions or segments of a donut / stats chart. +type DonutSection struct { + // Array of portions or parts of the donut or stats chart. + Parts []DonutPart + // Field of the root of the api result set for forming parts. + RowListField *string + // If true, the section will be appled as template for forming parts. Only one part will be formed from each element of 'row_list_field'. + Template *bool +} + +func (s DonutSection) GetType__() bindings.BindingType { + return DonutSectionBindingType() +} + +func (s DonutSection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DonutSection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents configuration for dropdown filter widget. +type DropdownFilterWidgetConfiguration struct { + // Expression to specify default value of filter. + DefaultValue *string + // Defines the item of a dropdown. + DropdownItem *DropdownItem + // Placeholder message to be displayed in dropdown filter. + PlaceholderMsg *string + // If the condition is met then the static filter will be added. If no condition is provided, then the static filters will be applied unconditionally. + StaticFilterCondition *string + // Additional static items to be added in dropdown filter. Example can be 'ALL'. + StaticFilters []StaticFilter + // Alias to be used when emitting filter value. + Alias *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +func (s DropdownFilterWidgetConfiguration) GetType__() bindings.BindingType { + return DropdownFilterWidgetConfigurationBindingType() +} + +func (s DropdownFilterWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DropdownFilterWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Dropdown item definition +type DropdownItem struct { + // expression to extract display name to be shown in the drop down. + DisplayName *string + // An expression that represents the items of the dropdown filter. + Field *string + // Value of filter inside dropdown filter. + Value *string +} + +func (s DropdownItem) GetType__() bindings.BindingType { + return DropdownItemBindingType() +} + +func (s DropdownItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DropdownItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains dupliacte IP detection related discovery options. +type DuplicateIPDetectionOptions struct { + // Indicates whether duplicate IP detection should be enabled + DuplicateIpDetectionEnabled *bool +} + +func (s DuplicateIPDetectionOptions) GetType__() bindings.BindingType { + return DuplicateIPDetectionOptionsBindingType() +} + +func (s DuplicateIPDetectionOptions) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DuplicateIPDetectionOptions._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Indicate the status of End User License Agreement acceptance +type EULAAcceptance struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Acceptance status of End User License Agreement + Acceptance *bool +} + +func (s EULAAcceptance) GetType__() bindings.BindingType { + return EULAAcceptanceBindingType() +} + +func (s EULAAcceptance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EULAAcceptance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// End User License Agreement content +type EULAContent struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Content of End User License Agreement + Content *string +} + +func (s EULAContent) GetType__() bindings.BindingType { + return EULAContentBindingType() +} + +func (s EULAContent) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EULAContent._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This contains fields that captures state of Trackable entities. Edge and VPN state entities extend this object. +type EdgeConfigurationState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * EdgeConfigurationState#EdgeConfigurationState_STATE_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_SUCCESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_PARTIAL_SUCCESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_ORPHANED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNKNOWN + // * EdgeConfigurationState#EdgeConfigurationState_STATE_ERROR + // * EdgeConfigurationState#EdgeConfigurationState_STATE_IN_SYNC + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NOT_AVAILABLE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_DEPLOYMENT_QUEUED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_DEPLOYMENT_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_POWER_ON_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_REGISTRATION_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NODE_NOT_READY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NODE_READY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_POWER_OFF_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_UNDEPLOY_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_CONFIG_ERROR + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_REGISTRATION_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * EdgeConfigurationState#EdgeConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeConfigurationState#EdgeConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeConfigurationState#EdgeConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeConfigurationState#EdgeConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * EdgeConfigurationState#EdgeConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TRANSPORT_NODE_READY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_NETWORK_EDIT_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_MPA_DISCONNECTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_RENAME_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_CONFIG_EDIT_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_NETWORK_EDIT_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_RENAME_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_CONFIG_EDIT_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_CONFIG_DISCREPANCY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_NODE_REFRESH_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_REGISTRATION_TIMEDOUT + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Request identifier of the API which modified the entity. + PendingChangeList []string +} +const EdgeConfigurationState_STATE_PENDING = "pending" +const EdgeConfigurationState_STATE_IN_PROGRESS = "in_progress" +const EdgeConfigurationState_STATE_SUCCESS = "success" +const EdgeConfigurationState_STATE_FAILED = "failed" +const EdgeConfigurationState_STATE_PARTIAL_SUCCESS = "partial_success" +const EdgeConfigurationState_STATE_ORPHANED = "orphaned" +const EdgeConfigurationState_STATE_UNKNOWN = "unknown" +const EdgeConfigurationState_STATE_ERROR = "error" +const EdgeConfigurationState_STATE_IN_SYNC = "in_sync" +const EdgeConfigurationState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const EdgeConfigurationState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const EdgeConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const EdgeConfigurationState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const EdgeConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const EdgeConfigurationState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const EdgeConfigurationState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const EdgeConfigurationState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const EdgeConfigurationState_STATE_NODE_READY = "NODE_READY" +const EdgeConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const EdgeConfigurationState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const EdgeConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const EdgeConfigurationState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const EdgeConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const EdgeConfigurationState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const EdgeConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const EdgeConfigurationState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const EdgeConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const EdgeConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const EdgeConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const EdgeConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const EdgeConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const EdgeConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const EdgeConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const EdgeConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const EdgeConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const EdgeConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const EdgeConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const EdgeConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const EdgeConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const EdgeConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const EdgeConfigurationState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const EdgeConfigurationState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const EdgeConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const EdgeConfigurationState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const EdgeConfigurationState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const EdgeConfigurationState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const EdgeConfigurationState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const EdgeConfigurationState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const EdgeConfigurationState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const EdgeConfigurationState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const EdgeConfigurationState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const EdgeConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const EdgeConfigurationState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" + +func (s EdgeConfigurationState) GetType__() bindings.BindingType { + return EdgeConfigurationStateBindingType() +} + +func (s EdgeConfigurationState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeConfigurationState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A shaper that specifies egress rate properties in Mb/s +type EgressRateLimiter struct { + // Average bandwidth in Mb/s format: int32 + AverageBandwidth *int64 + // Burst size in bytes format: int32 + BurstSize *int64 + // Peak bandwidth in Mb/s format: int32 + PeakBandwidth *int64 + Enabled *bool + // Possible values are: + // + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_INGRESSRATELIMITER + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_INGRESSBROADCASTRATELIMITER + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_EGRESSRATELIMITER + // + // Type rate limiter + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EgressRateLimiter__TYPE_IDENTIFIER = "EgressRateLimiter" + +func (s EgressRateLimiter) GetType__() bindings.BindingType { + return EgressRateLimiterBindingType() +} + +func (s EgressRateLimiter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EgressRateLimiter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Ordered list of Endpoint Rules ordered by sequence number of the entries. The maximum number of policies is 25. +type EndpointPolicy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Endpoint Rules that are a part of this EndpointPolicy + EndpointRules []EndpointRule + // This field is used to resolve conflicts between maps across domains. format: int32 + SequenceNumber *int64 +} + +func (s EndpointPolicy) GetType__() bindings.BindingType { + return EndpointPolicyBindingType() +} + +func (s EndpointPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EndpointPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Endpoint Rule comes from user configuration. User configures Endpoint Rule to specify what services are applied on the groups. +type EndpointRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // We need paths as duplicate names may exist for groups under different domains. In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + Groups []string + // This field is used to resolve conflicts between multiple entries under EndpointPolicy. It will be system default value when not specified by user. format: int32 + SequenceNumber *int64 + // The policy paths of service profiles are listed here. It pecifies what services are applied on the group. Currently only one is allowed. + ServiceProfiles []string +} + +func (s EndpointRule) GetType__() bindings.BindingType { + return EndpointRuleBindingType() +} + +func (s EndpointRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EndpointRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed Realized Status of an intent object on an NSX-T type of enforcement point. This is a detailed view of the Realized Status of an intent object from an NSX-T enforcement point perspective. +type EnforcedStatusDetailsNsxt struct { + // Information about the realized status of the intent on this enforcement point. Some very recent changes may be excluded when preparing this information, which is indicated by Pending Changes Info. + EnforcedStatusInfo *EnforcedStatusInfoNsxt + // Information about pending changes, if any, that aren't reflected in the Enforced Realized Status. + PendingChangesInfo *PendingChangesInfoNsxt +} + +func (s EnforcedStatusDetailsNsxt) GetType__() bindings.BindingType { + return EnforcedStatusDetailsNsxtBindingType() +} + +func (s EnforcedStatusDetailsNsxt) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EnforcedStatusDetailsNsxt._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Information about the realized status of the intent object on an NSX-T type of enforcement point. Some very recent changes may be excluded when preparing this information, which is indicated by Pending Changes Info. In addition to the realized status across all scopes, this information holds details about enforced realized status per scope. +type EnforcedStatusInfoNsxt struct { + // Consolidated Realized Status of an Intent object across all scopes of an NSX-T type of enforcement point. + EnforcedStatus *EnforcedStatusNsxt + // List of Enforced Realized Status per Scope. + EnforcedStatusPerScope []*data.StructValue +} + +func (s EnforcedStatusInfoNsxt) GetType__() bindings.BindingType { + return EnforcedStatusInfoNsxtBindingType() +} + +func (s EnforcedStatusInfoNsxt) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EnforcedStatusInfoNsxt._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// NSX-T Enforced Status. +type EnforcedStatusNsxt struct { + // Possible values are: + // + // * EnforcedStatusNsxt#EnforcedStatusNsxt_STATUS_UNINITIALIZED + // * EnforcedStatusNsxt#EnforcedStatusNsxt_STATUS_UNKNOWN + // * EnforcedStatusNsxt#EnforcedStatusNsxt_STATUS_UP + // * EnforcedStatusNsxt#EnforcedStatusNsxt_STATUS_DOWN + // * EnforcedStatusNsxt#EnforcedStatusNsxt_STATUS_DEGRADED + // * EnforcedStatusNsxt#EnforcedStatusNsxt_STATUS_SUCCESS + // * EnforcedStatusNsxt#EnforcedStatusNsxt_STATUS_FAILURE + // * EnforcedStatusNsxt#EnforcedStatusNsxt_STATUS_IN_PROGRESS + // + // Enforced Realized Status. + Status *string + // Status Message conveying hints depending on the status value. + StatusMessage *string +} +const EnforcedStatusNsxt_STATUS_UNINITIALIZED = "UNINITIALIZED" +const EnforcedStatusNsxt_STATUS_UNKNOWN = "UNKNOWN" +const EnforcedStatusNsxt_STATUS_UP = "UP" +const EnforcedStatusNsxt_STATUS_DOWN = "DOWN" +const EnforcedStatusNsxt_STATUS_DEGRADED = "DEGRADED" +const EnforcedStatusNsxt_STATUS_SUCCESS = "SUCCESS" +const EnforcedStatusNsxt_STATUS_FAILURE = "FAILURE" +const EnforcedStatusNsxt_STATUS_IN_PROGRESS = "IN_PROGRESS" + +func (s EnforcedStatusNsxt) GetType__() bindings.BindingType { + return EnforcedStatusNsxtBindingType() +} + +func (s EnforcedStatusNsxt) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EnforcedStatusNsxt._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// NSX-T Detailed Realized Status Per Scope. +type EnforcedStatusPerScopeNsxt struct { + // Possible values are: + // + // * EnforcedStatusPerScopeNsxt#EnforcedStatusPerScopeNsxt_RESOURCE_TYPE_TRANSPORTNODESPANENFORCEDSTATUS + // + // Enforced Realized Status Per Scope Resource Type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EnforcedStatusPerScopeNsxt__TYPE_IDENTIFIER = "EnforcedStatusPerScopeNsxT" +const EnforcedStatusPerScopeNsxt_RESOURCE_TYPE_TRANSPORTNODESPANENFORCEDSTATUS = "TransportNodeSpanEnforcedStatus" + +func (s EnforcedStatusPerScopeNsxt) GetType__() bindings.BindingType { + return EnforcedStatusPerScopeNsxtBindingType() +} + +func (s EnforcedStatusPerScopeNsxt) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EnforcedStatusPerScopeNsxt._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed Realized Status Per Transport Node. +type EnforcedStatusPerTransportNode struct { + // Display name of the transport node. + DisplayName *string + // Realized Status of an Intent object on this Transport Node. + EnforcedStatus *EnforcedStatusNsxt + // UUID identifying uniquely the Transport Node. + NsxId *string + // Policy Path referencing the transport node. + Path *string +} + +func (s EnforcedStatusPerTransportNode) GetType__() bindings.BindingType { + return EnforcedStatusPerTransportNodeBindingType() +} + +func (s EnforcedStatusPerTransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EnforcedStatusPerTransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Enforcement point is the endpoint where policy configurations are applied. +type EnforcementPoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Auto enforce flag suggests whether the policy objects shall be automatically enforced on this enforcement point or not. When this flag is set to true, all policy objects will be automatically enforced on this enforcement point. If this flag is set to false, user shall rely on the usual means of realization, i.e., deployment maps. + AutoEnforce *bool + // Connection Info of the Enforcement Point. + ConnectionInfo *data.StructValue + // Version of the Enforcement point. + Version *string +} + +func (s EnforcementPoint) GetType__() bindings.BindingType { + return EnforcementPointBindingType() +} + +func (s EnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains information required to connect to enforcement point. +type EnforcementPointConnectionInfo struct { + // Value of this property could be Hostname or IP. For instance: - On an NSX-T MP running on default port, the value could be \"10.192.1.1\" - On an NSX-T MP running on custom port, the value could be \"192.168.1.1:32789\" - On an NSX-T MP in VMC deployments, the value could be \"192.168.1.1:5480/nsxapi\" + EnforcementPointAddress *string + // Possible values are: + // + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXTCONNECTIONINFO + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXVCONNECTIONINFO + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_CVXCONNECTIONINFO + // + // Resource Type of Enforcement Point Connection Info. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EnforcementPointConnectionInfo__TYPE_IDENTIFIER = "EnforcementPointConnectionInfo" +const EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXTCONNECTIONINFO = "NSXTConnectionInfo" +const EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXVCONNECTIONINFO = "NSXVConnectionInfo" +const EnforcementPointConnectionInfo_RESOURCE_TYPE_CVXCONNECTIONINFO = "CvxConnectionInfo" + +func (s EnforcementPointConnectionInfo) GetType__() bindings.BindingType { + return EnforcementPointConnectionInfoBindingType() +} + +func (s EnforcementPointConnectionInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EnforcementPointConnectionInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of enforcement points. +type EnforcementPointListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Enforcement Point list Results. + Results []EnforcementPoint +} + +func (s EnforcementPointListResult) GetType__() bindings.BindingType { + return EnforcementPointListResultBindingType() +} + +func (s EnforcementPointListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EnforcementPointListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the leaf level constraint to restrict the number instances of an entity type can be created. This is useful in restricting number of CGWs or MGWs or Providers that can created in a system. +type EntityInstanceCountConstraintExpression struct { + // Instance count. format: int64 + Count *int64 + // Operations supported '<' and '<='. + Operator *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_VALUECONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_RELATEDATTRIBUTECONDITIONALEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_ENTITYINSTANCECOUNTCONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_FIELDSANITYCONSTRAINTEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EntityInstanceCountConstraintExpression__TYPE_IDENTIFIER = "EntityInstanceCountConstraintExpression" + +func (s EntityInstanceCountConstraintExpression) GetType__() bindings.BindingType { + return EntityInstanceCountConstraintExpressionBindingType() +} + +func (s EntityInstanceCountConstraintExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EntityInstanceCountConstraintExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Metadata related to a given error_id +type ErrorResolverInfo struct { + // The error id for which metadata information is needed format: int64 + ErrorId *int64 + // Indicates whether there is a resolver associated with the error or not + ResolverPresent *bool + // User supplied metadata that might be required by the resolver + UserMetadata *ErrorResolverUserMetadata +} + +func (s ErrorResolverInfo) GetType__() bindings.BindingType { + return ErrorResolverInfoBindingType() +} + +func (s ErrorResolverInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Collection of all registered ErrorResolverInfo +type ErrorResolverInfoList struct { + // ErrorResolverInfo list + Results []ErrorResolverInfo +} + +func (s ErrorResolverInfoList) GetType__() bindings.BindingType { + return ErrorResolverInfoListBindingType() +} + +func (s ErrorResolverInfoList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverInfoList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Error along with its metadata +type ErrorResolverMetadata struct { + // The entity/node UUID where the error has occurred. + EntityId *string + // The error id as reported by the entity where the error occurred. format: int64 + ErrorId *int64 + // This can come from some external system like syslog collector + SystemMetadata *ErrorResolverSystemMetadata + // User supplied metadata that might be required by the resolver + UserMetadata *ErrorResolverUserMetadata +} + +func (s ErrorResolverMetadata) GetType__() bindings.BindingType { + return ErrorResolverMetadataBindingType() +} + +func (s ErrorResolverMetadata) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverMetadata._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// List of errors with their metadata +type ErrorResolverMetadataList struct { + // List of errors with their corresponding metadata. + Errors []ErrorResolverMetadata +} + +func (s ErrorResolverMetadataList) GetType__() bindings.BindingType { + return ErrorResolverMetadataListBindingType() +} + +func (s ErrorResolverMetadataList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverMetadataList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Metadata fetched from an external system like Syslog or LogInsight. +type ErrorResolverSystemMetadata struct { + // The value fetched from another system + Value *string +} + +func (s ErrorResolverSystemMetadata) GetType__() bindings.BindingType { + return ErrorResolverSystemMetadataBindingType() +} + +func (s ErrorResolverSystemMetadata) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverSystemMetadata._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Corresponds to one property entered by the user +type ErrorResolverUserInputData struct { + // Possible values are: + // + // * ErrorResolverUserInputData#ErrorResolverUserInputData_DATA_TYPE_TEXT + // * ErrorResolverUserInputData#ErrorResolverUserInputData_DATA_TYPE_NUMBER + // * ErrorResolverUserInputData#ErrorResolverUserInputData_DATA_TYPE_PASSWORD + // + // The datatype of the given property. Useful for data validation + DataType *string + // Name of the property supplied by the user + PropertyName *string + // The value associated with the above property + PropertyValue *string +} +const ErrorResolverUserInputData_DATA_TYPE_TEXT = "TEXT" +const ErrorResolverUserInputData_DATA_TYPE_NUMBER = "NUMBER" +const ErrorResolverUserInputData_DATA_TYPE_PASSWORD = "PASSWORD" + +func (s ErrorResolverUserInputData) GetType__() bindings.BindingType { + return ErrorResolverUserInputDataBindingType() +} + +func (s ErrorResolverUserInputData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverUserInputData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// User supplied metadata needed for resolving errors +type ErrorResolverUserMetadata struct { + // List of user supplied input data. + UserInputList []ErrorResolverUserInputData +} + +func (s ErrorResolverUserMetadata) GetType__() bindings.BindingType { + return ErrorResolverUserMetadataBindingType() +} + +func (s ErrorResolverUserMetadata) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverUserMetadata._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A ServiceEntry that represents an ethertype protocol +type EtherTypeServiceEntry struct { + // Type of the encapsulated protocol format: int64 + EtherType *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EtherTypeServiceEntry__TYPE_IDENTIFIER = "EtherTypeServiceEntry" + +func (s EtherTypeServiceEntry) GetType__() bindings.BindingType { + return EtherTypeServiceEntryBindingType() +} + +func (s EtherTypeServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EtherTypeServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type EthernetHeader struct { + // The destination MAC address of form: \"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$\". For example: 00:00:00:00:00:00. + DstMac *string + // This field defaults to IPv4. format: int64 + EthType *int64 + // The source MAC address of form: \"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$\". For example: 00:00:00:00:00:00. + SrcMac *string +} + +func (s EthernetHeader) GetType__() bindings.BindingType { + return EthernetHeaderBindingType() +} + +func (s EthernetHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EthernetHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Criterion Evaluation is the basic logical condition to evaluate whether the event could be potentially met. +type Evaluation struct { + // Possible values are: + // + // * Evaluation#Evaluation_RESOURCE_TYPE_SOURCEFIELDEVALUATION + // + // Criterion Evaluation resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const Evaluation__TYPE_IDENTIFIER = "Evaluation" +const Evaluation_RESOURCE_TYPE_SOURCEFIELDEVALUATION = "SourceFieldEvaluation" + +func (s Evaluation) GetType__() bindings.BindingType { + return EvaluationBindingType() +} + +func (s Evaluation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Evaluation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The Event is the criterion or criteria applied to the source and, when met, prompt Policy to run the action. All Reaction Events are constructed with reference to the object, the \"source\", that is logically deemed to be the object upon which the Event in question initially occurred upon. Some example events include: - New object was created. - Change in realization state. - Specific API is called. +type Event struct { + // Criteria applied to the source and, if satisfied, would trigger the action. Criteria is composed of criterions. In order for the Criteria to be met, only one of the criterion must be fulfilled (implicit OR). + Criteria []Criterion + // Source that is logically deemed to be the \"object\" upon which the Event in question initially occurred upon. + Source *data.StructValue +} + +func (s Event) GetType__() bindings.BindingType { + return EventBindingType() +} + +func (s Event) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Event._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Evpn Configuration. +type EvpnConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Encapsulation method for EVPN service that is used by the transport layer. + EncapsulationMethod *EvpnEncapConfig + // Possible values are: + // + // * EvpnConfig#EvpnConfig_MODE_INLINE + // + // EVPN service mode + Mode *string +} +const EvpnConfig_MODE_INLINE = "INLINE" + +func (s EvpnConfig) GetType__() bindings.BindingType { + return EvpnConfigBindingType() +} + +func (s EvpnConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EvpnConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Encapsulation method for EVPN. +type EvpnEncapConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // vni pool path + VniPoolPath *string +} + +func (s EvpnEncapConfig) GetType__() bindings.BindingType { + return EvpnEncapConfigBindingType() +} + +func (s EvpnEncapConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EvpnEncapConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Evpn Tunnel Endpoint Configuration. +type EvpnTunnelEndpointConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // edge path + EdgePath *string + // local addresses format: ipv4 + LocalAddresses []string + // MTU format: int32 + Mtu *int64 +} + +func (s EvpnTunnelEndpointConfig) GetType__() bindings.BindingType { + return EvpnTunnelEndpointConfigBindingType() +} + +func (s EvpnTunnelEndpointConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EvpnTunnelEndpointConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// All the nodes of the expression extend from this abstract class. This is present for extensibility. +type Expression struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const Expression__TYPE_IDENTIFIER = "Expression" +const Expression_RESOURCE_TYPE_CONDITION = "Condition" +const Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR = "ConjunctionOperator" +const Expression_RESOURCE_TYPE_NESTEDEXPRESSION = "NestedExpression" +const Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION = "IPAddressExpression" +const Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION = "MACAddressExpression" +const Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION = "ExternalIDExpression" +const Expression_RESOURCE_TYPE_PATHEXPRESSION = "PathExpression" +const Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION = "IdentityGroupExpression" + +func (s Expression) GetType__() bindings.BindingType { + return ExpressionBindingType() +} + +func (s Expression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Expression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents external ID expressions in the form of an array, to support addition of objects like virtual interfaces, virtual machines, CloudNativeServiceInstance PhysicalServer to a group. +type ExternalIDExpression struct { + // This array can consist of one or more external IDs for the specified member type. + ExternalIds []string + // Possible values are: + // + // * ExternalIDExpression#ExternalIDExpression_MEMBER_TYPE_VIRTUALMACHINE + // * ExternalIDExpression#ExternalIDExpression_MEMBER_TYPE_VIRTUALNETWORKINTERFACE + // * ExternalIDExpression#ExternalIDExpression_MEMBER_TYPE_CLOUDNATIVESERVICEINSTANCE + // * ExternalIDExpression#ExternalIDExpression_MEMBER_TYPE_PHYSICALSERVER + // + // External ID member type + MemberType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ExternalIDExpression__TYPE_IDENTIFIER = "ExternalIDExpression" +const ExternalIDExpression_MEMBER_TYPE_VIRTUALMACHINE = "VirtualMachine" +const ExternalIDExpression_MEMBER_TYPE_VIRTUALNETWORKINTERFACE = "VirtualNetworkInterface" +const ExternalIDExpression_MEMBER_TYPE_CLOUDNATIVESERVICEINSTANCE = "CloudNativeServiceInstance" +const ExternalIDExpression_MEMBER_TYPE_PHYSICALSERVER = "PhysicalServer" + +func (s ExternalIDExpression) GetType__() bindings.BindingType { + return ExternalIDExpressionBindingType() +} + +func (s ExternalIDExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ExternalIDExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Global configuration +type FIPSGlobalConfig struct { + // When this flag is set to true FIPS mode will be set on ssl encryptions of load balancer feature. + LbFipsEnabled *bool +} + +func (s FIPSGlobalConfig) GetType__() bindings.BindingType { + return FIPSGlobalConfigBindingType() +} + +func (s FIPSGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FIPSGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Feature Permission +type FeaturePermission struct { + // Feature Id + Feature *string + // Feature Description + FeatureDescription *string + // Feature Name + FeatureName *string + // Is execute recommended + IsExecuteRecommended *bool + // Is internal + IsInternal *bool + // Possible values are: + // + // * FeaturePermission#FeaturePermission_PERMISSION_CRUD + // * FeaturePermission#FeaturePermission_PERMISSION_READ + // * FeaturePermission#FeaturePermission_PERMISSION_EXECUTE + // * FeaturePermission#FeaturePermission_PERMISSION_NONE + // + // Permission + Permission *string +} +const FeaturePermission_PERMISSION_CRUD = "crud" +const FeaturePermission_PERMISSION_READ = "read" +const FeaturePermission_PERMISSION_EXECUTE = "execute" +const FeaturePermission_PERMISSION_NONE = "none" + +func (s FeaturePermission) GetType__() bindings.BindingType { + return FeaturePermissionBindingType() +} + +func (s FeaturePermission) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeaturePermission._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type FederationComponentUpgradeStatus struct { + // Component type for the upgrade status + ComponentType *string + // Mapping of current versions of nodes and counts of nodes at the respective versions. + CurrentVersionNodeSummary []FederationNodeSummary + // Details about the upgrade status + Details *string + // Indicator of upgrade progress in percentage + PercentComplete *float64 + // Possible values are: + // + // * FederationComponentUpgradeStatus#FederationComponentUpgradeStatus_STATUS_SUCCESS + // * FederationComponentUpgradeStatus#FederationComponentUpgradeStatus_STATUS_FAILED + // * FederationComponentUpgradeStatus#FederationComponentUpgradeStatus_STATUS_IN_PROGRESS + // * FederationComponentUpgradeStatus#FederationComponentUpgradeStatus_STATUS_NOT_STARTED + // * FederationComponentUpgradeStatus#FederationComponentUpgradeStatus_STATUS_PAUSED + // + // Upgrade status of component + Status *string + // Target component version + TargetVersion *string +} +const FederationComponentUpgradeStatus_STATUS_SUCCESS = "SUCCESS" +const FederationComponentUpgradeStatus_STATUS_FAILED = "FAILED" +const FederationComponentUpgradeStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const FederationComponentUpgradeStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const FederationComponentUpgradeStatus_STATUS_PAUSED = "PAUSED" + +func (s FederationComponentUpgradeStatus) GetType__() bindings.BindingType { + return FederationComponentUpgradeStatusBindingType() +} + +func (s FederationComponentUpgradeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationComponentUpgradeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Global Manager federation configuration. This configuration is distributed to all Sites participating in federation. +type FederationConfig struct { + // Federation configurations of all Sites + SiteConfig []SiteFederationConfig +} + +func (s FederationConfig) GetType__() bindings.BindingType { + return FederationConfigBindingType() +} + +func (s FederationConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Additional configuration required for federation. +type FederationConnectivityConfig struct { + // Global id for by Layer3 services for federation usecases. format: int64 + GlobalOverlayId *int64 +} + +func (s FederationConnectivityConfig) GetType__() bindings.BindingType { + return FederationConnectivityConfigBindingType() +} + +func (s FederationConnectivityConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationConnectivityConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Additional gateway configuration required for federation +type FederationGatewayConfig struct { + // Global id for by Layer3 services for federation usecases. format: int64 + GlobalOverlayId *int64 + // Indicies for cross site allocation for edge cluster and its members referred by gateway. + SiteAllocationIndices []SiteAllocationIndexForEdge + // Global UUID for transit segment id to be used by Layer2 services for federation usecases. + TransitSegmentId *string +} + +func (s FederationGatewayConfig) GetType__() bindings.BindingType { + return FederationGatewayConfigBindingType() +} + +func (s FederationGatewayConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationGatewayConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type FederationNodeSummary struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Number of nodes of the type and at the component version. format: int32 + NodeCount *int64 + // Component version + Version *string +} + +func (s FederationNodeSummary) GetType__() bindings.BindingType { + return FederationNodeSummaryBindingType() +} + +func (s FederationNodeSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationNodeSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Provides upgrade summary for a specific site. +type FederationUpgradeSummary struct { + // List of component statuses + ComponentStatus []FederationComponentUpgradeStatus + // This is NSX version for the site. + CurrentVersion *string + // Name of the global manager if present. + GpmName *string + // Unique identifier of this resource. + Id *string + // Indicates the time when the site was upgraded. + LastUpgradeTimestamp *string + // Name of the site. + Name *string + // Possible values are: + // + // * FederationUpgradeSummary#FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_SUCCESS + // * FederationUpgradeSummary#FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_FAILED + // * FederationUpgradeSummary#FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_IN_PROGRESS + // * FederationUpgradeSummary#FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_NOT_STARTED + // * FederationUpgradeSummary#FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_PAUSED + // + // Status of upgrade + OverallUpgradeStatus *string + // This is the Site Manager generated UUID for every NSX deployment. + SiteId *string + // IP address of the site. + SiteIp *string + // Possible values are: + // + // * FederationUpgradeSummary#FederationUpgradeSummary_SITE_TYPE_ACTIVE_GM_SITE + // * FederationUpgradeSummary#FederationUpgradeSummary_SITE_TYPE_STANDBY_GM_SITE + // * FederationUpgradeSummary#FederationUpgradeSummary_SITE_TYPE_NON_GM_SITE + // + // Type of this site. + SiteType *string + // This is NSX target version for the site, if it is undergoing upgrade. + TargetVersion *string +} +const FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_SUCCESS = "SUCCESS" +const FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_FAILED = "FAILED" +const FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_IN_PROGRESS = "IN_PROGRESS" +const FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_NOT_STARTED = "NOT_STARTED" +const FederationUpgradeSummary_OVERALL_UPGRADE_STATUS_PAUSED = "PAUSED" +const FederationUpgradeSummary_SITE_TYPE_ACTIVE_GM_SITE = "ACTIVE_GM_SITE" +const FederationUpgradeSummary_SITE_TYPE_STANDBY_GM_SITE = "STANDBY_GM_SITE" +const FederationUpgradeSummary_SITE_TYPE_NON_GM_SITE = "NON_GM_SITE" + +func (s FederationUpgradeSummary) GetType__() bindings.BindingType { + return FederationUpgradeSummaryBindingType() +} + +func (s FederationUpgradeSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationUpgradeSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of site upgrade information +type FederationUpgradeSummaryListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of site upgrade information + Results []FederationUpgradeSummary +} + +func (s FederationUpgradeSummaryListResult) GetType__() bindings.BindingType { + return FederationUpgradeSummaryListResultBindingType() +} + +func (s FederationUpgradeSummaryListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationUpgradeSummaryListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the field value constraint to constrain specified field value based on defined sanity checks. Example - For DNS.upstream_servers, all the IP addresses must either be public or private. { \"target\": { \"target_resource_type\": \"DnsForwarderZone\", \"attribute\": \"upstreamServers\", \"path_prefix\": \"/infra/dns-forwarder-zones/\" }, \"constraint_expression\": { \"resource_type\": \"FieldSanityConstraintExpression\", \"operator\": \"OR\", \"checks\": [\"ALL_PUBLIC_IPS\", \"ALL_PRIVATE_IPS\"] } } +type FieldSanityConstraintExpression struct { + // Possible values are: + // + // * FieldSanityConstraintExpression#FieldSanityConstraintExpression_CHECKS_PUBLIC_IPS + // * FieldSanityConstraintExpression#FieldSanityConstraintExpression_CHECKS_PRIVATE_IPS + // + // List of sanity checks. + Checks []string + // Possible values are: + // + // * FieldSanityConstraintExpression#FieldSanityConstraintExpression_OPERATOR_OR + // * FieldSanityConstraintExpression#FieldSanityConstraintExpression_OPERATOR_AND + // + // A conditional operator + Operator *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_VALUECONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_RELATEDATTRIBUTECONDITIONALEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_ENTITYINSTANCECOUNTCONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_FIELDSANITYCONSTRAINTEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FieldSanityConstraintExpression__TYPE_IDENTIFIER = "FieldSanityConstraintExpression" +const FieldSanityConstraintExpression_CHECKS_PUBLIC_IPS = "ALL_PUBLIC_IPS" +const FieldSanityConstraintExpression_CHECKS_PRIVATE_IPS = "ALL_PRIVATE_IPS" +const FieldSanityConstraintExpression_OPERATOR_OR = "OR" +const FieldSanityConstraintExpression_OPERATOR_AND = "AND" + +func (s FieldSanityConstraintExpression) GetType__() bindings.BindingType { + return FieldSanityConstraintExpressionBindingType() +} + +func (s FieldSanityConstraintExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FieldSanityConstraintExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Field Setting. +type FieldSetting struct { + // Field Pointer. + FieldPointer *string + // Value that the field must be set to. + Value *data.StructValue +} + +func (s FieldSetting) GetType__() bindings.BindingType { + return FieldSettingBindingType() +} + +func (s FieldSetting) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FieldSetting._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Field Setting Value. +type FieldSettingValue struct { + // Possible values are: + // + // * FieldSettingValue#FieldSettingValue_RESOURCE_TYPE_CONSTANTFIELDVALUE + // + // Field Setting Value resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FieldSettingValue__TYPE_IDENTIFIER = "FieldSettingValue" +const FieldSettingValue_RESOURCE_TYPE_CONSTANTFIELDVALUE = "ConstantFieldValue" + +func (s FieldSettingValue) GetType__() bindings.BindingType { + return FieldSettingValueBindingType() +} + +func (s FieldSettingValue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FieldSettingValue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type FieldsPacketData struct { + // The ARP header + ArpHeader *ArpHeader + // The ethernet header + EthHeader *EthernetHeader + // The IPv4 header + IpHeader *Ipv4Header + // The IPv6 header + Ipv6Header *Ipv6Header + // Up to 1000 bytes of payload may be supplied (with a base64-encoded length of 1336 bytes.) Additional bytes of traceflow metadata will be appended to the payload. The payload contains any data the user wants to put after the transport header. + Payload *string + // This field contains a protocol that is above IP. It is not restricted to the 'transport' defined by the OSI model (e.g., ICMP is supported). + TransportHeader *TransportProtocolHeader + // If the requested frame_size is too small (given the payload and traceflow metadata requirement of 16 bytes), the traceflow request will fail with an appropriate message. The frame will be zero padded to the requested size. format: int64 + FrameSize *int64 + // Possible values are: + // + // * PacketData#PacketData_RESOURCE_TYPE_BINARYPACKETDATA + // * PacketData#PacketData_RESOURCE_TYPE_FIELDSPACKETDATA + // + // Packet configuration + ResourceType string + // A flag, when set true, indicates that the traceflow packet is of L3 routing. + Routed *bool + // Possible values are: + // + // * PacketData#PacketData_TRANSPORT_TYPE_BROADCAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNICAST + // * PacketData#PacketData_TRANSPORT_TYPE_MULTICAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNKNOWN + // + // transport type of the traceflow packet + TransportType *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FieldsPacketData__TYPE_IDENTIFIER = "FieldsPacketData" + +func (s FieldsPacketData) GetType__() bindings.BindingType { + return FieldsPacketDataBindingType() +} + +func (s FieldsPacketData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FieldsPacketData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Remote server authentication details +type FileTransferAuthenticationScheme struct { + // Password to authenticate with + Password *string + // Possible values are: + // + // * FileTransferAuthenticationScheme#FileTransferAuthenticationScheme_SCHEME_NAME_PASSWORD + // + // Authentication scheme name + SchemeName *string + // User name to authenticate with + Username *string +} +const FileTransferAuthenticationScheme_SCHEME_NAME_PASSWORD = "PASSWORD" + +func (s FileTransferAuthenticationScheme) GetType__() bindings.BindingType { + return FileTransferAuthenticationSchemeBindingType() +} + +func (s FileTransferAuthenticationScheme) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FileTransferAuthenticationScheme._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Protocol to transfer backup file to remote server +type FileTransferProtocol struct { + // Scheme to authenticate if required + AuthenticationScheme *FileTransferAuthenticationScheme + // Possible values are: + // + // * FileTransferProtocol#FileTransferProtocol_PROTOCOL_NAME_SFTP + // + // Protocol name + ProtocolName *string + // The expected SSH fingerprint of the server. If the server's fingerprint does not match this fingerprint, the connection will be terminated. Only ECDSA fingerprints hashed with SHA256 are supported. To obtain the host's ssh fingerprint, you should connect via some method other than SSH to obtain this information. You can use one of these commands to view the key's fingerprint: 1. ssh-keygen -l -E sha256 -f ssh_host_ecdsa_key.pub 2. awk '{print $2}' ssh_host_ecdsa_key.pub | base64 -d | sha256sum -b | sed 's/ .\*$//' | xxd -r -p | base64 | sed 's/.//44g' | awk '{print \"SHA256:\"$1}' + SshFingerprint *string +} +const FileTransferProtocol_PROTOCOL_NAME_SFTP = "sftp" + +func (s FileTransferProtocol) GetType__() bindings.BindingType { + return FileTransferProtocolBindingType() +} + +func (s FileTransferProtocol) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FileTransferProtocol._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents configuration for filter widget. This is abstract representation of filter widget. +type FilterWidgetConfiguration struct { + // Alias to be used when emitting filter value. + Alias *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FilterWidgetConfiguration__TYPE_IDENTIFIER = "FilterWidgetConfiguration" + +func (s FilterWidgetConfiguration) GetType__() bindings.BindingType { + return FilterWidgetConfigurationBindingType() +} + +func (s FilterWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FilterWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Firewall related configurations +type FirewallConfiguration struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * FirewallConfiguration#FirewallConfiguration_RESOURCE_TYPE_DFWFIREWALLCONFIGURATION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // To disable auto drafts, set it to true. By default, auto drafts are enabled. + DisableAutoDrafts *bool + // If set to true, Firewall is enabled. + EnableFirewall *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FirewallConfiguration__TYPE_IDENTIFIER = "FirewallConfiguration" +const FirewallConfiguration_RESOURCE_TYPE_DFWFIREWALLCONFIGURATION = "DfwFirewallConfiguration" + +func (s FirewallConfiguration) GetType__() bindings.BindingType { + return FirewallConfigurationBindingType() +} + +func (s FirewallConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a generic firewall identity store (e.g. Microsoft AD) The firewall identity store allow access to the directory group via LDAP protocol. +type FirewallIdentityStore struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Each active directory domain has a domain naming context (NC), which contains domain-specific data. The root of this naming context is represented by a domain's distinguished name (DN) and is typically referred to as the NC head. + BaseDistinguishedName *string + // Directory domain LDAP servers' information including host, name, port, protocol and so on. + LdapServers []FirewallIdentityStoreLdapServer + // Directory domain name which best describes the domain. It could be unique fqdn name or it could also be descriptive. There is no unique contraint for domain name among different domains. + Name *string + // NetBIOS names can contain all alphanumeric characters except for the certain disallowed characters. Names can contain a period, but names cannot start with a period. NetBIOS is similar to DNS in that it can serve as a directory service, but more limited as it has no provisions for a name hierarchy and names are limited to 15 characters. The netbios name is case insensitive and is stored in upper case regardless of input case. + NetbiosName *string + // SelectiveSync settings toggle the SelectiveSync feature and selected OrgUnits. If this is not specified, SelectiveSync is disabled by default. + SelectiveSyncSettings *FirewallIdentityStoreSelectiveSyncSettings + // Each domain sync settings can be changed using this object. It is not required since there are default values used if there is no specification for this object. + SyncSettings *FirewallIdentityStoreSyncSettings +} + +func (s FirewallIdentityStore) GetType__() bindings.BindingType { + return FirewallIdentityStoreBindingType() +} + +func (s FirewallIdentityStore) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallIdentityStore._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Firewall identity LDAP server +type FirewallIdentityStoreLdapServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Directory domain name which best describes the domain. It could be unique fqdn name or it could also be descriptive. There is no unique constraint for domain name among different domains. + DomainName *string + // Directory LDAP server DNS host name or ip address which is reachable by NSX manager to be connected and do object synchronization. format: ip-or-hostname + Host *string + // Directory LDAP server connection password. + Password *string + // Directory LDAP server connection TCP/UDP port. format: int32 + Port *int64 + // Possible values are: + // + // * FirewallIdentityStoreLdapServer#FirewallIdentityStoreLdapServer_PROTOCOL_LDAP + // * FirewallIdentityStoreLdapServer#FirewallIdentityStoreLdapServer_PROTOCOL_LDAPS + // + // Directory LDAP server connection protocol which is either LDAP or LDAPS. + Protocol *string + // Directory LDAP server certificate thumbprint used in secure LDAPS connection. + Thumbprint *string + // Directory LDAP server connection user name. + Username *string +} +const FirewallIdentityStoreLdapServer_PROTOCOL_LDAP = "LDAP" +const FirewallIdentityStoreLdapServer_PROTOCOL_LDAPS = "LDAPS" + +func (s FirewallIdentityStoreLdapServer) GetType__() bindings.BindingType { + return FirewallIdentityStoreLdapServerBindingType() +} + +func (s FirewallIdentityStoreLdapServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallIdentityStoreLdapServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Firewall identity selective sync settings +type FirewallIdentityStoreSelectiveSyncSettings struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Enable or disable SelectiveSync + Enabled *bool + // If SelectiveSync is enabled, this contains 1 or more OrgUnits, NSX will synchronize with in LDAP server. If SelectiveSync is disabled, do not define this or specify an empty list. + SelectedOrgUnits []string +} + +func (s FirewallIdentityStoreSelectiveSyncSettings) GetType__() bindings.BindingType { + return FirewallIdentityStoreSelectiveSyncSettingsBindingType() +} + +func (s FirewallIdentityStoreSelectiveSyncSettings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallIdentityStoreSelectiveSyncSettings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Firewall identity synchronization settings +type FirewallIdentityStoreSyncSettings struct { + // Directory domain delta synchronization interval time between two delta sync in minutes. format: int64 + DeltaSyncInterval *int64 + // Directory domain full synchronization schedule using cron expression. For example, cron expression \"0 0 12 ? \* SUN \*\" means full sync is scheduled every Sunday midnight. If this object is null, it means there is no background cron job running for full sync. + FullSyncCronExpr *string + // Sync delay after Directory domain has been successfully created. if delay is -1, initial full sync will not be triggered. format: int32 + SyncDelayInSec *int64 +} + +func (s FirewallIdentityStoreSyncSettings) GetType__() bindings.BindingType { + return FirewallIdentityStoreSyncSettingsBindingType() +} + +func (s FirewallIdentityStoreSyncSettings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallIdentityStoreSyncSettings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A profile holding TCP, UDP and ICMP and other protcol connection limits. +type FloodProtectionProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * FloodProtectionProfile#FloodProtectionProfile_RESOURCE_TYPE_GATEWAYFLOODPROTECTIONPROFILE + // * FloodProtectionProfile#FloodProtectionProfile_RESOURCE_TYPE_DISTRIBUTEDFLOODPROTECTIONPROFILE + // + // GatewayFloodProtectionProfile is used for all Tier0 and Tier1 gateways. DistributedFloodProtectionProfile is used for all Transport Nodes. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If this field is empty, firewall will not set a limit to active ICMP connections. format: int64 + IcmpActiveFlowLimit *int64 + // If this field is empty, firewall will not set a limit to other active connections. besides UDP, ICMP and half open TCP connections. format: int64 + OtherActiveConnLimit *int64 + // If this field is empty, firewall will not set a limit to half open TCP connections. format: int64 + TcpHalfOpenConnLimit *int64 + // If this field is empty, firewall will not set a limit to active UDP connections. format: int64 + UdpActiveFlowLimit *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FloodProtectionProfile__TYPE_IDENTIFIER = "FloodProtectionProfile" +const FloodProtectionProfile_RESOURCE_TYPE_GATEWAYFLOODPROTECTIONPROFILE = "GatewayFloodProtectionProfile" +const FloodProtectionProfile_RESOURCE_TYPE_DISTRIBUTEDFLOODPROTECTIONPROFILE = "DistributedFloodProtectionProfile" + +func (s FloodProtectionProfile) GetType__() bindings.BindingType { + return FloodProtectionProfileBindingType() +} + +func (s FloodProtectionProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FloodProtectionProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of flood protection profile binding maps +type FloodProtectionProfileBindingListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Flood protection profile binding maps list results + Results []FloodProtectionProfileBindingMap +} + +func (s FloodProtectionProfileBindingListResult) GetType__() bindings.BindingType { + return FloodProtectionProfileBindingListResultBindingType() +} + +func (s FloodProtectionProfileBindingListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FloodProtectionProfileBindingListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between Flood Protection profile and Logical Routers. +type FloodProtectionProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated Profile + ProfilePath *string +} + +func (s FloodProtectionProfileBindingMap) GetType__() bindings.BindingType { + return FloodProtectionProfileBindingMapBindingType() +} + +func (s FloodProtectionProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FloodProtectionProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of flood protection profiles +type FloodProtectionProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Flood protection profile list results + Results []*data.StructValue +} + +func (s FloodProtectionProfileListResult) GetType__() bindings.BindingType { + return FloodProtectionProfileListResultBindingType() +} + +func (s FloodProtectionProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FloodProtectionProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Footer of a widget that provides additional information or allows an action such as clickable url for navigation. An example usage of footer is provided under 'example_request' section of 'CreateWidgetConfiguration' API. +type Footer struct { + // Action to be performed at the footer of a widget. An action at the footer can be simple text description or a hyperlink to a UI page. Action allows a clickable url for navigation. An example usage of footer action is provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Actions []FooterAction + // If the condition is met then the footer will be applied. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string +} + +func (s Footer) GetType__() bindings.BindingType { + return FooterBindingType() +} + +func (s Footer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Footer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Action specified at the footer of a widget to provide additional information or to provide a clickable url for navigation. An example usage of footer action is provided under the 'example_request' section of 'CreateWidgetConfiguration' API. +type FooterAction struct { + // If true, the footer will appear in the underlying container that holds the widget. + DockToContainerFooter *bool + // Label to be displayed against the footer action. + Label *Label + // Hyperlink to the UI page that provides details of action. + Url *string +} + +func (s FooterAction) GetType__() bindings.BindingType { + return FooterActionBindingType() +} + +func (s FooterAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FooterAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains ordered list of forwarding rules that determine when to forward traffic to / from the underlay for accessing cloud native services. +type ForwardingPolicy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // - Distributed Firewall - Policy framework provides five pre-defined categories for classifying a security policy. They are \"Ethernet\",\"Emergency\", \"Infrastructure\" \"Environment\" and \"Application\". There is a pre-determined order in which the policy framework manages the priority of these security policies. Ethernet category is for supporting layer 2 firewall rules. The other four categories are applicable for layer 3 rules. Amongst them, the Emergency category has the highest priority followed by Infrastructure, Environment and then Application rules. Administrator can choose to categorize a security policy into the above categories or can choose to leave it empty. If empty it will have the least precedence w.r.t the above four categories. - Edge Firewall - Policy Framework for Edge Firewall provides six pre-defined categories \"Emergency\", \"SystemRules\", \"SharedPreRules\", \"LocalGatewayRules\", \"AutoServiceRules\" and \"Default\", in order of priority of rules. All categories are allowed for Gatetway Policies that belong to 'default' Domain. However, for user created domains, category is restricted to \"SharedPreRules\" or \"LocalGatewayRules\" only. Also, the users can add/modify/delete rules from only the \"SharedPreRules\" and \"LocalGatewayRules\" categories. If user doesn't specify the category then defaulted to \"Rules\". System generated category is used by NSX created rules, for example BFD rules. Autoplumbed category used by NSX verticals to autoplumb data path rules. Finally, \"Default\" category is the placeholder default rules with lowest in the order of priority. + Category *string + // Comments for security policy lock/unlock. + Comments *string + // This field is to indicate the internal sequence number of a policy with respect to the policies across categories. format: int32 + InternalSequenceNumber *int64 + // A flag to indicate whether policy is a default policy. + IsDefault *bool + // ID of the user who last modified the lock for the secruity policy. + LockModifiedBy *string + // SecurityPolicy locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Indicates whether a security policy should be locked. If the security policy is locked by a user, then no other user would be able to modify this security policy. Once the user releases the lock, other users can update this security policy. + Locked *bool + // The count of rules in the policy. format: int32 + RuleCount *int64 + // Provides a mechanism to apply the rules in this policy for a specified time duration. + SchedulerPath *string + // The list of group paths where the rules in this policy will get applied. This scope will take precedence over rule level scope. Supported only for security and redirection policies. In case of RedirectionPolicy, it is expected only when the policy is NS and redirecting to service chain. + Scope []string + // This field is used to resolve conflicts between security policies across domains. In order to change the sequence number of a policy one can fire a POST request on the policy entity with a query parameter action=revise The sequence number field will reflect the value of the computed sequence number upon execution of the above mentioned POST request. For scenarios where the administrator is using a template to update several security policies, the only way to set the sequence number is to explicitly specify the sequence number for each security policy. If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple policies with the same sequence number then their order is not deterministic. If a specific order of policies is desired, then one has to specify unique sequence numbers or use the POST request on the policy entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // Stateful or Stateless nature of security policy is enforced on all rules in this security policy. When it is stateful, the state of the network connects are tracked and a stateful packet inspection is performed. Layer3 security policies can be stateful or stateless. By default, they are stateful. Layer2 security policies can only be stateless. + Stateful *bool + // Ensures that a 3 way TCP handshake is done before the data packets are sent. tcp_strict=true is supported only for stateful security policies. + TcpStrict *bool + // Rules that are a part of this ForwardingPolicy + Rules []ForwardingRule +} + +func (s ForwardingPolicy) GetType__() bindings.BindingType { + return ForwardingPolicyBindingType() +} + +func (s ForwardingPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ForwardingPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of ForwardingPolicy objects +type ForwardingPolicyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // ForwardingPolicy list results + Results []ForwardingPolicy +} + +func (s ForwardingPolicyListResult) GetType__() bindings.BindingType { + return ForwardingPolicyListResultBindingType() +} + +func (s ForwardingPolicyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ForwardingPolicyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Forwarding rule that determine how to forward traffic from a VM. Traffic from VM can either be routed via Overlay or Underlay when VM is on hybrid port. Additionally NAT can be performed for VM or container on overlay to route traffic to/from underlay ROUTE_TO_UNDERLAY - Access a service on underlay space from a VM connected to hybrid port. Eg access to AWS S3 on AWS underlay ROUTE_TO_OVERLAY - Access a service on overlay space from a VM connected to hybrid port. ROUTE_FROM_UNDERLAY - Access a service hosted on a VM (that is connected to hybrid port) from underlay space. Eg access from AWS ELB to VM ROUTE_FROM_OVERLAY - Access a service hosted on a VM (that is connected to hybrid port) from overlay space NAT_FROM_UNDERLAY - Access a service on overlay VM/container from underlay space using DNAT from underlay IP to overlay IP NAT_TO_UNDERLAY - Access an underlay service from a VM/container on overlay space using SNAT from overlay IP to underlay IP +type ForwardingRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + DestinationGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the destination groups. If false, the rule applies to the destination groups + DestinationsExcluded *bool + // Possible values are: + // + // * ForwardingRule#ForwardingRule_DIRECTION_IN + // * ForwardingRule#ForwardingRule_DIRECTION_OUT + // * ForwardingRule#ForwardingRule_DIRECTION_IN_OUT + // + // Define direction of traffic. + Direction *string + // Flag to disable the rule. Default is enabled. + Disabled *bool + // Possible values are: + // + // * ForwardingRule#ForwardingRule_IP_PROTOCOL_IPV4 + // * ForwardingRule#ForwardingRule_IP_PROTOCOL_IPV6 + // * ForwardingRule#ForwardingRule_IP_PROTOCOL_IPV4_IPV6 + // + // Type of IP packet that should be matched while enforcing the rule. The value is set to IPV4_IPV6 for Layer3 rule if not specified. For Layer2/Ether rule the value must be null. + IpProtocol *string + // A flag to indicate whether rule is a default rule. + IsDefault *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // Text for additional notes on changes. + Notes *string + // Holds the list of layer 7 service profile paths. These profiles accept attributes and sub-attributes of various network services (e.g. L4 AppId, encryption algorithm, domain name, etc) as key value pairs. + Profiles []string + // This is a unique 4 byte positive number that is assigned by the system. This rule id is passed all the way down to the data path. The first 1GB (1000 to 2^30) will be shared by GM and LM with zebra style striped number space. For E.g 1000 to (1Million -1) by LM, (1M - 2M-1) by GM and so on. format: int64 + RuleId *int64 + // The list of policy paths where the rule is applied LR/Edge/T0/T1/LRP etc. Note that a given rule can be applied on multiple LRs/LRPs. + Scope []string + // This field is used to resolve conflicts between multiple Rules under Security or Gateway Policy for a Domain If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple rules with the same sequence number then their order is not deterministic. If a specific order of rules is desired, then one has to specify unique sequence numbers or use the POST request on the rule entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // In order to specify raw services this can be used, along with services which contains path to services. This can be empty or null. + ServiceEntries []*data.StructValue + // In order to specify all services, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the services array. Error will be thrown if ANY is used in conjunction with other values. + Services []string + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + SourceGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the source groups. If false, the rule applies to the source groups + SourcesExcluded *bool + // User level field which will be printed in CLI and packet logs. + Tag *string + // Possible values are: + // + // * ForwardingRule#ForwardingRule_ACTION_ROUTE_TO_UNDERLAY + // * ForwardingRule#ForwardingRule_ACTION_ROUTE_TO_OVERLAY + // * ForwardingRule#ForwardingRule_ACTION_ROUTE_FROM_UNDERLAY + // * ForwardingRule#ForwardingRule_ACTION_ROUTE_FROM_OVERLAY + // * ForwardingRule#ForwardingRule_ACTION_NAT_FROM_UNDERLAY + // * ForwardingRule#ForwardingRule_ACTION_NAT_TO_UNDERLAY + // + // The action to be applied to all the services + Action *string +} +const ForwardingRule_DIRECTION_IN = "IN" +const ForwardingRule_DIRECTION_OUT = "OUT" +const ForwardingRule_DIRECTION_IN_OUT = "IN_OUT" +const ForwardingRule_IP_PROTOCOL_IPV4 = "IPV4" +const ForwardingRule_IP_PROTOCOL_IPV6 = "IPV6" +const ForwardingRule_IP_PROTOCOL_IPV4_IPV6 = "IPV4_IPV6" +const ForwardingRule_ACTION_ROUTE_TO_UNDERLAY = "ROUTE_TO_UNDERLAY" +const ForwardingRule_ACTION_ROUTE_TO_OVERLAY = "ROUTE_TO_OVERLAY" +const ForwardingRule_ACTION_ROUTE_FROM_UNDERLAY = "ROUTE_FROM_UNDERLAY" +const ForwardingRule_ACTION_ROUTE_FROM_OVERLAY = "ROUTE_FROM_OVERLAY" +const ForwardingRule_ACTION_NAT_FROM_UNDERLAY = "NAT_FROM_UNDERLAY" +const ForwardingRule_ACTION_NAT_TO_UNDERLAY = "NAT_TO_UNDERLAY" + +func (s ForwardingRule) GetType__() bindings.BindingType { + return ForwardingRuleBindingType() +} + +func (s ForwardingRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ForwardingRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of ForwardingRules +type ForwardingRuleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Rule list results + Results []ForwardingRule +} + +func (s ForwardingRuleListResult) GetType__() bindings.BindingType { + return ForwardingRuleListResultBindingType() +} + +func (s ForwardingRuleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ForwardingRuleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Provides FullSync state for Local Manager from Global Manager. +type FullSyncState struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Errors occurred during full sync. + Errors []string + // Full sync id generated by Async Replicator (AR) service. + FullSyncId *string + // Possible values are: + // + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_INITIAL + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_PAUSE_DCNS + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_DELETED_STALE_ENTITIES + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_PROCESSED_FULLSYNC_DATA + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_PROCESSED_DELTAS + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_UNPAUSE_DCNS + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_COMPLETED + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_ERROR + // * FullSyncState#FullSyncState_LAST_COMPLETED_STAGE_ABORTED + // + // The current stage of full sync completion for ongoing sync. When Local Manager (LM) receives full sync data from AR, LM starts with workflow to prserve the state and restore the full sync from where it has left off in case of change of leadership of the service to different NSX node or LM is restarted. LM starts the full sync workflow with state INITIAL capturing the AR full sync id and data location details. The stage/state transition follows the order given below INITIAL - Full sync started PROCESSED_FULLSYNC_DATA - Compelted processing the full state data provided by AR PRCESSED_DELTAS - Completed processing pending delta changes provided by AR. DELETED_STALE_ENTITIES - Completed deletion of all global entities on LM that are not in GM anymore COMPLETED - Full sync handling is completed on LM ERROR - Full sync failed with errors on LM, in which case AR will re-attempt full sync later point in time for the LM ABORTED - Indicates that the full sync cancelled as per user request + LastCompletedStage *string + // Timestamp of last update, could be progress or success or error. format: int64 + LastUpateTime *int64 + // Timestamp of Full Sync start. format: int64 + StartTime *int64 +} +const FullSyncState_LAST_COMPLETED_STAGE_INITIAL = "INITIAL" +const FullSyncState_LAST_COMPLETED_STAGE_PAUSE_DCNS = "PAUSE_DCNS" +const FullSyncState_LAST_COMPLETED_STAGE_DELETED_STALE_ENTITIES = "DELETED_STALE_ENTITIES" +const FullSyncState_LAST_COMPLETED_STAGE_PROCESSED_FULLSYNC_DATA = "PROCESSED_FULLSYNC_DATA" +const FullSyncState_LAST_COMPLETED_STAGE_PROCESSED_DELTAS = "PROCESSED_DELTAS" +const FullSyncState_LAST_COMPLETED_STAGE_UNPAUSE_DCNS = "UNPAUSE_DCNS" +const FullSyncState_LAST_COMPLETED_STAGE_COMPLETED = "COMPLETED" +const FullSyncState_LAST_COMPLETED_STAGE_ERROR = "ERROR" +const FullSyncState_LAST_COMPLETED_STAGE_ABORTED = "ABORTED" + +func (s FullSyncState) GetType__() bindings.BindingType { + return FullSyncStateBindingType() +} + +func (s FullSyncState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FullSyncState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of FullSync states. +type FullSyncStateListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // FullSync states list. + Results []FullSyncState +} + +func (s FullSyncStateListResult) GetType__() bindings.BindingType { + return FullSyncStateListResultBindingType() +} + +func (s FullSyncStateListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FullSyncStateListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type GatewayFloodProtectionProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * FloodProtectionProfile#FloodProtectionProfile_RESOURCE_TYPE_GATEWAYFLOODPROTECTIONPROFILE + // * FloodProtectionProfile#FloodProtectionProfile_RESOURCE_TYPE_DISTRIBUTEDFLOODPROTECTIONPROFILE + // + // GatewayFloodProtectionProfile is used for all Tier0 and Tier1 gateways. DistributedFloodProtectionProfile is used for all Transport Nodes. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If this field is empty, firewall will not set a limit to active ICMP connections. format: int64 + IcmpActiveFlowLimit *int64 + // If this field is empty, firewall will not set a limit to other active connections. besides UDP, ICMP and half open TCP connections. format: int64 + OtherActiveConnLimit *int64 + // If this field is empty, firewall will not set a limit to half open TCP connections. format: int64 + TcpHalfOpenConnLimit *int64 + // If this field is empty, firewall will not set a limit to active UDP connections. format: int64 + UdpActiveFlowLimit *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const GatewayFloodProtectionProfile__TYPE_IDENTIFIER = "GatewayFloodProtectionProfile" + +func (s GatewayFloodProtectionProfile) GetType__() bindings.BindingType { + return GatewayFloodProtectionProfileBindingType() +} + +func (s GatewayFloodProtectionProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GatewayFloodProtectionProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains ordered list of Rules for GatewayPolicy +type GatewayPolicy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // - Distributed Firewall - Policy framework provides five pre-defined categories for classifying a security policy. They are \"Ethernet\",\"Emergency\", \"Infrastructure\" \"Environment\" and \"Application\". There is a pre-determined order in which the policy framework manages the priority of these security policies. Ethernet category is for supporting layer 2 firewall rules. The other four categories are applicable for layer 3 rules. Amongst them, the Emergency category has the highest priority followed by Infrastructure, Environment and then Application rules. Administrator can choose to categorize a security policy into the above categories or can choose to leave it empty. If empty it will have the least precedence w.r.t the above four categories. - Edge Firewall - Policy Framework for Edge Firewall provides six pre-defined categories \"Emergency\", \"SystemRules\", \"SharedPreRules\", \"LocalGatewayRules\", \"AutoServiceRules\" and \"Default\", in order of priority of rules. All categories are allowed for Gatetway Policies that belong to 'default' Domain. However, for user created domains, category is restricted to \"SharedPreRules\" or \"LocalGatewayRules\" only. Also, the users can add/modify/delete rules from only the \"SharedPreRules\" and \"LocalGatewayRules\" categories. If user doesn't specify the category then defaulted to \"Rules\". System generated category is used by NSX created rules, for example BFD rules. Autoplumbed category used by NSX verticals to autoplumb data path rules. Finally, \"Default\" category is the placeholder default rules with lowest in the order of priority. + Category *string + // Comments for security policy lock/unlock. + Comments *string + // This field is to indicate the internal sequence number of a policy with respect to the policies across categories. format: int32 + InternalSequenceNumber *int64 + // A flag to indicate whether policy is a default policy. + IsDefault *bool + // ID of the user who last modified the lock for the secruity policy. + LockModifiedBy *string + // SecurityPolicy locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Indicates whether a security policy should be locked. If the security policy is locked by a user, then no other user would be able to modify this security policy. Once the user releases the lock, other users can update this security policy. + Locked *bool + // The count of rules in the policy. format: int32 + RuleCount *int64 + // Provides a mechanism to apply the rules in this policy for a specified time duration. + SchedulerPath *string + // The list of group paths where the rules in this policy will get applied. This scope will take precedence over rule level scope. Supported only for security and redirection policies. In case of RedirectionPolicy, it is expected only when the policy is NS and redirecting to service chain. + Scope []string + // This field is used to resolve conflicts between security policies across domains. In order to change the sequence number of a policy one can fire a POST request on the policy entity with a query parameter action=revise The sequence number field will reflect the value of the computed sequence number upon execution of the above mentioned POST request. For scenarios where the administrator is using a template to update several security policies, the only way to set the sequence number is to explicitly specify the sequence number for each security policy. If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple policies with the same sequence number then their order is not deterministic. If a specific order of policies is desired, then one has to specify unique sequence numbers or use the POST request on the policy entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // Stateful or Stateless nature of security policy is enforced on all rules in this security policy. When it is stateful, the state of the network connects are tracked and a stateful packet inspection is performed. Layer3 security policies can be stateful or stateless. By default, they are stateful. Layer2 security policies can only be stateless. + Stateful *bool + // Ensures that a 3 way TCP handshake is done before the data packets are sent. tcp_strict=true is supported only for stateful security policies. + TcpStrict *bool + // Rules that are a part of this SecurityPolicy + Rules []Rule +} + +func (s GatewayPolicy) GetType__() bindings.BindingType { + return GatewayPolicyBindingType() +} + +func (s GatewayPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GatewayPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of gateway policies +type GatewayPolicyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // GatewayPolicy list results + Results []GatewayPolicy +} + +func (s GatewayPolicyListResult) GetType__() bindings.BindingType { + return GatewayPolicyListResultBindingType() +} + +func (s GatewayPolicyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GatewayPolicyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// QoS profile contains configuration of rate limiting properties which can be applied in ingress and egress directions at Tier1 gateways +type GatewayQosProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Burst size in bytes. format: int32 + BurstSize *int64 + // Committed bandwidth in both directions specoficd in Mbps. Bandwidth is limited to line rate when the value configured is greater than line rate. format: int32 + CommittedBandwitdth *int64 + // Possible values are: + // + // * GatewayQosProfile#GatewayQosProfile_EXCESS_ACTION_DROP + // + // Action on traffic exceeding bandwidth. + ExcessAction *string +} +const GatewayQosProfile_EXCESS_ACTION_DROP = "DROP" + +func (s GatewayQosProfile) GetType__() bindings.BindingType { + return GatewayQosProfileBindingType() +} + +func (s GatewayQosProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GatewayQosProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Gateway QoS profile configuration +type GatewayQosProfileConfig struct { + // Policy path to gateway QoS profile in egress direction. + EgressQosProfilePath *string + // Policy path to gateway QoS profile in ingress direction. + IngressQosProfilePath *string +} + +func (s GatewayQosProfileConfig) GetType__() bindings.BindingType { + return GatewayQosProfileConfigBindingType() +} + +func (s GatewayQosProfileConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GatewayQosProfileConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type GatewayQosProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of GatewayQosProfile + Results []GatewayQosProfile +} + +func (s GatewayQosProfileListResult) GetType__() bindings.BindingType { + return GatewayQosProfileListResultBindingType() +} + +func (s GatewayQosProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GatewayQosProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type GatewayRouteCsvRecord struct { + // The admin distance of the next hop format: int64 + AdminDistance *int64 + // Edge node policy path. + EdgePath *string + // The policy path of the interface which is used as the next hop + _Interface *string + // Logical router component(Service Router/Distributed Router) id + LrComponentId *string + // Logical router component(Service Router/Distributed Router) type + LrComponentType *string + // CIDR network address format: ip-cidr-block + Network *string + // The IP of the next hop format: ip + NextHop *string + // Route type (USER, CONNECTED, NSX_INTERNAL,..) + RouteType *string +} + +func (s GatewayRouteCsvRecord) GetType__() bindings.BindingType { + return GatewayRouteCsvRecordBindingType() +} + +func (s GatewayRouteCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GatewayRouteCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type GatewayRouteTableInCsvFormat struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []GatewayRouteCsvRecord +} + +func (s GatewayRouteTableInCsvFormat) GetType__() bindings.BindingType { + return GatewayRouteTableInCsvFormatBindingType() +} + +func (s GatewayRouteTableInCsvFormat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GatewayRouteTableInCsvFormat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Define DHCP options other than option 121. +type GenericDhcpOption struct { + // Code of the dhcp option. format: int64 + Code *int64 + // Value of the option. + Values []string +} + +func (s GenericDhcpOption) GetType__() bindings.BindingType { + return GenericDhcpOptionBindingType() +} + +func (s GenericDhcpOption) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GenericDhcpOption._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents realized entity +type GenericPolicyRealizedResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // Alarm info detail + Alarms []PolicyAlarmResource + // Desire state paths of this object + IntentReference []string + // Realization API of this object on enforcement point + RealizationApi *string + // Realization id of this object + RealizationSpecificIdentifier *string + // It define the root cause for runtime error. + RuntimeError *string + // Possible values could be UP, DOWN, UNKNOWN, DEGRADED This list is not exhaustive. + RuntimeStatus *string + // Possible values are: + // + // * GenericPolicyRealizedResource#GenericPolicyRealizedResource_STATE_UNAVAILABLE + // * GenericPolicyRealizedResource#GenericPolicyRealizedResource_STATE_UNREALIZED + // * GenericPolicyRealizedResource#GenericPolicyRealizedResource_STATE_REALIZED + // * GenericPolicyRealizedResource#GenericPolicyRealizedResource_STATE_ERROR + // + // Realization state of this object + State *string + // The path of the enforcement point. + EnforcementPointPath *string + // Type of realized entity + EntityType *string + // Collection of type specific properties + ExtendedAttributes []AttributeVal + // Collection of intent paths + IntentPaths []string + // The site where this entity resides. + SitePath *string +} +const GenericPolicyRealizedResource_STATE_UNAVAILABLE = "UNAVAILABLE" +const GenericPolicyRealizedResource_STATE_UNREALIZED = "UNREALIZED" +const GenericPolicyRealizedResource_STATE_REALIZED = "REALIZED" +const GenericPolicyRealizedResource_STATE_ERROR = "ERROR" + +func (s GenericPolicyRealizedResource) GetType__() bindings.BindingType { + return GenericPolicyRealizedResourceBindingType() +} + +func (s GenericPolicyRealizedResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GenericPolicyRealizedResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// GenericPolicyRealizedResource list result +type GenericPolicyRealizedResourceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of realized resources + Results []GenericPolicyRealizedResource +} + +func (s GenericPolicyRealizedResourceListResult) GetType__() bindings.BindingType { + return GenericPolicyRealizedResourceListResultBindingType() +} + +func (s GenericPolicyRealizedResourceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GenericPolicyRealizedResourceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Global configuration +type GlobalConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Contains the FIPSGlobalConfig object. + Fips *FIPSGlobalConfig + // Possible values are: + // + // * GlobalConfig#GlobalConfig_L3FORWARDING_MODE_ONLY + // * GlobalConfig#GlobalConfig_L3FORWARDING_MODE_AND_IPV6 + // + // Configure forwarding mode for routing. This setting does not restrict configuration for other modes. + L3ForwardingMode *string + // Maximum transmission unit (MTU) specifies the size of the largest packet that a network protocol can transmit. format: int32 + Mtu *int64 +} +const GlobalConfig_L3FORWARDING_MODE_ONLY = "IPV4_ONLY" +const GlobalConfig_L3FORWARDING_MODE_AND_IPV6 = "IPV4_AND_IPV6" + +func (s GlobalConfig) GetType__() bindings.BindingType { + return GlobalConfigBindingType() +} + +func (s GlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Global Manager. +type GlobalManager struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // To create a standby GM, the connection information (username, password, and API thumbprint) for at least one NSX manager node in the remote site must be provided. Once the GM has been successfully onboarded, the connection_info is discarded and authentication to the standby GM occurs using an X.509 client certificate. + ConnectionInfo []SiteNodeConnectionInfo + // Fail onboarding if maximum RTT exceeded. + FailIfRttExceeded *bool + // Internally generated UUID to the federation of Global Manager. + FederationId *string + // If provided and fail_if_rtt_exceeded is true, onboarding of the site will fail if measured RTT is greater than this value. format: int64 + MaximumRtt *int64 + // Possible values are: + // + // * GlobalManager#GlobalManager_MODE_ACTIVE + // * GlobalManager#GlobalManager_MODE_STANDBY + // + // There can be at most one ACTIVE global manager and one STANDBY global manager. In order to add a STANDBY manager, there must be an ACTIVE manager defined. + Mode *string + // UUID of the site where Global manager is running. This is the Site Manager generated UUID for every NSX deployment. + SiteId *string +} +const GlobalManager_MODE_ACTIVE = "ACTIVE" +const GlobalManager_MODE_STANDBY = "STANDBY" + +func (s GlobalManager) GetType__() bindings.BindingType { + return GlobalManagerBindingType() +} + +func (s GlobalManager) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GlobalManager._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This configuration is distributed to all Sites participating in federation. +type GlobalManagerConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Global Manager federation RTEP configuration. This configuration is distributed to all Sites participating in federation. + RtepConfig *GmRtepConfig +} + +func (s GlobalManagerConfig) GetType__() bindings.BindingType { + return GlobalManagerConfigBindingType() +} + +func (s GlobalManagerConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GlobalManagerConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Global Managers. +type GlobalManagerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Global Manager List Result. + Results []GlobalManager +} + +func (s GlobalManagerListResult) GetType__() bindings.BindingType { + return GlobalManagerListResultBindingType() +} + +func (s GlobalManagerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GlobalManagerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Overall restore process status +type GlobalRestoreStatus struct { + // A description of the restore status + Description *string + // Possible values are: + // + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_INITIAL + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_SUCCESS + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_FAILED + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_RUNNING + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_SUSPENDED_BY_USER + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_SUSPENDED_FOR_USER_ACTION + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_SUSPENDED + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_ABORTED + // + // Global rolled-up restore status value + Value *string +} +const GlobalRestoreStatus_VALUE_INITIAL = "INITIAL" +const GlobalRestoreStatus_VALUE_SUCCESS = "SUCCESS" +const GlobalRestoreStatus_VALUE_FAILED = "FAILED" +const GlobalRestoreStatus_VALUE_RUNNING = "RUNNING" +const GlobalRestoreStatus_VALUE_SUSPENDED_BY_USER = "SUSPENDED_BY_USER" +const GlobalRestoreStatus_VALUE_SUSPENDED_FOR_USER_ACTION = "SUSPENDED_FOR_USER_ACTION" +const GlobalRestoreStatus_VALUE_SUSPENDED = "SUSPENDED" +const GlobalRestoreStatus_VALUE_ABORTED = "ABORTED" + +func (s GlobalRestoreStatus) GetType__() bindings.BindingType { + return GlobalRestoreStatusBindingType() +} + +func (s GlobalRestoreStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GlobalRestoreStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Additional configuration required for federation at Site. +type GmFederationSiteConfig struct { + // IP Addresses to be allocated for transit segment when the gateway is stretched. Note that Global Manager will carve out the IP Pool for each site to be used for edge nodes when gateway is stretched based on the user provided subnet and maximum number of edge nodes allowed per site. format: ip-cidr-block + TransitSubnet *string +} + +func (s GmFederationSiteConfig) GetType__() bindings.BindingType { + return GmFederationSiteConfigBindingType() +} + +func (s GmFederationSiteConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GmFederationSiteConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Global Manager federation RTEP configuration. This configuration is distributed to all Sites participating in federation. +type GmRtepConfig struct { + // Password to authenticate IBGP session between remote tunnel endpoints created on federated sites. This is applied to inter-site underlay IBGP neighbors created over remote tunnel endpoints on all sites. Empty string (\"\") clears existing password. + IbgpPassword *string +} + +func (s GmRtepConfig) GetType__() bindings.BindingType { + return GmRtepConfigBindingType() +} + +func (s GmRtepConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GmRtepConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents configuration of a graph widget +type GraphConfiguration struct { + // Axes of a graph + Axes *Axes + // If true, value of a point is shown as label on X axis. If false, value of point is not shown as label on X axis. false can be useful in situations where there are too many points and showing the X value as label can clutter the X axis. + DisplayxValue *bool + // Graphs + Graphs []GraphDefinition + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Possible values are: + // + // * GraphConfiguration#GraphConfiguration_SUB_TYPE_LINE_GRAPH + // * GraphConfiguration#GraphConfiguration_SUB_TYPE_BAR_GRAPH + // * GraphConfiguration#GraphConfiguration_SUB_TYPE_STACKED_BAR_GRAPH + // + // Describes the the type of graph. LINE_GRAPH shows a line graph chart BAR_GRAPH shows a simple bar graph chart STACKED_BAR_GRAPH shows a stacked bar graph chart + SubType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const GraphConfiguration__TYPE_IDENTIFIER = "GraphConfiguration" +const GraphConfiguration_SUB_TYPE_LINE_GRAPH = "LINE_GRAPH" +const GraphConfiguration_SUB_TYPE_BAR_GRAPH = "BAR_GRAPH" +const GraphConfiguration_SUB_TYPE_STACKED_BAR_GRAPH = "STACKED_BAR_GRAPH" + +func (s GraphConfiguration) GetType__() bindings.BindingType { + return GraphConfigurationBindingType() +} + +func (s GraphConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GraphConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Defines a graph +type GraphDefinition struct { + // Describes the graph. It labels the entities of graph. If the label is not provided then it is not shown for a graph. For example, for a single graph, the title of widget can describe the graph and a label may not be necessary to be shown. + Label *Label + // Defines the points of a graph. + PointDefinition *PointDefinition + // Additional rendering or conditional evaluation of the field values to be performed, if any. + RenderConfiguration []RenderConfiguration +} + +func (s GraphDefinition) GetType__() bindings.BindingType { + return GraphDefinitionBindingType() +} + +func (s GraphDefinition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GraphDefinition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents configuration of a Grid or Table widget. +type GridConfiguration struct { + // Array of columns of a Grid widget + Columns []ColumnItem + // Number of records per page. page_size will be effective only when the urls provided in the datasource support paging. format: int32 + PageSize *int64 + // Rows of grid or table are formed from the list of objects returned by a row list field. + RowListFields []RowListField + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const GridConfiguration__TYPE_IDENTIFIER = "GridConfiguration" + +func (s GridConfiguration) GetType__() bindings.BindingType { + return GridConfigurationBindingType() +} + +func (s GridConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GridConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Group. +type Group struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // The expression list must follow below criteria: 1. A non-empty expression list, must be of odd size. In a list, with indices starting from 0, all non-conjunction expressions must be at even indices, separated by a conjunction expression at odd indices. 2. The total of ConditionExpression and NestedExpression in a list should not exceed 5. 3. The total of IPAddressExpression, MACAddressExpression, external IDs in an ExternalIDExpression and paths in a PathExpression must not exceed 500. 4. Each expression must be a valid Expression. See the definition of the Expression type for more information. + Expression []*data.StructValue + // Extended Expression allows additional higher level context to be specified for grouping criteria. (e.g. user AD group) This field allow users to specified user context as the source of a firewall rule for IDFW feature. Current version only support a single IdentityGroupExpression. In the future, this might expand to support other conjunction and non-conjunction expression. The extended expression list must follow below criteria: 1. Contains a single IdentityGroupExpression. No conjunction expression is supported. 2. No other non-conjunction expression is supported, except for IdentityGroupExpression. 3. Each expression must be a valid Expression. See the definition of the Expression type for more information. 4. Extended expression are implicitly AND with expression. 5. No nesting can be supported if this value is used. 6. If a Group is using extended expression, this group must be the only member in the source field of an communication map. + ExtendedExpression []*data.StructValue + // If true, indicates that this is a remote reference group. Such group will have span different from the its parent domain. Default value is false. + Reference *bool + // Possible values are: + // + // * Group#Group_STATE_IN_PROGRESS + // * Group#Group_STATE_SUCCESS + // * Group#Group_STATE_FAILURE + // + // Realization state of this group + State *string +} +const Group_STATE_IN_PROGRESS = "IN_PROGRESS" +const Group_STATE_SUCCESS = "SUCCESS" +const Group_STATE_FAILURE = "FAILURE" + +func (s Group) GetType__() bindings.BindingType { + return GroupBindingType() +} + +func (s Group) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Group._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between discovery profile and Group. With this entity, user can specify intent for applying discovery profile profile to particular Group. +type GroupDiscoveryProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated Profile + ProfilePath *string + // Sequence number used to resolve conflicts betweeen two profiles applied on the same group. Lower sequence number takes higher precedence. Two binding maps applied to the same profile must have the same sequence number. User defined sequence numbers range from 1 through 100,000. System defined sequence numbers range from 100,001 through 200,000. format: int64 + SequenceNumber *int64 +} + +func (s GroupDiscoveryProfileBindingMap) GetType__() bindings.BindingType { + return GroupDiscoveryProfileBindingMapBindingType() +} + +func (s GroupDiscoveryProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupDiscoveryProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Groups +type GroupListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Group list results + Results []Group +} + +func (s GroupListResult) GetType__() bindings.BindingType { + return GroupListResultBindingType() +} + +func (s GroupListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// List of same type members to either add or remove from a group. +type GroupMemberList struct { + // This array contains group members of similar types. + Members []string +} + +func (s GroupMemberList) GetType__() bindings.BindingType { + return GroupMemberListBindingType() +} + +func (s GroupMemberList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupMemberList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Collection of tags used in a policy group for a particular member type +type GroupMemberTagsList struct { + // Member type for which we will list the tags + MemberType *string + // List of tags for the member type + Tags []string +} + +func (s GroupMemberTagsList) GetType__() bindings.BindingType { + return GroupMemberTagsListBindingType() +} + +func (s GroupMemberTagsList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupMemberTagsList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type GroupMemberTypeListResult struct { + // Count of the member types in the results array format: int64 + ResultCount *int64 + // Possible values are: + // + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_VIRTUALMACHINE + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_VIRTUALNETWORKINTERFACE + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_SEGMENTPORT + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_SEGMENT + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_CLOUDNATIVESERVICEINSTANCE + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_IPADDRESS + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_MACADDRESS + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_IPSET + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_IDENTITYGROUP + // * GroupMemberTypeListResult#GroupMemberTypeListResult_RESULTS_PHYSICALSERVER + // + // Collection of member types for the given Group + Results []string +} +const GroupMemberTypeListResult_RESULTS_VIRTUALMACHINE = "VirtualMachine" +const GroupMemberTypeListResult_RESULTS_VIRTUALNETWORKINTERFACE = "VirtualNetworkInterface" +const GroupMemberTypeListResult_RESULTS_SEGMENTPORT = "SegmentPort" +const GroupMemberTypeListResult_RESULTS_SEGMENT = "Segment" +const GroupMemberTypeListResult_RESULTS_CLOUDNATIVESERVICEINSTANCE = "CloudNativeServiceInstance" +const GroupMemberTypeListResult_RESULTS_IPADDRESS = "IPAddress" +const GroupMemberTypeListResult_RESULTS_MACADDRESS = "MACAddress" +const GroupMemberTypeListResult_RESULTS_IPSET = "IPSet" +const GroupMemberTypeListResult_RESULTS_IDENTITYGROUP = "IdentityGroup" +const GroupMemberTypeListResult_RESULTS_PHYSICALSERVER = "PhysicalServer" + +func (s GroupMemberTypeListResult) GetType__() bindings.BindingType { + return GroupMemberTypeListResultBindingType() +} + +func (s GroupMemberTypeListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupMemberTypeListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between monitoring profile and Group. Using this entity, you can specify intent for applying monitoring profile to particular Group. Group with membership criteria vm only supported as source group. Port mirroring is only supported on group with five vms. +type GroupMonitoringProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated IPFIX DFW Profile + IpfixDfwProfilePath *string + // PolicyPath of associated IPFIX L2 Profile + IpfixL2ProfilePath *string + // PolicyPath of associated Port Mirroring Profile + PortMirroringProfilePath *string +} + +func (s GroupMonitoringProfileBindingMap) GetType__() bindings.BindingType { + return GroupMonitoringProfileBindingMapBindingType() +} + +func (s GroupMonitoringProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupMonitoringProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Group Monitoring Profile Binding Maps +type GroupMonitoringProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Group Monitoring Profile Binding Map list results + Results []GroupMonitoringProfileBindingMap +} + +func (s GroupMonitoringProfileBindingMapListResult) GetType__() bindings.BindingType { + return GroupMonitoringProfileBindingMapListResultBindingType() +} + +func (s GroupMonitoringProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupMonitoringProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Collection of tags used in a policy group listed per member type +type GroupTagsList struct { + // Collection of tags used in a policy group listed per member type + Results []GroupMemberTagsList +} + +func (s GroupTagsList) GetType__() bindings.BindingType { + return GroupTagsListBindingType() +} + +func (s GroupTagsList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupTagsList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Guest virtual machine details include OS name and computer name of guest VM. +type GuestInfo struct { + // Computer name of guest virtual machine, which is set inside guest OS. Currently this is supported for guests on ESXi that have VMware Tools installed. + ComputerName *string + // OS name of guest virtual machine. Currently this is supported for guests on ESXi that have VMware Tools installed. + OsName *string +} + +func (s GuestInfo) GetType__() bindings.BindingType { + return GuestInfoBindingType() +} + +func (s GuestInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GuestInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Header of a widget that provides additional information. This will be shown at the container level. It includes details as label value pairs. +type Header struct { + // If the condition is met then the header will be applied. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // Possible values are: + // + // * Header#Header_CONTENT_ALIGNMENT_LEFT + // * Header#Header_CONTENT_ALIGNMENT_RIGHT + // + // Alignment of header labels. + ContentAlignment *string + // An array of label-value properties. + SubHeaders []PropertyItem +} +const Header_CONTENT_ALIGNMENT_LEFT = "LEFT" +const Header_CONTENT_ALIGNMENT_RIGHT = "RIGHT" + +func (s Header) GetType__() bindings.BindingType { + return HeaderBindingType() +} + +func (s Header) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Header._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the PolicyLbRule object. This represents active health monitoring over HTTP. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healthchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type HttpPolicyLbMonitorProfile struct { + // For HTTP active healthchecks, the HTTP request url sent can be customized and can include query parameters. + Url *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_TCPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_UDPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_ICMPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPSPOLICYLBMONITORPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const HttpPolicyLbMonitorProfile__TYPE_IDENTIFIER = "HttpPolicyLbMonitorProfile" + +func (s HttpPolicyLbMonitorProfile) GetType__() bindings.BindingType { + return HttpPolicyLbMonitorProfileBindingType() +} + +func (s HttpPolicyLbMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HttpPolicyLbMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Virtual server acts as a facade to an application, receives all client connections over HTTP and distributes them among the backend servers. +type HttpPolicyLbVirtualServer struct { + // Backend web servers typically log each request they handle along with the requesting client IP address. These logs are used for debugging, analytics and other such purposes. If the deployment topology requires enabling SNAT on the load balancer, then server will see the client as the SNAT IP which defeats the purpose of logging. To work around this issue, load balancer can be configured to insert XFF HTTP header with the original client IP address. Backend servers can then be configured to log the IP address in XFF header instead of the source IP address of the connection. If XFF header is not present in the incoming request, load balancer inserts a new XFF header with the client IP address. + InsertClientIpHeader *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_TCPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_UDPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPSPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_CUSTOMPOLICYLBVIRTUALSERVER + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If access log is enabled, all HTTP requests sent to an L7 virtual server are logged to the access log file. Both successful requests (backend server returns 2xx) and unsuccessful requests (backend server returns 4xx or 5xx) are logged to access log, if enabled. + AccessLogEnabled *bool + // Configures the IP address of the PolicyLbVirtualServer where it receives all client connections and distributes them among the backend servers. format: ip + IpAddress *string + // Path to optional object that enables persistence on a virtual server allowing related client connections to be sent to the same backend server. Persistence is disabled by default. + LbPersistenceProfile *string + // Ports contains a list of at least one port or port range such as \"80\", \"1234-1236\". Each port element in the list should be a single port or a single port range. format: port-or-range + Ports []string + // Path to router type object that PolicyLbVirtualServer connects to. The only supported router object is Network. + RouterPath *string + TrafficSource *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const HttpPolicyLbVirtualServer__TYPE_IDENTIFIER = "HttpPolicyLbVirtualServer" + +func (s HttpPolicyLbVirtualServer) GetType__() bindings.BindingType { + return HttpPolicyLbVirtualServerBindingType() +} + +func (s HttpPolicyLbVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HttpPolicyLbVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the PolicyLbRule object. This represents active health monitoring over HTTPS. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healthchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type HttpsPolicyLbMonitorProfile struct { + // For HTTP active healthchecks, the HTTP request url sent can be customized and can include query parameters. + Url *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_TCPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_UDPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_ICMPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPSPOLICYLBMONITORPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 +} + +func (s HttpsPolicyLbMonitorProfile) GetType__() bindings.BindingType { + return HttpsPolicyLbMonitorProfileBindingType() +} + +func (s HttpsPolicyLbMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HttpsPolicyLbMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Virtual server acts as a facade to an application, receives all client connections over HTTPS and distributes them among the backend servers. +type HttpsPolicyLbVirtualServer struct { + // Client-side SSL profile binding allows multiple certificates, for different hostnames, to be bound to the same virtual server. The setting is used when load balancer acts as an SSL server and terminating the client SSL connection + ClientSslCertificateIds []string + // Possible values are: + // + // * HttpsPolicyLbVirtualServer#HttpsPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_BASE_SECURE_111317 + // * HttpsPolicyLbVirtualServer#HttpsPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_MODERATE_SECURE_111317 + // * HttpsPolicyLbVirtualServer#HttpsPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_HIGH_SECURE_111317 + // + // Security settings representing various security settings when the VirtualServer acts as an SSL server - BASE_SECURE_111317 - MODERATE_SECURE_111317 - HIGH_SECURE_111317 + ClientSslSettings *string + // The setting is used when load balancer acts as an SSL server and terminating the client SSL connection. A default certificate should be specified which will be used if the server does not host multiple hostnames on the same IP address or if the client does not support SNI extension. + DefaultClientSslCertificateId *string + // Backend web servers typically log each request they handle along with the requesting client IP address. These logs are used for debugging, analytics and other such purposes. If the deployment topology requires enabling SNAT on the load balancer, then server will see the client as the SNAT IP which defeats the purpose of logging. To work around this issue, load balancer can be configured to insert XFF HTTP header with the original client IP address. Backend servers can then be configured to log the IP address in XFF header instead of the source IP address of the connection. If XFF header is not present in the incoming request, load balancer inserts a new XFF header with the client IP address. + InsertClientIpHeader *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_TCPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_UDPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPSPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_CUSTOMPOLICYLBVIRTUALSERVER + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If access log is enabled, all HTTP requests sent to an L7 virtual server are logged to the access log file. Both successful requests (backend server returns 2xx) and unsuccessful requests (backend server returns 4xx or 5xx) are logged to access log, if enabled. + AccessLogEnabled *bool + // Configures the IP address of the PolicyLbVirtualServer where it receives all client connections and distributes them among the backend servers. format: ip + IpAddress *string + // Path to optional object that enables persistence on a virtual server allowing related client connections to be sent to the same backend server. Persistence is disabled by default. + LbPersistenceProfile *string + // Ports contains a list of at least one port or port range such as \"80\", \"1234-1236\". Each port element in the list should be a single port or a single port range. format: port-or-range + Ports []string + // Path to router type object that PolicyLbVirtualServer connects to. The only supported router object is Network. + RouterPath *string + TrafficSource *string +} +const HttpsPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_BASE_SECURE_111317 = "BASE_SECURE_111317" +const HttpsPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_MODERATE_SECURE_111317 = "MODERATE_SECURE_111317" +const HttpsPolicyLbVirtualServer_CLIENT_SSL_SETTINGS_HIGH_SECURE_111317 = "HIGH_SECURE_111317" + +func (s HttpsPolicyLbVirtualServer) GetType__() bindings.BindingType { + return HttpsPolicyLbVirtualServerBindingType() +} + +func (s HttpsPolicyLbVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HttpsPolicyLbVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A ServiceEntry that represents IPv4 or IPv6 ICMP protocol +type ICMPTypeServiceEntry struct { + // ICMP message code format: int64 + IcmpCode *int64 + // ICMP message type format: int64 + IcmpType *int64 + // Possible values are: + // + // * ICMPTypeServiceEntry#ICMPTypeServiceEntry_PROTOCOL_ICMPV4 + // * ICMPTypeServiceEntry#ICMPTypeServiceEntry_PROTOCOL_ICMPV6 + Protocol *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ICMPTypeServiceEntry__TYPE_IDENTIFIER = "ICMPTypeServiceEntry" +const ICMPTypeServiceEntry_PROTOCOL_ICMPV4 = "ICMPv4" +const ICMPTypeServiceEntry_PROTOCOL_ICMPV6 = "ICMPv6" + +func (s ICMPTypeServiceEntry) GetType__() bindings.BindingType { + return ICMPTypeServiceEntryBindingType() +} + +func (s ICMPTypeServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ICMPTypeServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A ServiceEntry that represents IGMP protocol +type IGMPTypeServiceEntry struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IGMPTypeServiceEntry__TYPE_IDENTIFIER = "IGMPTypeServiceEntry" + +func (s IGMPTypeServiceEntry) GetType__() bindings.BindingType { + return IGMPTypeServiceEntryBindingType() +} + +func (s IGMPTypeServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IGMPTypeServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents IP address expressions in the form of an array, to support addition of IP addresses in a group. Avoid creating groups with multiple IPAddressExpression. In future releases, group will be restricted to contain a single IPAddressExpression. To group IPAddresses, use nested groups instead of multiple IPAddressExpressions. +type IPAddressExpression struct { + // This array can consist of a single IP address, IP address range or a subnet. Its type can be of either IPv4 or IPv6. Both IPv4 and IPv6 addresses within one expression is not allowed. Supported list of formats are, \"192.168.1.1\", \"192.168.1.1-192.168.1.100\", \"192.168.0.0/24\", \"fe80::250:56ff:fe83:318c\", \"fe80::250:56ff:fe83:3181-fe80::250:56ff:fe83:318c\", \"fe80::250:56ff:fe83:318c/64\". format: address-or-block-or-range + IpAddresses []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IPAddressExpression__TYPE_IDENTIFIER = "IPAddressExpression" + +func (s IPAddressExpression) GetType__() bindings.BindingType { + return IPAddressExpressionBindingType() +} + +func (s IPAddressExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPAddressExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Collection of IP Addresses. +type IPAddressList struct { + // The array contains IP addresses. format: address-or-block-or-range + IpAddresses []string +} + +func (s IPAddressList) GetType__() bindings.BindingType { + return IPAddressListBindingType() +} + +func (s IPAddressList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPAddressList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IP Address and Port information +type IPAddressPortPair struct { + // The IPAddress to be combined with Port for defining specific access point. format: ip + IpAddress *string + // The port to be combined with IPAddress for defining a specific access point. format: int32 + Port *int64 +} + +func (s IPAddressPortPair) GetType__() bindings.BindingType { + return IPAddressPortPairBindingType() +} + +func (s IPAddressPortPair) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPAddressPortPair._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Using this profile to configure different options of IP Discovery +type IPDiscoveryProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // This property controls the ARP and ND cache timeout period. It is recommended that this property be greater than the ARP/ND cache timeout on the VM. format: int32 + ArpNdBindingTimeout *int64 + // Duplicate IP detection is used to determine if there is any IP conflict with any other port on the same logical switch. If a conflict is detected, then the IP is marked as a duplicate on the port where the IP was discovered last. The duplicate IP will not be added to the realized address binings for the port and hence will not be used in DFW rules or other security configurations for the port.rt. + DuplicateIpDetection *DuplicateIPDetectionOptions + // Indicates IPv4 Discovery options + IpV4DiscoveryOptions *IPv4DiscoveryOptions + // Indicates IPv6 Discovery options + IpV6DiscoveryOptions *IPv6DiscoveryOptions + // Indicates whether \"Trust on First Use(TOFU)\" paradigm is enabled. + TofuEnabled *bool +} + +func (s IPDiscoveryProfile) GetType__() bindings.BindingType { + return IPDiscoveryProfileBindingType() +} + +func (s IPDiscoveryProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPDiscoveryProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of IP Discovery Profiles +type IPDiscoveryProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IP Discovery profile list results + Results []IPDiscoveryProfile +} + +func (s IPDiscoveryProfileListResult) GetType__() bindings.BindingType { + return IPDiscoveryProfileListResultBindingType() +} + +func (s IPDiscoveryProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPDiscoveryProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPFIX DFW data will be collected on collector Host IP and Port address should be provided for collector. +type IPFIXDFWCollector struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // IP address for the IPFIX DFW collector. IP addresses such as 0.0.0.0, 127.0.0.1, 255.255.255.255 are invalid. format: ip + CollectorIpAddress *string + // Port for the IPFIX DFW collector. format: int32 + CollectorPort *int64 +} + +func (s IPFIXDFWCollector) GetType__() bindings.BindingType { + return IPFIXDFWCollectorBindingType() +} + +func (s IPFIXDFWCollector) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXDFWCollector._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPFIX data for the NSX distributed firewall will be sent to the specified IPFIX collectors. +type IPFIXDFWCollectorProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // It accepts Multiple Collectors. + IpfixDfwCollectors []IPFIXDFWCollector +} + +func (s IPFIXDFWCollectorProfile) GetType__() bindings.BindingType { + return IPFIXDFWCollectorProfileBindingType() +} + +func (s IPFIXDFWCollectorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXDFWCollectorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of IPFIX DFW Collector Profile +type IPFIXDFWCollectorProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPFIX DFW Collection Instances list results + Results []IPFIXDFWCollectorProfile +} + +func (s IPFIXDFWCollectorProfileListResult) GetType__() bindings.BindingType { + return IPFIXDFWCollectorProfileListResultBindingType() +} + +func (s IPFIXDFWCollectorProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXDFWCollectorProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPFIX packets from source will be sent to IPFIX DFW collector. +type IPFIXDFWProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // For long standing active flows, IPFIX records will be sent per timeout period in minutes. format: int32 + ActiveFlowExportTimeout *int64 + // Policy path for IPFIX collector profiles. IPFIX data from these logical segments will be sent to all specified IPFIX collectors. + IpfixDfwCollectorProfilePath *string + // An identifier that is unique to the exporting process and used to meter the flows. format: int32 + ObservationDomainId *int64 + // This priority field is used to resolve conflicts in Segment Ports which are covered by more than one IPFIX profiles. The IPFIX exporter will send records to Collectors in highest priority profile (lowest number) only. format: int32 + Priority *int64 +} + +func (s IPFIXDFWProfile) GetType__() bindings.BindingType { + return IPFIXDFWProfileBindingType() +} + +func (s IPFIXDFWProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXDFWProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of IPFIX DFW Profile +type IPFIXDFWProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPFIX DFW Profile list results + Results []IPFIXDFWProfile +} + +func (s IPFIXDFWProfileListResult) GetType__() bindings.BindingType { + return IPFIXDFWProfileListResultBindingType() +} + +func (s IPFIXDFWProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXDFWProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPFIX packets will be collected on collector. IP and port address should be provided for collector. +type IPFIXL2Collector struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // IP address for the IPFIX L2 collector. IP addresses such as 0.0.0.0, 127.0.0.1, 255.255.255.255 are invalid. format: ip + CollectorIpAddress *string + // Port number for the IPFIX L2 collector. format: int32 + CollectorPort *int64 +} + +func (s IPFIXL2Collector) GetType__() bindings.BindingType { + return IPFIXL2CollectorBindingType() +} + +func (s IPFIXL2Collector) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXL2Collector._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPFIX L2 data will be collected on collectors. +type IPFIXL2CollectorProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // It accepts Multiple Collector objects. + IpfixL2Collectors []IPFIXL2Collector +} + +func (s IPFIXL2CollectorProfile) GetType__() bindings.BindingType { + return IPFIXL2CollectorProfileBindingType() +} + +func (s IPFIXL2CollectorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXL2CollectorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged list of IPFIX collector profiles. +type IPFIXL2CollectorProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPFIX collector Profile list results + Results []IPFIXL2CollectorProfile +} + +func (s IPFIXL2CollectorProfileListResult) GetType__() bindings.BindingType { + return IPFIXL2CollectorProfileListResultBindingType() +} + +func (s IPFIXL2CollectorProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXL2CollectorProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPFIX data from source logical segment, port, group will be forwarded to IPFIX collector. +type IPFIXL2Profile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // The time in seconds after a flow is expired even if more packets matching this flow are received by the cache. format: int32 + ActiveTimeout *int64 + // This property controls whether overlay flow info is included in the sample result. + ExportOverlayFlow *bool + // The time in seconds after a flow is expired if no more packets matching this flow are received by the cache. format: int32 + IdleTimeout *int64 + // Policy path for IPFIX collector profile. User can specify only one IPFIX collector. + IpfixCollectorProfilePath *string + // The maximum number of flow entries in each exporter flow cache. format: int64 + MaxFlows *int64 + // An identifier that is unique to the exporting process and used to meter the flows. format: int64 + ObservationDomainId *int64 + // The probability in percentage that a packet is sampled, in range 0-100. The probability is equal for every packet. + PacketSampleProbability *float64 + // This priority field is used to resolve conflicts in Segment Ports which are covered by more than one IPFIX profiles. The IPFIX exporter will send records to Collectors in highest priority profile (lowest number) only. format: int32 + Priority *int64 +} + +func (s IPFIXL2Profile) GetType__() bindings.BindingType { + return IPFIXL2ProfileBindingType() +} + +func (s IPFIXL2Profile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXL2Profile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of IPFIX L2 Profile +type IPFIXL2ProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPFIX L2 Profile list results + Results []IPFIXL2Profile +} + +func (s IPFIXL2ProfileListResult) GetType__() bindings.BindingType { + return IPFIXL2ProfileListResultBindingType() +} + +func (s IPFIXL2ProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPFIXL2ProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type IPInfo struct { + // IPv4 Addresses format: ipv4 + IpAddresses []string + // Subnet Prefix Length format: int64 + PrefixLength *int64 +} + +func (s IPInfo) GetType__() bindings.BindingType { + return IPInfoBindingType() +} + +func (s IPInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A ServiceEntry that represents an IP protocol +type IPProtocolServiceEntry struct { + ProtocolNumber *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IPProtocolServiceEntry__TYPE_IDENTIFIER = "IPProtocolServiceEntry" + +func (s IPProtocolServiceEntry) GetType__() bindings.BindingType { + return IPProtocolServiceEntryBindingType() +} + +func (s IPProtocolServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPProtocolServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Dead peer detection (DPD) is a method that allows detection of unreachable internet key excahnge (IKE) peers. Any changes affects all IPSec VPN sessions consuming this profile. +type IPSecVpnDpdProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // DPD probe interval defines an interval for DPD probes (in seconds). - When the DPD probe mode is periodic, this interval is the number of seconds between DPD messages. - When the DPD probe mode is on-demand, this interval is the number of seconds during which traffic is not received from the peer before DPD retry messages are sent if there is IPSec traffic to send. For PERIODIC Mode: Minimum: 3 Maximum: 360 Default: 60 For ON_DEMAND Mode: Minimum: 1 Maximum: 10 Default: 3 format: int64 + DpdProbeInterval *int64 + // Possible values are: + // + // * IPSecVpnDpdProfile#IPSecVpnDpdProfile_DPD_PROBE_MODE_PERIODIC + // * IPSecVpnDpdProfile#IPSecVpnDpdProfile_DPD_PROBE_MODE_ON_DEMAND + // + // DPD probe mode is used to query the liveliness of the peer. Two modes are possible: - PERIODIC: is used to query the liveliness of the peer at regular intervals (dpd_probe_interval). It does not take into consideration traffic coming from the peer. The benefit of this mode over the on-demand mode is earlier detection of dead peers. However, use of periodic DPD incurs extra overhead. When communicating to large numbers of peers, please consider using on-demand DPD instead. - ON_DEMAND: is used to query the liveliness of the peer by instructing the local endpoint to send DPD message to a peer if there is traffic to send to the peer AND the peer was idle for dpd_probe_interval seconds (i.e. there was no traffic from the peer for dpd_probe_interval seconds). + DpdProbeMode *string + // If true, enable dead peer detection. + Enabled *bool + // Maximum number of DPD messages' retry attempts. This value is applicable for both dpd probe modes, periodic and on-demand. format: int64 + RetryCount *int64 +} +const IPSecVpnDpdProfile_DPD_PROBE_MODE_PERIODIC = "PERIODIC" +const IPSecVpnDpdProfile_DPD_PROBE_MODE_ON_DEMAND = "ON_DEMAND" + +func (s IPSecVpnDpdProfile) GetType__() bindings.BindingType { + return IPSecVpnDpdProfileBindingType() +} + +func (s IPSecVpnDpdProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnDpdProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IKE Profile is a reusable profile that captures IKE phase one negotiation parameters. Any changes affects all IPSec VPN sessions consuming this profile. +type IPSecVpnIkeProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DH_GROUPS_GROUP2 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DH_GROUPS_GROUP5 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DH_GROUPS_GROUP14 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DH_GROUPS_GROUP15 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DH_GROUPS_GROUP16 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DH_GROUPS_GROUP19 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DH_GROUPS_GROUP20 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DH_GROUPS_GROUP21 + // + // Diffie-Hellman group to be used if PFS is enabled. Default is GROUP14. + DhGroups []string + // Possible values are: + // + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DIGEST_ALGORITHMS_SHA1 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DIGEST_ALGORITHMS_SHA2_256 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DIGEST_ALGORITHMS_SHA2_384 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_DIGEST_ALGORITHMS_SHA2_512 + // + // Algorithm to be used for message digest during Internet Key Exchange(IKE) negotiation. Default is SHA2_256. + DigestAlgorithms []string + // Possible values are: + // + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_128 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_256 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_GCM_128 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_GCM_192 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_GCM_256 + // + // Encryption algorithm is used during Internet Key Exchange(IKE) negotiation. Default is AES_128. + EncryptionAlgorithms []string + // Possible values are: + // + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_IKE_VERSION_V1 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_IKE_VERSION_V2 + // * IPSecVpnIkeProfile#IPSecVpnIkeProfile_IKE_VERSION_FLEX + // + // IKE protocol version to be used. IKE-Flex will initiate IKE-V2 and responds to both IKE-V1 and IKE-V2. + IkeVersion *string + // Life time for security association. Default is 86400 seconds (1 day). format: int64 + SaLifeTime *int64 +} +const IPSecVpnIkeProfile_DH_GROUPS_GROUP2 = "GROUP2" +const IPSecVpnIkeProfile_DH_GROUPS_GROUP5 = "GROUP5" +const IPSecVpnIkeProfile_DH_GROUPS_GROUP14 = "GROUP14" +const IPSecVpnIkeProfile_DH_GROUPS_GROUP15 = "GROUP15" +const IPSecVpnIkeProfile_DH_GROUPS_GROUP16 = "GROUP16" +const IPSecVpnIkeProfile_DH_GROUPS_GROUP19 = "GROUP19" +const IPSecVpnIkeProfile_DH_GROUPS_GROUP20 = "GROUP20" +const IPSecVpnIkeProfile_DH_GROUPS_GROUP21 = "GROUP21" +const IPSecVpnIkeProfile_DIGEST_ALGORITHMS_SHA1 = "SHA1" +const IPSecVpnIkeProfile_DIGEST_ALGORITHMS_SHA2_256 = "SHA2_256" +const IPSecVpnIkeProfile_DIGEST_ALGORITHMS_SHA2_384 = "SHA2_384" +const IPSecVpnIkeProfile_DIGEST_ALGORITHMS_SHA2_512 = "SHA2_512" +const IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_128 = "AES_128" +const IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_256 = "AES_256" +const IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_GCM_128 = "AES_GCM_128" +const IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_GCM_192 = "AES_GCM_192" +const IPSecVpnIkeProfile_ENCRYPTION_ALGORITHMS_GCM_256 = "AES_GCM_256" +const IPSecVpnIkeProfile_IKE_VERSION_V1 = "IKE_V1" +const IPSecVpnIkeProfile_IKE_VERSION_V2 = "IKE_V2" +const IPSecVpnIkeProfile_IKE_VERSION_FLEX = "IKE_FLEX" + +func (s IPSecVpnIkeProfile) GetType__() bindings.BindingType { + return IPSecVpnIkeProfileBindingType() +} + +func (s IPSecVpnIkeProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnIkeProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Local endpoint represents a tier-0/tier-1 on which tunnel needs to be terminated. +type IPSecVpnLocalEndpoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Policy path referencing site certificate. + CertificatePath *string + // IPV4 Address of local endpoint. format: ipv4 + LocalAddress *string + // Local identifier. + LocalId *string + // List of policy paths referencing certificate authority (CA) to verify peer certificates. + TrustCaPaths []string + // List of policy paths referencing certificate revocation list (CRL) to peer certificates. + TrustCrlPaths []string +} + +func (s IPSecVpnLocalEndpoint) GetType__() bindings.BindingType { + return IPSecVpnLocalEndpointBindingType() +} + +func (s IPSecVpnLocalEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnLocalEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// For policy-based IPsec VPNs, a security policy specifies as its action the VPN tunnel to be used for transit traffic that meets the policy’s match criteria. +type IPSecVpnRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * IPSecVpnRule#IPSecVpnRule_ACTION_PROTECT + // * IPSecVpnRule#IPSecVpnRule_ACTION_BYPASS + // + // PROTECT - Protect rules are defined per policy based IPSec VPN session. BYPASS - Bypass rules are defined per IPSec VPN service and affects all policy based IPSec VPN sessions. Bypass rules are prioritized over protect rules. + Action *string + // List of peer subnets. Specifying no value is interpreted as 0.0.0.0/0. + Destinations []IPSecVpnSubnet + // A flag to enable/disable the rule. + Enabled *bool + // A flag to enable/disable the logging for the rule. + Logged *bool + // A sequence number is used to give a priority to an IPSecVpnRule. format: int32 + SequenceNumber *int64 + // List of local subnets. Specifying no value is interpreted as 0.0.0.0/0. + Sources []IPSecVpnSubnet +} +const IPSecVpnRule_ACTION_PROTECT = "PROTECT" +const IPSecVpnRule_ACTION_BYPASS = "BYPASS" + +func (s IPSecVpnRule) GetType__() bindings.BindingType { + return IPSecVpnRuleBindingType() +} + +func (s IPSecVpnRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Create and manage IPSec VPN service for given locale service. +type IPSecVpnService struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Bypass policy rules are configured using VPN service. Bypass rules always have higher priority over protect rules and they affect all policy based vpn sessions associated with the IPSec VPN service. Protect rules are defined per policy based vpn session. + BypassRules []IPSecVpnRule + // If true, enable VPN services for given locale service. + Enabled *bool + // Enable/disable IPSec HA state sync. IPSec HA state sync can be disabled if in case there are performance issues w.r.t. the state sync messages. + HaSync *bool + // Possible values are: + // + // * IPSecVpnService#IPSecVpnService_IKE_LOG_LEVEL_DEBUG + // * IPSecVpnService#IPSecVpnService_IKE_LOG_LEVEL_INFO + // * IPSecVpnService#IPSecVpnService_IKE_LOG_LEVEL_WARN + // * IPSecVpnService#IPSecVpnService_IKE_LOG_LEVEL_ERROR + // * IPSecVpnService#IPSecVpnService_IKE_LOG_LEVEL_EMERGENCY + // + // Log level for internet key exchange (IKE). + IkeLogLevel *string +} +const IPSecVpnService_IKE_LOG_LEVEL_DEBUG = "DEBUG" +const IPSecVpnService_IKE_LOG_LEVEL_INFO = "INFO" +const IPSecVpnService_IKE_LOG_LEVEL_WARN = "WARN" +const IPSecVpnService_IKE_LOG_LEVEL_ERROR = "ERROR" +const IPSecVpnService_IKE_LOG_LEVEL_EMERGENCY = "EMERGENCY" + +func (s IPSecVpnService) GetType__() bindings.BindingType { + return IPSecVpnServiceBindingType() +} + +func (s IPSecVpnService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// VPN session defines connection between local and peer endpoint. Until VPN session is defined configuration is not realized. +type IPSecVpnSession struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_RESOURCE_TYPE_POLICYBASEDIPSECVPNSESSION + // * IPSecVpnSession#IPSecVpnSession_RESOURCE_TYPE_ROUTEBASEDIPSECVPNSESSION + // + // A Policy Based VPN requires to define protect rules that match local and peer subnets. IPSec security associations is negotiated for each pair of local and peer subnet. A Route Based VPN is more flexible, more powerful and recommended over policy based VPN. IP Tunnel port is created and all traffic routed via tunnel port is protected. Routes can be configured statically or can be learned through BGP. A route based VPN is must for establishing redundant VPN session to remote site. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_AUTHENTICATION_MODE_PSK + // * IPSecVpnSession#IPSecVpnSession_AUTHENTICATION_MODE_CERTIFICATE + // + // Peer authentication mode. PSK - In this mode a secret key shared between local and peer sites is to be used for authentication. The secret key can be a string with a maximum length of 128 characters. CERTIFICATE - In this mode a certificate defined at the global level is to be used for authentication. + AuthenticationMode *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_CNSA + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_SUITE_B_GCM_128 + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_SUITE_B_GCM_256 + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_PRIME + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_FOUNDATION + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_FIPS + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_NONE + // + // Compliance suite. + ComplianceSuite *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_INITIATOR + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_RESPOND_ONLY + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_ON_DEMAND + // + // Connection initiation mode used by local endpoint to establish ike connection with peer site. INITIATOR - In this mode local endpoint initiates tunnel setup and will also respond to incoming tunnel setup requests from peer gateway. RESPOND_ONLY - In this mode, local endpoint shall only respond to incoming tunnel setup requests. It shall not initiate the tunnel setup. ON_DEMAND - In this mode local endpoint will initiate tunnel creation once first packet matching the policy rule is received and will also respond to incoming initiation request. + ConnectionInitiationMode *string + // Policy path referencing Dead Peer Detection (DPD) profile. Default is set to system default profile. + DpdProfilePath *string + // Enable/Disable IPSec VPN session. + Enabled *bool + // Policy path referencing IKE profile to be used. Default is set according to system default profile. + IkeProfilePath *string + // Policy path referencing Local endpoint. + LocalEndpointPath *string + // Public IPV4 address of the remote device terminating the VPN connection. + PeerAddress *string + // Peer ID to uniquely identify the peer site. The peer ID is the public IP address of the remote device terminating the VPN tunnel. When NAT is configured for the peer, enter the private IP address of the peer. + PeerId *string + // IPSec Pre-shared key. Maximum length of this field is 128 characters. + Psk *string + // TCP Maximum Segment Size Clamping Direction and Value. + TcpMssClamping *TcpMaximumSegmentSizeClamping + // Policy path referencing Tunnel profile to be used. Default is set to system default profile. + TunnelProfilePath *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IPSecVpnSession__TYPE_IDENTIFIER = "IPSecVpnSession" +const IPSecVpnSession_RESOURCE_TYPE_POLICYBASEDIPSECVPNSESSION = "PolicyBasedIPSecVpnSession" +const IPSecVpnSession_RESOURCE_TYPE_ROUTEBASEDIPSECVPNSESSION = "RouteBasedIPSecVpnSession" +const IPSecVpnSession_AUTHENTICATION_MODE_PSK = "PSK" +const IPSecVpnSession_AUTHENTICATION_MODE_CERTIFICATE = "CERTIFICATE" +const IPSecVpnSession_COMPLIANCE_SUITE_CNSA = "CNSA" +const IPSecVpnSession_COMPLIANCE_SUITE_SUITE_B_GCM_128 = "SUITE_B_GCM_128" +const IPSecVpnSession_COMPLIANCE_SUITE_SUITE_B_GCM_256 = "SUITE_B_GCM_256" +const IPSecVpnSession_COMPLIANCE_SUITE_PRIME = "PRIME" +const IPSecVpnSession_COMPLIANCE_SUITE_FOUNDATION = "FOUNDATION" +const IPSecVpnSession_COMPLIANCE_SUITE_FIPS = "FIPS" +const IPSecVpnSession_COMPLIANCE_SUITE_NONE = "NONE" +const IPSecVpnSession_CONNECTION_INITIATION_MODE_INITIATOR = "INITIATOR" +const IPSecVpnSession_CONNECTION_INITIATION_MODE_RESPOND_ONLY = "RESPOND_ONLY" +const IPSecVpnSession_CONNECTION_INITIATION_MODE_ON_DEMAND = "ON_DEMAND" + +func (s IPSecVpnSession) GetType__() bindings.BindingType { + return IPSecVpnSessionBindingType() +} + +func (s IPSecVpnSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Used to specify the local/peer subnets in IPSec VPN rule. +type IPSecVpnSubnet struct { + // Subnet used in policy rule. format: ipv4-cidr-block + Subnet *string +} + +func (s IPSecVpnSubnet) GetType__() bindings.BindingType { + return IPSecVpnSubnetBindingType() +} + +func (s IPSecVpnSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IP tunnel interface configuration. +type IPSecVpnTunnelInterface struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // IP Tunnel interface (commonly referred as VTI) subnet. + IpSubnets []TunnelInterfaceIPSubnet +} + +func (s IPSecVpnTunnelInterface) GetType__() bindings.BindingType { + return IPSecVpnTunnelInterfaceBindingType() +} + +func (s IPSecVpnTunnelInterface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnTunnelInterface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPSec VPN tunnel profile is a reusable profile that captures phase two negotiation parameters and IPSec tunnel properties. Any changes affects all IPSec VPN sessions consuming this profile. +type IPSecVpnTunnelProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DF_POLICY_COPY + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DF_POLICY_CLEAR + // + // Defragmentation policy helps to handle defragmentation bit present in the inner packet. COPY copies the defragmentation bit from the inner IP packet into the outer packet. CLEAR ignores the defragmentation bit present in the inner packet. + DfPolicy *string + // Possible values are: + // + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DH_GROUPS_GROUP2 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DH_GROUPS_GROUP5 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DH_GROUPS_GROUP14 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DH_GROUPS_GROUP15 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DH_GROUPS_GROUP16 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DH_GROUPS_GROUP19 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DH_GROUPS_GROUP20 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DH_GROUPS_GROUP21 + // + // Diffie-Hellman group to be used if PFS is enabled. Default is GROUP14. + DhGroups []string + // Possible values are: + // + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DIGEST_ALGORITHMS_SHA1 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DIGEST_ALGORITHMS_SHA2_256 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DIGEST_ALGORITHMS_SHA2_384 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_DIGEST_ALGORITHMS_SHA2_512 + // + // Algorithm to be used for message digest. Default digest algorithm is implicitly covered by default encryption algorithm \"AES_GCM_128\". + DigestAlgorithms []string + // If true, perfect forward secrecy (PFS) is enabled. + EnablePerfectForwardSecrecy *bool + // Possible values are: + // + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_128 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_256 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_128 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_192 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_256 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_128 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_192 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_256 + // * IPSecVpnTunnelProfile#IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION + // + // Encryption algorithm to encrypt/decrypt the messages exchanged between IPSec VPN initiator and responder during tunnel negotiation. Default is AES_GCM_128. + EncryptionAlgorithms []string + // Collection of type specific properties. As of now, to hold encapsulation mode and transform protocol. + ExtendedAttributes []AttributeVal + // SA life time specifies the expiry time of security association. Default is 3600 seconds. format: int64 + SaLifeTime *int64 +} +const IPSecVpnTunnelProfile_DF_POLICY_COPY = "COPY" +const IPSecVpnTunnelProfile_DF_POLICY_CLEAR = "CLEAR" +const IPSecVpnTunnelProfile_DH_GROUPS_GROUP2 = "GROUP2" +const IPSecVpnTunnelProfile_DH_GROUPS_GROUP5 = "GROUP5" +const IPSecVpnTunnelProfile_DH_GROUPS_GROUP14 = "GROUP14" +const IPSecVpnTunnelProfile_DH_GROUPS_GROUP15 = "GROUP15" +const IPSecVpnTunnelProfile_DH_GROUPS_GROUP16 = "GROUP16" +const IPSecVpnTunnelProfile_DH_GROUPS_GROUP19 = "GROUP19" +const IPSecVpnTunnelProfile_DH_GROUPS_GROUP20 = "GROUP20" +const IPSecVpnTunnelProfile_DH_GROUPS_GROUP21 = "GROUP21" +const IPSecVpnTunnelProfile_DIGEST_ALGORITHMS_SHA1 = "SHA1" +const IPSecVpnTunnelProfile_DIGEST_ALGORITHMS_SHA2_256 = "SHA2_256" +const IPSecVpnTunnelProfile_DIGEST_ALGORITHMS_SHA2_384 = "SHA2_384" +const IPSecVpnTunnelProfile_DIGEST_ALGORITHMS_SHA2_512 = "SHA2_512" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_128 = "AES_128" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_256 = "AES_256" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_128 = "AES_GCM_128" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_192 = "AES_GCM_192" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_256 = "AES_GCM_256" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_128 = "NO_ENCRYPTION_AUTH_AES_GMAC_128" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_192 = "NO_ENCRYPTION_AUTH_AES_GMAC_192" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_256 = "NO_ENCRYPTION_AUTH_AES_GMAC_256" +const IPSecVpnTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION = "NO_ENCRYPTION" + +func (s IPSecVpnTunnelProfile) GetType__() bindings.BindingType { + return IPSecVpnTunnelProfileBindingType() +} + +func (s IPSecVpnTunnelProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVpnTunnelProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains IPv4 related discovery options. +type IPv4DiscoveryOptions struct { + // Indicates ARP snooping options + ArpSnoopingConfig *ArpSnoopingConfig + // Indicates whether DHCP snooping is enabled + DhcpSnoopingEnabled *bool + // Indicates whether fetching IP using vm-tools is enabled. This option is only supported on ESX where vm-tools is installed. + VmtoolsEnabled *bool +} + +func (s IPv4DiscoveryOptions) GetType__() bindings.BindingType { + return IPv4DiscoveryOptionsBindingType() +} + +func (s IPv4DiscoveryOptions) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv4DiscoveryOptions._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPv6 DAD status +type IPv6DADStatus struct { + // IP address on the port for which DAD status is reported. format: ip + IpAddress *string + // Possible values are: + // + // * IPv6DADStatus#IPv6DADStatus_STATUS_DUPLICATED + // * IPv6DADStatus#IPv6DADStatus_STATUS_TENTATIVE + // * IPv6DADStatus#IPv6DADStatus_STATUS_ASSIGNED + // * IPv6DADStatus#IPv6DADStatus_STATUS_NOT_APPLICABLE + // * IPv6DADStatus#IPv6DADStatus_STATUS_UNKNOWN + // + // DAD status for IP address on the port. + Status *string + // Array of transport node id on which DAD status is reported for given IP address. + TransportNode []ResourceReference +} +const IPv6DADStatus_STATUS_DUPLICATED = "DUPLICATED" +const IPv6DADStatus_STATUS_TENTATIVE = "TENTATIVE" +const IPv6DADStatus_STATUS_ASSIGNED = "ASSIGNED" +const IPv6DADStatus_STATUS_NOT_APPLICABLE = "NOT_APPLICABLE" +const IPv6DADStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s IPv6DADStatus) GetType__() bindings.BindingType { + return IPv6DADStatusBindingType() +} + +func (s IPv6DADStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv6DADStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains IPv6 related discovery options. +type IPv6DiscoveryOptions struct { + // Enable this method will snoop the DHCPv6 message transaction which a VM makes with a DHCPv6 server. From the transaction, we learn the IPv6 addresses assigned by the DHCPv6 server to this VM along with its lease time. + DhcpSnoopingV6Enabled *bool + // Indicates ND snooping options + NdSnoopingConfig *NdSnoopingConfig + // Enable this method will learn the IPv6 addresses which are configured on interfaces of a VM with the help of the VMTools software. + VmtoolsV6Enabled *bool +} + +func (s IPv6DiscoveryOptions) GetType__() bindings.BindingType { + return IPv6DiscoveryOptionsBindingType() +} + +func (s IPv6DiscoveryOptions) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv6DiscoveryOptions._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IPv6 status +type IPv6Status struct { + // Path of the segment attached to the interface. + ConnectedSegmentPath *string + // Array of DAD status which contains DAD information for IP addresses on the interface. + DadStatuses []IPv6DADStatus + // Policy path or realization ID of interface for which IPv6 DAD status is returned. + InterfaceId *string +} + +func (s IPv6Status) GetType__() bindings.BindingType { + return IPv6StatusBindingType() +} + +func (s IPv6Status) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv6Status._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type IcmpEchoRequestHeader struct { + // ICMP id format: int64 + Id *int64 + // ICMP sequence number format: int64 + Sequence *int64 +} + +func (s IcmpEchoRequestHeader) GetType__() bindings.BindingType { + return IcmpEchoRequestHeaderBindingType() +} + +func (s IcmpEchoRequestHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IcmpEchoRequestHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the PolicyLbRule object. This represents active health monitoring over ICMP. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healt hchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type IcmpPolicyLbMonitorProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_TCPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_UDPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_ICMPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPSPOLICYLBMONITORPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IcmpPolicyLbMonitorProfile__TYPE_IDENTIFIER = "IcmpPolicyLbMonitorProfile" + +func (s IcmpPolicyLbMonitorProfile) GetType__() bindings.BindingType { + return IcmpPolicyLbMonitorProfileBindingType() +} + +func (s IcmpPolicyLbMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IcmpPolicyLbMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Icon to be applied at dashboard for widgets and UI elements. +type Icon struct { + // Possible values are: + // + // * Icon#Icon_PLACEMENT_PRE + // * Icon#Icon_PLACEMENT_POST + // + // If specified as PRE, the icon appears before the UI element. If set as POST, the icon appears after the UI element. + Placement *string + // Multi-line text to be shown on tooltip while hovering over the icon. + Tooltip []Tooltip + // Possible values are: + // + // * Icon#Icon_TYPE_ERROR + // * Icon#Icon_TYPE_WARNING + // * Icon#Icon_TYPE_INFO + // * Icon#Icon_TYPE_INPROGRESS + // * Icon#Icon_TYPE_SUCCESS + // * Icon#Icon_TYPE_DETAIL + // * Icon#Icon_TYPE_NOT_AVAILABLE + // * Icon#Icon_TYPE_SECURITY + // * Icon#Icon_TYPE_NETWORKING + // * Icon#Icon_TYPE_LOAD_BALANCER + // * Icon#Icon_TYPE_VPN + // * Icon#Icon_TYPE_DOMAIN + // * Icon#Icon_TYPE_GROUP + // * Icon#Icon_TYPE_DISTRIBUTED_FIREWALL + // * Icon#Icon_TYPE_NETWORKING_TIER0 + // * Icon#Icon_TYPE_NETWORKING_TIER1 + // * Icon#Icon_TYPE_SEGMENT + // * Icon#Icon_TYPE_SYSTEM + // * Icon#Icon_TYPE_SYSTEM_FABRIC + // * Icon#Icon_TYPE_SYSTEM_BACKUPRESTORE + // * Icon#Icon_TYPE_INVENTORY_GROUPS + // * Icon#Icon_TYPE_SECURITY_DFW + // + // Icon will be rendered based on its type. For example, if ERROR is chosen, then icon representing error will be rendered. + Type_ *string +} +const Icon_PLACEMENT_PRE = "PRE" +const Icon_PLACEMENT_POST = "POST" +const Icon_TYPE_ERROR = "ERROR" +const Icon_TYPE_WARNING = "WARNING" +const Icon_TYPE_INFO = "INFO" +const Icon_TYPE_INPROGRESS = "INPROGRESS" +const Icon_TYPE_SUCCESS = "SUCCESS" +const Icon_TYPE_DETAIL = "DETAIL" +const Icon_TYPE_NOT_AVAILABLE = "NOT_AVAILABLE" +const Icon_TYPE_SECURITY = "SECURITY" +const Icon_TYPE_NETWORKING = "NETWORKING" +const Icon_TYPE_LOAD_BALANCER = "LOAD_BALANCER" +const Icon_TYPE_VPN = "VPN" +const Icon_TYPE_DOMAIN = "DOMAIN" +const Icon_TYPE_GROUP = "GROUP" +const Icon_TYPE_DISTRIBUTED_FIREWALL = "DISTRIBUTED_FIREWALL" +const Icon_TYPE_NETWORKING_TIER0 = "NETWORKING_TIER0" +const Icon_TYPE_NETWORKING_TIER1 = "NETWORKING_TIER1" +const Icon_TYPE_SEGMENT = "SEGMENT" +const Icon_TYPE_SYSTEM = "SYSTEM" +const Icon_TYPE_SYSTEM_FABRIC = "SYSTEM_FABRIC" +const Icon_TYPE_SYSTEM_BACKUPRESTORE = "SYSTEM_BACKUPRESTORE" +const Icon_TYPE_INVENTORY_GROUPS = "INVENTORY_GROUPS" +const Icon_TYPE_SECURITY_DFW = "SECURITY_DFW" + +func (s Icon) GetType__() bindings.BindingType { + return IconBindingType() +} + +func (s Icon) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Icon._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a list of identity group (Ad group SID) expressions. +type IdentityGroupExpression struct { + // This array consists of set of identity group object. All members within this array are implicitly OR'ed together. + IdentityGroups []IdentityGroupInfo + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IdentityGroupExpression__TYPE_IDENTIFIER = "IdentityGroupExpression" + +func (s IdentityGroupExpression) GetType__() bindings.BindingType { + return IdentityGroupExpressionBindingType() +} + +func (s IdentityGroupExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdentityGroupExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Identity (Directory) group +type IdentityGroupInfo struct { + // Each LDAP object is uniquely identified by its distinguished name (DN). A DN is a sequence of relative distinguished names (RDN) connected by commas. e.g. CN=Larry Cole,CN=admin,DC=corp,DC=acme,DC=com. A valid fully qualified distinguished name should be provided to include specific groups else the create / update realization of the Group containing an invalid/ partial DN will fail. This value is valid only if it matches to exactly 1 LDAP object on the LDAP server. + DistinguishedName *string + // This is the base distinguished name for the domain where this particular group resides. (e.g. dc=example,dc=com) Each active directory domain has a domain naming context (NC), which contains domain-specific data. The root of this naming context is represented by a domain's distinguished name (DN) and is typically referred to as the NC head. + DomainBaseDistinguishedName *string + // A security identifier (SID) is a unique value of variable length used to identify a trustee. A SID consists of the following components: The revision level of the SID structure; A 48-bit identifier authority value that identifies the authority that issued the SID; A variable number of subauthority or relative identifier (RID) values that uniquely identify the trustee relative to the authority that issued the SID. This field is only populated for Microsoft Active Directory identity store. + Sid *string +} + +func (s IdentityGroupInfo) GetType__() bindings.BindingType { + return IdentityGroupInfoBindingType() +} + +func (s IdentityGroupInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdentityGroupInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Information about a single LDAP server. +type IdentitySourceLdapServer struct { + // A username used to authenticate to the directory when admnistering roles in NSX. This user should have privileges to search the LDAP directory for groups and users. This user is also used in some cases (OpenLDAP) to look up an NSX user's distinguished name based on their NSX login name. If omitted, NSX will authenticate to the LDAP server using an LDAP anonymous bind operation. For Active Directory, provide a userPrincipalName (e.g. administrator\\\\@airius.com) or the full distinguished nane. For OpenLDAP, provide the distinguished name of the user (e.g. uid=admin, cn=airius, dc=com). + BindIdentity *string + // If using LDAPS or STARTTLS, provide the X.509 certificate of the LDAP server in PEM format. This property is not required when connecting without TLS encryption and is ignored in that case. + Certificates []string + // Allows the LDAP server to be enabled or disabled. When disabled, this LDAP server will not be used to authenticate users. + Enabled *bool + // A password used when authenticating to the directory. + Password *string + // The URL for the LDAP server. Supported URL schemes are LDAP and LDAPS. Either a hostname or an IP address may be given, and the port number is optional and defaults to 389 for the LDAP scheme and 636 for the LDAPS scheme. + Url *string + // If set to true, Use the StartTLS extended operation to upgrade the connection to TLS before sending any sensitive information. The LDAP server must support the StartTLS extended operation in order for this protocol to operate correctly. This option is ignored if the URL scheme is LDAPS. + UseStarttls *bool +} + +func (s IdentitySourceLdapServer) GetType__() bindings.BindingType { + return IdentitySourceLdapServerBindingType() +} + +func (s IdentitySourceLdapServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdentitySourceLdapServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Information about a single LDAP server endpoint. +type IdentitySourceLdapServerEndpoint struct { + // The URL for the LDAP server. Supported URL schemes are LDAP and LDAPS. Either a hostname or an IP address may be given, and the port number is optional and defaults to 389 for the LDAP scheme and 636 for the LDAPS scheme. + Url *string + // If set to true, Use the StartTLS extended operation to upgrade the connection to TLS before sending any sensitive information. The LDAP server must support the StartTLS extended operation in order for this protocol to operate correctly. This option is ignored if the URL scheme is LDAPS. + UseStarttls *bool +} + +func (s IdentitySourceLdapServerEndpoint) GetType__() bindings.BindingType { + return IdentitySourceLdapServerEndpointBindingType() +} + +func (s IdentitySourceLdapServerEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdentitySourceLdapServerEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The results of probing an individual LDAP server. +type IdentitySourceLdapServerProbeResult struct { + // Detail about errors encountered during the probe. + Errors []LdapProbeError + // Possible values are: + // + // * IdentitySourceLdapServerProbeResult#IdentitySourceLdapServerProbeResult_RESULT_SUCCESS + // * IdentitySourceLdapServerProbeResult#IdentitySourceLdapServerProbeResult_RESULT_FAILURE + // + // Overall result of the probe. If the probe was able to connect to the LDAP service, authenticate using the provided credentials, and perform searches of the configured user and group search bases without error, the result is SUCCESS. Otherwise, the result is FAILURE, and additional details may be found in the errors property. + Result *string + // THe URL of the probed LDAP host. + Url *string +} +const IdentitySourceLdapServerProbeResult_RESULT_SUCCESS = "SUCCESS" +const IdentitySourceLdapServerProbeResult_RESULT_FAILURE = "FAILURE" + +func (s IdentitySourceLdapServerProbeResult) GetType__() bindings.BindingType { + return IdentitySourceLdapServerProbeResultBindingType() +} + +func (s IdentitySourceLdapServerProbeResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdentitySourceLdapServerProbeResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IDS configuration to enable/disable IDS on cluster level. +type IdsClusterConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Contains policy resource reference object + Cluster *PolicyResourceReference + // If set to true, IDS is enabled on the respective cluster + IdsEnabled *bool +} + +func (s IdsClusterConfig) GetType__() bindings.BindingType { + return IdsClusterConfigBindingType() +} + +func (s IdsClusterConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsClusterConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IDS Profile which contains the signatures and will be used in IDS rules. +type IdsProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Represents the severities of signatures which are part of this profile. + Severities []IdsProfileSeverity +} + +func (s IdsProfile) GetType__() bindings.BindingType { + return IdsProfileBindingType() +} + +func (s IdsProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Intrusion Detection System Profile severity. +type IdsProfileSeverity struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Contains the id of signatures that will be ignored as part of the profile. + IgnoreSignatures []string + // Possible values are: + // + // * IdsProfileSeverity#IdsProfileSeverity_SEVERITY_CRITICAL + // * IdsProfileSeverity#IdsProfileSeverity_SEVERITY_HIGH + // * IdsProfileSeverity#IdsProfileSeverity_SEVERITY_MEDIUM + // * IdsProfileSeverity#IdsProfileSeverity_SEVERITY_LOW + // + // Represents the severity of a profile. + Severity *string +} +const IdsProfileSeverity_SEVERITY_CRITICAL = "CRITICAL" +const IdsProfileSeverity_SEVERITY_HIGH = "HIGH" +const IdsProfileSeverity_SEVERITY_MEDIUM = "MEDIUM" +const IdsProfileSeverity_SEVERITY_LOW = "LOW" + +func (s IdsProfileSeverity) GetType__() bindings.BindingType { + return IdsProfileSeverityBindingType() +} + +func (s IdsProfileSeverity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsProfileSeverity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the Intrusion Detection System rule which indicates the action to be performed for the corresponding workload groups. +type IdsRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + DestinationGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the destination groups. If false, the rule applies to the destination groups + DestinationsExcluded *bool + // Possible values are: + // + // * IdsRule#IdsRule_DIRECTION_IN + // * IdsRule#IdsRule_DIRECTION_OUT + // * IdsRule#IdsRule_DIRECTION_IN_OUT + // + // Define direction of traffic. + Direction *string + // Flag to disable the rule. Default is enabled. + Disabled *bool + // Possible values are: + // + // * IdsRule#IdsRule_IP_PROTOCOL_IPV4 + // * IdsRule#IdsRule_IP_PROTOCOL_IPV6 + // * IdsRule#IdsRule_IP_PROTOCOL_IPV4_IPV6 + // + // Type of IP packet that should be matched while enforcing the rule. The value is set to IPV4_IPV6 for Layer3 rule if not specified. For Layer2/Ether rule the value must be null. + IpProtocol *string + // A flag to indicate whether rule is a default rule. + IsDefault *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // Text for additional notes on changes. + Notes *string + // Holds the list of layer 7 service profile paths. These profiles accept attributes and sub-attributes of various network services (e.g. L4 AppId, encryption algorithm, domain name, etc) as key value pairs. + Profiles []string + // This is a unique 4 byte positive number that is assigned by the system. This rule id is passed all the way down to the data path. The first 1GB (1000 to 2^30) will be shared by GM and LM with zebra style striped number space. For E.g 1000 to (1Million -1) by LM, (1M - 2M-1) by GM and so on. format: int64 + RuleId *int64 + // The list of policy paths where the rule is applied LR/Edge/T0/T1/LRP etc. Note that a given rule can be applied on multiple LRs/LRPs. + Scope []string + // This field is used to resolve conflicts between multiple Rules under Security or Gateway Policy for a Domain If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple rules with the same sequence number then their order is not deterministic. If a specific order of rules is desired, then one has to specify unique sequence numbers or use the POST request on the rule entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // In order to specify raw services this can be used, along with services which contains path to services. This can be empty or null. + ServiceEntries []*data.StructValue + // In order to specify all services, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the services array. Error will be thrown if ANY is used in conjunction with other values. + Services []string + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + SourceGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the source groups. If false, the rule applies to the source groups + SourcesExcluded *bool + // User level field which will be printed in CLI and packet logs. + Tag *string + // Possible values are: + // + // * IdsRule#IdsRule_ACTION_DETECT + // + // The action to be applied. + Action *string + // collections of IDS profiles. + IdsProfiles []string +} +const IdsRule_DIRECTION_IN = "IN" +const IdsRule_DIRECTION_OUT = "OUT" +const IdsRule_DIRECTION_IN_OUT = "IN_OUT" +const IdsRule_IP_PROTOCOL_IPV4 = "IPV4" +const IdsRule_IP_PROTOCOL_IPV6 = "IPV6" +const IdsRule_IP_PROTOCOL_IPV4_IPV6 = "IPV4_IPV6" +const IdsRule_ACTION_DETECT = "DETECT" + +func (s IdsRule) GetType__() bindings.BindingType { + return IdsRuleBindingType() +} + +func (s IdsRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the Intrusion Detection System Security Policy, which contains the list of IDS Rules. +type IdsSecurityPolicy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // - Distributed Firewall - Policy framework provides five pre-defined categories for classifying a security policy. They are \"Ethernet\",\"Emergency\", \"Infrastructure\" \"Environment\" and \"Application\". There is a pre-determined order in which the policy framework manages the priority of these security policies. Ethernet category is for supporting layer 2 firewall rules. The other four categories are applicable for layer 3 rules. Amongst them, the Emergency category has the highest priority followed by Infrastructure, Environment and then Application rules. Administrator can choose to categorize a security policy into the above categories or can choose to leave it empty. If empty it will have the least precedence w.r.t the above four categories. - Edge Firewall - Policy Framework for Edge Firewall provides six pre-defined categories \"Emergency\", \"SystemRules\", \"SharedPreRules\", \"LocalGatewayRules\", \"AutoServiceRules\" and \"Default\", in order of priority of rules. All categories are allowed for Gatetway Policies that belong to 'default' Domain. However, for user created domains, category is restricted to \"SharedPreRules\" or \"LocalGatewayRules\" only. Also, the users can add/modify/delete rules from only the \"SharedPreRules\" and \"LocalGatewayRules\" categories. If user doesn't specify the category then defaulted to \"Rules\". System generated category is used by NSX created rules, for example BFD rules. Autoplumbed category used by NSX verticals to autoplumb data path rules. Finally, \"Default\" category is the placeholder default rules with lowest in the order of priority. + Category *string + // Comments for security policy lock/unlock. + Comments *string + // This field is to indicate the internal sequence number of a policy with respect to the policies across categories. format: int32 + InternalSequenceNumber *int64 + // A flag to indicate whether policy is a default policy. + IsDefault *bool + // ID of the user who last modified the lock for the secruity policy. + LockModifiedBy *string + // SecurityPolicy locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Indicates whether a security policy should be locked. If the security policy is locked by a user, then no other user would be able to modify this security policy. Once the user releases the lock, other users can update this security policy. + Locked *bool + // The count of rules in the policy. format: int32 + RuleCount *int64 + // Provides a mechanism to apply the rules in this policy for a specified time duration. + SchedulerPath *string + // The list of group paths where the rules in this policy will get applied. This scope will take precedence over rule level scope. Supported only for security and redirection policies. In case of RedirectionPolicy, it is expected only when the policy is NS and redirecting to service chain. + Scope []string + // This field is used to resolve conflicts between security policies across domains. In order to change the sequence number of a policy one can fire a POST request on the policy entity with a query parameter action=revise The sequence number field will reflect the value of the computed sequence number upon execution of the above mentioned POST request. For scenarios where the administrator is using a template to update several security policies, the only way to set the sequence number is to explicitly specify the sequence number for each security policy. If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple policies with the same sequence number then their order is not deterministic. If a specific order of policies is desired, then one has to specify unique sequence numbers or use the POST request on the policy entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // Stateful or Stateless nature of security policy is enforced on all rules in this security policy. When it is stateful, the state of the network connects are tracked and a stateful packet inspection is performed. Layer3 security policies can be stateful or stateless. By default, they are stateful. Layer2 security policies can only be stateless. + Stateful *bool + // Ensures that a 3 way TCP handshake is done before the data packets are sent. tcp_strict=true is supported only for stateful security policies. + TcpStrict *bool + // IDS Rules that are a part of this SecurityPolicy + Rules []IdsRule +} + +func (s IdsSecurityPolicy) GetType__() bindings.BindingType { + return IdsSecurityPolicyBindingType() +} + +func (s IdsSecurityPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsSecurityPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Intrusion Detection System Signature . +type IdsSignature struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Target of the signature. + AttackTarget *string + // Possible values are: + // + // * IdsSignature#IdsSignature_CATEGORIES_APPLICATION + // * IdsSignature#IdsSignature_CATEGORIES_MALWARE + // * IdsSignature#IdsSignature_CATEGORIES_VULNERABILITY + // + // Represents the internal categories a signature belongs to. + Categories []string + // Class type of Signature. + ClassType *string + // CVE score + Cves []string + // Signature cvssv2 score. + Cvssv2 *string + // Signature cvssv3 score. + Cvssv3 *string + // Flow established from server, from client etc. + Flow *string + // Signature name. + Name *string + // Product affected by this signature. + ProductAffected *string + // Represents the severity of the Signature. + Severity *string + // Represents the Signature's id. + SignatureId *string + // Represents revision of the Signature. + SignatureRevision *string + // List of mitre attack URLs pertaining to signature + Urls []string +} +const IdsSignature_CATEGORIES_APPLICATION = "APPLICATION" +const IdsSignature_CATEGORIES_MALWARE = "MALWARE" +const IdsSignature_CATEGORIES_VULNERABILITY = "VULNERABILITY" + +func (s IdsSignature) GetType__() bindings.BindingType { + return IdsSignatureBindingType() +} + +func (s IdsSignature) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsSignature._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IDS configuration to enable/disable IDS on standalone host level. +type IdsStandaloneHostConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If set to true, IDS is enabled on standalone hosts. + IdsEnabled *bool +} + +func (s IdsStandaloneHostConfig) GetType__() bindings.BindingType { + return IdsStandaloneHostConfigBindingType() +} + +func (s IdsStandaloneHostConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsStandaloneHostConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A list of fields to include in query results +type IncludedFieldsParameters struct { + // Comma separated list of fields that should be included in query result + IncludedFields *string +} + +func (s IncludedFieldsParameters) GetType__() bindings.BindingType { + return IncludedFieldsParametersBindingType() +} + +func (s IncludedFieldsParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IncludedFieldsParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Infra space related policy. +type Infra struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * Infra#Infra_CONNECTIVITY_STRATEGY_WHITELIST + // * Infra#Infra_CONNECTIVITY_STRATEGY_BLACKLIST + // * Infra#Infra_CONNECTIVITY_STRATEGY_WHITELIST_ENABLE_LOGGING + // * Infra#Infra_CONNECTIVITY_STRATEGY_BLACKLIST_ENABLE_LOGGING + // * Infra#Infra_CONNECTIVITY_STRATEGY_NONE + // + // The connectivity strategy is deprecated. Use default layer3 rule, /infra/domains/default/security-policies/default-layer3-security-policy/rules/default-layer3-rule. This field indicates the default connectivity policy for the infra or tenant space WHITELIST - Adds a default drop rule. Administrator can then use \"allow\" rules (aka whitelist) to allow traffic between groups BLACKLIST - Adds a default allow rule. Admin can then use \"drop\" rules (aka blacklist) to block traffic between groups WHITELIST_ENABLE_LOGGING - Whitelising with logging enabled BLACKLIST_ENABLE_LOGGING - Blacklisting with logging enabled NONE - No default rules are added. + ConnectivityStrategy *string + // This field is used while creating or updating the infra space. + Domains []Domain +} +const Infra_CONNECTIVITY_STRATEGY_WHITELIST = "WHITELIST" +const Infra_CONNECTIVITY_STRATEGY_BLACKLIST = "BLACKLIST" +const Infra_CONNECTIVITY_STRATEGY_WHITELIST_ENABLE_LOGGING = "WHITELIST_ENABLE_LOGGING" +const Infra_CONNECTIVITY_STRATEGY_BLACKLIST_ENABLE_LOGGING = "BLACKLIST_ENABLE_LOGGING" +const Infra_CONNECTIVITY_STRATEGY_NONE = "NONE" + +func (s Infra) GetType__() bindings.BindingType { + return InfraBindingType() +} + +func (s Infra) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Infra._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A shaper that specifies ingress rate properties in kb/s +type IngressBroadcastRateLimiter struct { + // Average bandwidth in kb/s format: int32 + AverageBandwidth *int64 + // Burst size in bytes format: int32 + BurstSize *int64 + // Peak bandwidth in kb/s format: int32 + PeakBandwidth *int64 + Enabled *bool + // Possible values are: + // + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_INGRESSRATELIMITER + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_INGRESSBROADCASTRATELIMITER + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_EGRESSRATELIMITER + // + // Type rate limiter + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IngressBroadcastRateLimiter__TYPE_IDENTIFIER = "IngressBroadcastRateLimiter" + +func (s IngressBroadcastRateLimiter) GetType__() bindings.BindingType { + return IngressBroadcastRateLimiterBindingType() +} + +func (s IngressBroadcastRateLimiter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IngressBroadcastRateLimiter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A shaper that specifies ingress rate properties in Mb/s +type IngressRateLimiter struct { + // You can use the average bandwidth to reduce network congestion. format: int32 + AverageBandwidth *int64 + // The burst duration is set in the burst size setting. format: int32 + BurstSize *int64 + // The peak bandwidth rate is used to support burst traffic. format: int32 + PeakBandwidth *int64 + Enabled *bool + // Possible values are: + // + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_INGRESSRATELIMITER + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_INGRESSBROADCASTRATELIMITER + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_EGRESSRATELIMITER + // + // Type rate limiter + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IngressRateLimiter__TYPE_IDENTIFIER = "IngressRateLimiter" + +func (s IngressRateLimiter) GetType__() bindings.BindingType { + return IngressRateLimiterBindingType() +} + +func (s IngressRateLimiter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IngressRateLimiter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type InitiateClusterRestoreRequest struct { + // IP address or FQDN of the node from which the backup was taken format: hostname-or-ip + IpAddress *string + // Unique id of the backed-up configuration from which the appliance will be restored + NodeId *string + // Timestamp of the backed-up configuration from which the appliance will be restored format: int64 + Timestamp *int64 +} + +func (s InitiateClusterRestoreRequest) GetType__() bindings.BindingType { + return InitiateClusterRestoreRequestBindingType() +} + +func (s InitiateClusterRestoreRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InitiateClusterRestoreRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Injection holding a key and a corresponding value. +type Injection struct { + // Injection key. + Key *string + // Injection value. + Value *data.StructValue +} + +func (s Injection) GetType__() bindings.BindingType { + return InjectionBindingType() +} + +func (s Injection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Injection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Injection Value. +type InjectionValue struct { + // Possible values are: + // + // * InjectionValue#InjectionValue_RESOURCE_TYPE_UNARYOPERATIONBASEDINJECTIONVALUE + // + // Injection Value resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const InjectionValue__TYPE_IDENTIFIER = "InjectionValue" +const InjectionValue_RESOURCE_TYPE_UNARYOPERATIONBASEDINJECTIONVALUE = "UnaryOperationBasedInjectionValue" + +func (s InjectionValue) GetType__() bindings.BindingType { + return InjectionValueBindingType() +} + +func (s InjectionValue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InjectionValue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Details of the instructions displayed during restore process +type InstructionInfo struct { + // A list of actions that are to be applied to resources + Actions []string + // A list of fields that are displayable to users in a table + Fields []string + // UUID of the instruction + Id *string + // Instruction name + Name *string +} + +func (s InstructionInfo) GetType__() bindings.BindingType { + return InstructionInfoBindingType() +} + +func (s InstructionInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InstructionInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Request parameters that represents a an intent path. +type IntentRuntimeRequestParameters struct { + // Policy Path referencing an intent object. + IntentPath *string + // Policy Path referencing a site. This is applicable only on a GlobalManager. If no site_path is specified, then based on the span of the intent the response will be fetched from the respective sites + SitePath *string +} + +func (s IntentRuntimeRequestParameters) GetType__() bindings.BindingType { + return IntentRuntimeRequestParametersBindingType() +} + +func (s IntentRuntimeRequestParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntentRuntimeRequestParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type InterfaceArpCsvRecord struct { + // The IP address format: ip + Ip *string + // The MAC address + MacAddress *string +} + +func (s InterfaceArpCsvRecord) GetType__() bindings.BindingType { + return InterfaceArpCsvRecordBindingType() +} + +func (s InterfaceArpCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceArpCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type InterfaceArpEntry struct { + // The IP address format: ip + Ip *string + // The MAC address + MacAddress *string +} + +func (s InterfaceArpEntry) GetType__() bindings.BindingType { + return InterfaceArpEntryBindingType() +} + +func (s InterfaceArpEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceArpEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type InterfaceArpTable struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Policy path of edge node. + EdgePath *string + // String Path of the enforcement point. + EnforcementPointPath *string + // The ID of the logical router port + InterfacePath *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []InterfaceArpEntry +} + +func (s InterfaceArpTable) GetType__() bindings.BindingType { + return InterfaceArpTableBindingType() +} + +func (s InterfaceArpTable) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceArpTable._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type InterfaceArpTableInCsvFormat struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []InterfaceArpCsvRecord +} + +func (s InterfaceArpTableInCsvFormat) GetType__() bindings.BindingType { + return InterfaceArpTableInCsvFormatBindingType() +} + +func (s InterfaceArpTableInCsvFormat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceArpTableInCsvFormat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Duplicate address detection status on the interface. +type InterfaceDADState struct { + // Array of DAD status which contains DAD information for IP addresses on the interface. + DadStatuses []InterfaceiPv6DADStatus + // Policy path or realization ID of interface for which IPv6 DAD status is returned. + InterfacePath *string +} + +func (s InterfaceDADState) GetType__() bindings.BindingType { + return InterfaceDADStateBindingType() +} + +func (s InterfaceDADState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceDADState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Duplicate address detection status for IP address on the interface. +type InterfaceiPv6DADStatus struct { + // Array of edge nodes on which DAD status is reported for given IP address. + EdgePaths []string + // IP address on the port for which DAD status is reported. format: ip + IpAddress *string + // Possible values are: + // + // * InterfaceiPv6DADStatus#InterfaceiPv6DADStatus_STATUS_DUPLICATED + // * InterfaceiPv6DADStatus#InterfaceiPv6DADStatus_STATUS_TENTATIVE + // * InterfaceiPv6DADStatus#InterfaceiPv6DADStatus_STATUS_ASSIGNED + // * InterfaceiPv6DADStatus#InterfaceiPv6DADStatus_STATUS_NOT_APPLICABLE + // * InterfaceiPv6DADStatus#InterfaceiPv6DADStatus_STATUS_UNKNOWN + // + // DAD status for IP address on the port. + Status *string +} +const InterfaceiPv6DADStatus_STATUS_DUPLICATED = "DUPLICATED" +const InterfaceiPv6DADStatus_STATUS_TENTATIVE = "TENTATIVE" +const InterfaceiPv6DADStatus_STATUS_ASSIGNED = "ASSIGNED" +const InterfaceiPv6DADStatus_STATUS_NOT_APPLICABLE = "NOT_APPLICABLE" +const InterfaceiPv6DADStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s InterfaceiPv6DADStatus) GetType__() bindings.BindingType { + return InterfaceiPv6DADStatusBindingType() +} + +func (s InterfaceiPv6DADStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceiPv6DADStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Subnet specification for interface connectivity +type InterfaceSubnet struct { + // IP addresses assigned to interface format: ip + IpAddresses []string + // Subnet prefix length format: int32 + PrefixLen *int64 +} + +func (s InterfaceSubnet) GetType__() bindings.BindingType { + return InterfaceSubnetBindingType() +} + +func (s InterfaceSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Intersite gateway configuration. +type IntersiteGatewayConfig struct { + // Fallback site to be used as new primary site on current primary site failure. Disaster recovery must be initiated via API/UI. Fallback site configuration is supported only for T0 gateway. T1 gateway will follow T0 gateway's primary site during disaster recovery. + FallbackSites []string + // IPv4 subnet for inter-site transit segment connecting service routers across sites for stretched gateway. For IPv6 link local subnet is auto configured. format: ip-cidr-block + IntersiteTransitSubnet *string + // Epoch(in seconds) is auto updated based on system current timestamp when primary locale service is updated. It is used for resolving conflict during site failover. If system clock not in sync then User can optionally override this. New value must be higher than the current value. format: int64 + LastAdminActiveEpoch *int64 + // Primary egress site for gateway. T0/T1 gateway in Active/Standby mode supports stateful services on primary site. In this mode primary site must be set if gateway is stretched to more than one site. For T0 gateway in Active/Active primary site is optional field. If set then secondary site prefers routes learned from primary over locally learned routes. This field is not applicable for T1 gateway with no services. + PrimarySitePath *string +} + +func (s IntersiteGatewayConfig) GetType__() bindings.BindingType { + return IntersiteGatewayConfigBindingType() +} + +func (s IntersiteGatewayConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntersiteGatewayConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Schedule to specify the interval time at which automated backups need to be taken +type IntervalBackupSchedule struct { + // Time interval in seconds between two consecutive automated backups format: int64 + SecondsBetweenBackups *int64 + // Possible values are: + // + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_WEEKLYBACKUPSCHEDULE + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_INTERVALBACKUPSCHEDULE + // + // Schedule type + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IntervalBackupSchedule__TYPE_IDENTIFIER = "IntervalBackupSchedule" + +func (s IntervalBackupSchedule) GetType__() bindings.BindingType { + return IntervalBackupScheduleBindingType() +} + +func (s IntervalBackupSchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntervalBackupSchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Allocation parameters for the IP address (e.g. specific IP address) can be specified. Tags, display_name and description attributes are not supported in this release. +type IpAddressAllocation struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Address that is allocated from pool format: ip + AllocationIp *string +} + +func (s IpAddressAllocation) GetType__() bindings.BindingType { + return IpAddressAllocationBindingType() +} + +func (s IpAddressAllocation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAddressAllocation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A block of IP addresses defined by a start address and a mask/prefix (network CIDR). An IP block is typically large & allocated to a tenant for automated consumption. An IP block is always a contiguous address space, for example 192.0.0.1/8. An IP block can be further subdivided into subnets called IP block subnets. These IP block subnets can be added to IP pools and used for IP allocation. +type IpAddressBlock struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Represents a network address and the prefix length which will be associated with a layer-2 broadcast domain. Support IPv4 and IPv6 CIDR. format: ip-cidr-block + Cidr *string +} + +func (s IpAddressBlock) GetType__() bindings.BindingType { + return IpAddressBlockBindingType() +} + +func (s IpAddressBlock) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAddressBlock._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Ipaddress information of the fabric node. +type IpAddressInfo struct { + // IP Addresses of the the virtual network interface, as discovered in the source. format: ip + IpAddresses []string + // Possible values are: + // + // * IpAddressInfo#IpAddressInfo_SOURCE_TOOLS + // + // Source of the ipaddress information. + Source *string +} +const IpAddressInfo_SOURCE_TOOLS = "VM_TOOLS" + +func (s IpAddressInfo) GetType__() bindings.BindingType { + return IpAddressInfoBindingType() +} + +func (s IpAddressInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAddressInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IpAddressPool is a collection of subnets. The subnets can either be derived from an IpBlock or specified by the user. User can request for IP addresses to be allocated from a pool. When an IP is requested from a pool, the IP that is returned can come from any subnet that belongs to the pool. +type IpAddressPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Delay in milliseconds, while releasing allocated IP address from IP pool (Default is 2 mins). format: int64 + IpReleaseDelay *int64 +} + +func (s IpAddressPool) GetType__() bindings.BindingType { + return IpAddressPoolBindingType() +} + +func (s IpAddressPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAddressPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This type of subnet allows user to dynamically carve a subnet out of a preconfigured IpAddressBlock. The user must specify the size of the subnet and the IpAddressBlock from which the subnet is to be derived. If the required amount of IP adress space is available in the specified IpAddressBlock, the system automatically configures subnet range. +type IpAddressPoolBlockSubnet struct { + // If this property is set to true, the first IP in the range will be reserved for gateway. + AutoAssignGateway *bool + // The path of the IpAddressBlock from which the subnet is to be created. + IpBlockPath *string + // The size parameter is required for subnet creation. It must be specified during creation but cannot be changed later. format: int64 + Size *int64 + // For internal system use Only. Represents start ip address of the subnet from IP block. Subnet ip adddress will start from this ip address. format: ip + StartIp *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IpAddressPoolSubnet#IpAddressPoolSubnet_RESOURCE_TYPE_IPADDRESSPOOLBLOCKSUBNET + // * IpAddressPoolSubnet#IpAddressPoolSubnet_RESOURCE_TYPE_IPADDRESSPOOLSTATICSUBNET + // + // Specifies whether the IpAddressPoolSubnet is to be carved out of a IpAddressBlock or will be specified by the user + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpAddressPoolBlockSubnet__TYPE_IDENTIFIER = "IpAddressPoolBlockSubnet" + +func (s IpAddressPoolBlockSubnet) GetType__() bindings.BindingType { + return IpAddressPoolBlockSubnetBindingType() +} + +func (s IpAddressPoolBlockSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAddressPoolBlockSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This type of subnet is statically configured by the user. The user provides the range details and the gateway for the subnet. +type IpAddressPoolStaticSubnet struct { + // A collection of IPv4 or IPv6 IP Pool Ranges. + AllocationRanges []IpPoolRange + // Subnet representation is a network address and prefix length + Cidr *string + // The collection of upto 3 DNS servers for the subnet. format: ip + DnsNameservers []string + // The DNS suffix for the DNS server. format: hostname + DnsSuffix *string + // The default gateway address on a layer-3 router. format: ip + GatewayIp *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IpAddressPoolSubnet#IpAddressPoolSubnet_RESOURCE_TYPE_IPADDRESSPOOLBLOCKSUBNET + // * IpAddressPoolSubnet#IpAddressPoolSubnet_RESOURCE_TYPE_IPADDRESSPOOLSTATICSUBNET + // + // Specifies whether the IpAddressPoolSubnet is to be carved out of a IpAddressBlock or will be specified by the user + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpAddressPoolStaticSubnet__TYPE_IDENTIFIER = "IpAddressPoolStaticSubnet" + +func (s IpAddressPoolStaticSubnet) GetType__() bindings.BindingType { + return IpAddressPoolStaticSubnetBindingType() +} + +func (s IpAddressPoolStaticSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAddressPoolStaticSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IpAddressPoolSubnet can either be carved out of a PolicyBlock or statically specified by the user. In the first case where the subnet is carved out of a IpAddressBlock, the user must specify the ID of the block from which this subnet is to be derived. This block must be pre-created. The subnet range is auto populated by the system. In the second case, the user configures the subnet range directly. No IpAddressBlock is required. +type IpAddressPoolSubnet struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IpAddressPoolSubnet#IpAddressPoolSubnet_RESOURCE_TYPE_IPADDRESSPOOLBLOCKSUBNET + // * IpAddressPoolSubnet#IpAddressPoolSubnet_RESOURCE_TYPE_IPADDRESSPOOLSTATICSUBNET + // + // Specifies whether the IpAddressPoolSubnet is to be carved out of a IpAddressBlock or will be specified by the user + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpAddressPoolSubnet__TYPE_IDENTIFIER = "IpAddressPoolSubnet" +const IpAddressPoolSubnet_RESOURCE_TYPE_IPADDRESSPOOLBLOCKSUBNET = "IpAddressPoolBlockSubnet" +const IpAddressPoolSubnet_RESOURCE_TYPE_IPADDRESSPOOLSTATICSUBNET = "IpAddressPoolStaticSubnet" + +func (s IpAddressPoolSubnet) GetType__() bindings.BindingType { + return IpAddressPoolSubnetBindingType() +} + +func (s IpAddressPoolSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAddressPoolSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A set of IPv4 or IPv6 addresses defined by a start and end address. +type IpPoolRange struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The end IP Address of the IP Range. format: ip + End *string + // The start IP Address of the IP Range. format: ip + Start *string +} + +func (s IpPoolRange) GetType__() bindings.BindingType { + return IpPoolRangeBindingType() +} + +func (s IpPoolRange) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpPoolRange._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type Ipv4Header struct { + // The destination ip address. format: ipv4 + DstIp *string + // IP flags format: int64 + Flags *int64 + // IP protocol - defaults to ICMP format: int64 + Protocol *int64 + // The source ip address. format: ipv4 + SrcIp *string + // This is used together with src_ip to calculate dst_ip for broadcast when dst_ip is not given; not used in all other cases. format: int64 + SrcSubnetPrefixLen *int64 + // Time to live (ttl) format: int64 + Ttl *int64 +} + +func (s Ipv4Header) GetType__() bindings.BindingType { + return Ipv4HeaderBindingType() +} + +func (s Ipv4Header) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Ipv4Header._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Duplicate address detection profile. +type Ipv6DadProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * Ipv6DadProfile#Ipv6DadProfile_DAD_MODE_LOOSE + // * Ipv6DadProfile#Ipv6DadProfile_DAD_MODE_STRICT + // + // DAD Mode + DadMode *string + // Number of Neighbor solicitation packets generated before completing the Duplicate address detection process. format: int64 + NsRetries *int64 + // The time duration in seconds, to wait for Neighbor advertisement after sending the Neighbor solicitation message. format: int64 + WaitTime *int64 +} +const Ipv6DadProfile_DAD_MODE_LOOSE = "LOOSE" +const Ipv6DadProfile_DAD_MODE_STRICT = "STRICT" + +func (s Ipv6DadProfile) GetType__() bindings.BindingType { + return Ipv6DadProfileBindingType() +} + +func (s Ipv6DadProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Ipv6DadProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type Ipv6DadProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of Ipv6DadProfile + Results []Ipv6DadProfile +} + +func (s Ipv6DadProfileListResult) GetType__() bindings.BindingType { + return Ipv6DadProfileListResultBindingType() +} + +func (s Ipv6DadProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Ipv6DadProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type Ipv6Header struct { + // The destination ip address. format: ipv6 + DstIp *string + // Decremented by 1 by each node that forwards the packets. The packet is discarded if Hop Limit is decremented to zero. format: int64 + HopLimit *int64 + // Identifies the type of header immediately following the IPv6 header. format: int64 + NextHeader *int64 + // The source ip address. format: ipv6 + SrcIp *string +} + +func (s Ipv6Header) GetType__() bindings.BindingType { + return Ipv6HeaderBindingType() +} + +func (s Ipv6Header) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Ipv6Header._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type Ipv6NdraProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // DNS Configurations + DnsConfig *RaDNSConfig + // RA Configuration + RaConfig *RAConfig + // Possible values are: + // + // * Ipv6NdraProfile#Ipv6NdraProfile_RA_MODE_DISABLED + // * Ipv6NdraProfile#Ipv6NdraProfile_RA_MODE_SLAAC_DNS_THROUGH_RA + // * Ipv6NdraProfile#Ipv6NdraProfile_RA_MODE_SLAAC_DNS_THROUGH_DHCP + // * Ipv6NdraProfile#Ipv6NdraProfile_RA_MODE_DHCP_ADDRESS_AND_DNS_THROUGH_DHCP + // * Ipv6NdraProfile#Ipv6NdraProfile_RA_MODE_SLAAC_AND_ADDRESS_DNS_THROUGH_DHCP + // + // RA Mode + RaMode *string + // Neighbour reachable time duration in milliseconds. A value of 0 means unspecified. format: int64 + ReachableTimer *int64 + // The time, in milliseconds, between retransmitted neighbour solicitation messages. A value of 0 means unspecified. format: int64 + RetransmitInterval *int64 +} +const Ipv6NdraProfile_RA_MODE_DISABLED = "DISABLED" +const Ipv6NdraProfile_RA_MODE_SLAAC_DNS_THROUGH_RA = "SLAAC_DNS_THROUGH_RA" +const Ipv6NdraProfile_RA_MODE_SLAAC_DNS_THROUGH_DHCP = "SLAAC_DNS_THROUGH_DHCP" +const Ipv6NdraProfile_RA_MODE_DHCP_ADDRESS_AND_DNS_THROUGH_DHCP = "DHCP_ADDRESS_AND_DNS_THROUGH_DHCP" +const Ipv6NdraProfile_RA_MODE_SLAAC_AND_ADDRESS_DNS_THROUGH_DHCP = "SLAAC_AND_ADDRESS_DNS_THROUGH_DHCP" + +func (s Ipv6NdraProfile) GetType__() bindings.BindingType { + return Ipv6NdraProfileBindingType() +} + +func (s Ipv6NdraProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Ipv6NdraProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type Ipv6NdraProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of Ipv6NdraProfile + Results []Ipv6NdraProfile +} + +func (s Ipv6NdraProfileListResult) GetType__() bindings.BindingType { + return Ipv6NdraProfileListResultBindingType() +} + +func (s Ipv6NdraProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Ipv6NdraProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// An arbitrary key-value pair +type KeyValuePair struct { + // Key + Key *string + // Value + Value *string +} + +func (s KeyValuePair) GetType__() bindings.BindingType { + return KeyValuePairBindingType() +} + +func (s KeyValuePair) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for KeyValuePair._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Used to configure L2 Bridge endpoint profile +type L2BridgeEndpointProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // List of policy paths to edge nodes. Edge allocation for L2 bridging. + EdgePaths []string + // Possible values are: + // + // * L2BridgeEndpointProfile#L2BridgeEndpointProfile_FAILOVER_MODE_PREEMPTIVE + // * L2BridgeEndpointProfile#L2BridgeEndpointProfile_FAILOVER_MODE_NON_PREEMPTIVE + // + // Failover mode for the edge bridge cluster + FailoverMode *string + // Possible values are: + // + // * L2BridgeEndpointProfile#L2BridgeEndpointProfile_HA_MODE_STANDBY + // + // High avaialability mode can be active-active or active-standby. High availability mode cannot be modified after realization. + HaMode *string +} +const L2BridgeEndpointProfile_FAILOVER_MODE_PREEMPTIVE = "PREEMPTIVE" +const L2BridgeEndpointProfile_FAILOVER_MODE_NON_PREEMPTIVE = "NON_PREEMPTIVE" +const L2BridgeEndpointProfile_HA_MODE_STANDBY = "ACTIVE_STANDBY" + +func (s L2BridgeEndpointProfile) GetType__() bindings.BindingType { + return L2BridgeEndpointProfileBindingType() +} + +func (s L2BridgeEndpointProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2BridgeEndpointProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Segment specific L2 VPN configuration +type L2Extension struct { + // This property has been deprecated. Please use the property l2vpn_paths for setting the paths of associated L2 VPN session. This property will continue to work as expected to provide backwards compatibility. However, when both l2vpn_path and l2vpn_paths properties are specified, only l2vpn_paths is used. + L2vpnPath *string + // Policy paths corresponding to the associated L2 VPN sessions + L2vpnPaths []string + // Local Egress. + LocalEgress *LocalEgress + // Tunnel ID format: int32 + TunnelId *int64 +} + +func (s L2Extension) GetType__() bindings.BindingType { + return L2ExtensionBindingType() +} + +func (s L2Extension) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2Extension._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// L2VPN Service defines if service running as server or client. It also defines all the common properties for the multiple L2VPN Sessions associated with this service. +type L2VPNService struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // This property applies only in SERVER mode. If set to true, traffic from any client will be replicated to all other clients. If set to false, traffic received from clients is only replicated to the local VPN endpoint. + EnableHub *bool + // IP Pool to allocate local and peer endpoint IPs for L2VpnSession logical tap. format: ipv4-cidr-block + EncapIpPool []string + // Possible values are: + // + // * L2VPNService#L2VPNService_MODE_SERVER + // * L2VPNService#L2VPNService_MODE_CLIENT + // + // Specify an L2VPN service mode as SERVER or CLIENT. + Mode *string +} +const L2VPNService_MODE_SERVER = "SERVER" +const L2VPNService_MODE_CLIENT = "CLIENT" + +func (s L2VPNService) GetType__() bindings.BindingType { + return L2VPNServiceBindingType() +} + +func (s L2VPNService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Defines the tunnel local and peer addresses along with multiple tansport tunnels for redundancy. L2VPNSession belongs to only one L2VPNService. +type L2VPNSession struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Enable to extend all the associated segments. + Enabled *bool + // List of transport tunnels for redundancy. + TransportTunnels []string + // Tunnel encapsulation config. This property only applies in CLIENT mode. It is auto-populated from the L2VPNSessionData. + TunnelEncapsulation *L2VPNTunnelEncapsulation +} + +func (s L2VPNSession) GetType__() bindings.BindingType { + return L2VPNSessionBindingType() +} + +func (s L2VPNSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// L2VPN tunnel encapsulation config. +type L2VPNTunnelEncapsulation struct { + // IP Address of the local tunnel port. This property only applies in CLIENT mode. format: ipv4 + LocalEndpointAddress *string + // IP Address of the peer tunnel port. This property only applies in CLIENT mode. format: ipv4 + PeerEndpointAddress *string + // Possible values are: + // + // * L2VPNTunnelEncapsulation#L2VPNTunnelEncapsulation_PROTOCOL_GRE + // + // Encapsulation protocol used by the tunnel. + Protocol *string +} +const L2VPNTunnelEncapsulation_PROTOCOL_GRE = "GRE" + +func (s L2VPNTunnelEncapsulation) GetType__() bindings.BindingType { + return L2VPNTunnelEncapsulationBindingType() +} + +func (s L2VPNTunnelEncapsulation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNTunnelEncapsulation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains information necessary to configure L2Vpn. +type L2Vpn struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Enable to extend all the associated segments. + Enabled *bool + // List of paths referencing transport tunnels. + TransportTunnels []string +} + +func (s L2Vpn) GetType__() bindings.BindingType { + return L2VpnBindingType() +} + +func (s L2Vpn) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2Vpn._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// L2Vpn Context provides meta-data information about the parent Tier-0. +type L2VpnContext struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If enabled, the tier-0 acts as a Hub and replicates traffic received from peer to all other peers. If disabled, the tier-0 acts as a Spoke and replicates only the local. + EnableHub *bool +} + +func (s L2VpnContext) GetType__() bindings.BindingType { + return L2VpnContextBindingType() +} + +func (s L2VpnContext) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnContext._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains information necessary to configure IPSec VPN. +type L3Vpn struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * L3Vpn#L3Vpn_DH_GROUPS_GROUP2 + // * L3Vpn#L3Vpn_DH_GROUPS_GROUP5 + // * L3Vpn#L3Vpn_DH_GROUPS_GROUP14 + // * L3Vpn#L3Vpn_DH_GROUPS_GROUP15 + // * L3Vpn#L3Vpn_DH_GROUPS_GROUP16 + // + // Diffie-Hellman group to be used if PFS is enabled. Default group is GROUP14. + DhGroups []string + // If true, perfect forward secrecy (PFS) is enabled. + EnablePerfectForwardSecrecy *bool + // Flag to enable L3Vpn. Default is enabled. + Enabled *bool + // Possible values are: + // + // * L3Vpn#L3Vpn_IKE_DIGEST_ALGORITHMS_SHA1 + // * L3Vpn#L3Vpn_IKE_DIGEST_ALGORITHMS_SHA2_256 + // + // Algorithm to be used for message digest during Internet Key Exchange(IKE) negotiation. Default is SHA2_256. + IkeDigestAlgorithms []string + // Possible values are: + // + // * L3Vpn#L3Vpn_IKE_ENCRYPTION_ALGORITHMS_128 + // * L3Vpn#L3Vpn_IKE_ENCRYPTION_ALGORITHMS_256 + // * L3Vpn#L3Vpn_IKE_ENCRYPTION_ALGORITHMS_GCM_128 + // * L3Vpn#L3Vpn_IKE_ENCRYPTION_ALGORITHMS_GCM_192 + // * L3Vpn#L3Vpn_IKE_ENCRYPTION_ALGORITHMS_GCM_256 + // + // Algorithm to be used during Internet Key Exchange(IKE) negotiation. Default is AES_128. + IkeEncryptionAlgorithms []string + // Possible values are: + // + // * L3Vpn#L3Vpn_IKE_VERSION_V1 + // * L3Vpn#L3Vpn_IKE_VERSION_V2 + // * L3Vpn#L3Vpn_IKE_VERSION_FLEX + // + // IKE protocol version to be used. IKE-Flex will initiate IKE-V2 and responds to both IKE-V1 and IKE-V2. + IkeVersion *string + // L3Vpn Session + L3vpnSession *data.StructValue + // IPv4 address of local gateway format: ipv4 + LocalAddress *string + // List of IPSec pre-shared keys used for IPSec authentication. If not specified, the older passphrase values are retained if there are any. + Passphrases []string + // This field is used to resolve conflicts in case of a remote site being behind NAT as remote public ip address is not enough. If it is not the case the remote public address should be provided here. If not provided, the value of this field is set to remote_public_address. + RemotePrivateAddress *string + // Public IPv4 address of remote gateway format: ipv4 + RemotePublicAddress *string + // Possible values are: + // + // * L3Vpn#L3Vpn_TUNNEL_DIGEST_ALGORITHMS_SHA1 + // * L3Vpn#L3Vpn_TUNNEL_DIGEST_ALGORITHMS_SHA2_256 + // + // Algorithm to be used for message digest during tunnel establishment. Default algorithm is empty. + TunnelDigestAlgorithms []string + // Possible values are: + // + // * L3Vpn#L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_128 + // * L3Vpn#L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_256 + // * L3Vpn#L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_GCM_128 + // * L3Vpn#L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_GCM_192 + // * L3Vpn#L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_GCM_256 + // + // Encryption algorithm to encrypt/decrypt the messages exchanged between IPSec VPN initiator and responder during tunnel negotiation. Default is AES_GCM_128. + TunnelEncryptionAlgorithms []string +} +const L3Vpn_DH_GROUPS_GROUP2 = "GROUP2" +const L3Vpn_DH_GROUPS_GROUP5 = "GROUP5" +const L3Vpn_DH_GROUPS_GROUP14 = "GROUP14" +const L3Vpn_DH_GROUPS_GROUP15 = "GROUP15" +const L3Vpn_DH_GROUPS_GROUP16 = "GROUP16" +const L3Vpn_IKE_DIGEST_ALGORITHMS_SHA1 = "SHA1" +const L3Vpn_IKE_DIGEST_ALGORITHMS_SHA2_256 = "SHA2_256" +const L3Vpn_IKE_ENCRYPTION_ALGORITHMS_128 = "AES_128" +const L3Vpn_IKE_ENCRYPTION_ALGORITHMS_256 = "AES_256" +const L3Vpn_IKE_ENCRYPTION_ALGORITHMS_GCM_128 = "AES_GCM_128" +const L3Vpn_IKE_ENCRYPTION_ALGORITHMS_GCM_192 = "AES_GCM_192" +const L3Vpn_IKE_ENCRYPTION_ALGORITHMS_GCM_256 = "AES_GCM_256" +const L3Vpn_IKE_VERSION_V1 = "IKE_V1" +const L3Vpn_IKE_VERSION_V2 = "IKE_V2" +const L3Vpn_IKE_VERSION_FLEX = "IKE_FLEX" +const L3Vpn_TUNNEL_DIGEST_ALGORITHMS_SHA1 = "SHA1" +const L3Vpn_TUNNEL_DIGEST_ALGORITHMS_SHA2_256 = "SHA2_256" +const L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_128 = "AES_128" +const L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_256 = "AES_256" +const L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_GCM_128 = "AES_GCM_128" +const L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_GCM_192 = "AES_GCM_192" +const L3Vpn_TUNNEL_ENCRYPTION_ALGORITHMS_GCM_256 = "AES_GCM_256" + +func (s L3Vpn) GetType__() bindings.BindingType { + return L3VpnBindingType() +} + +func (s L3Vpn) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L3Vpn._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// L3Vpn Context provides the configuration context that different L3Vpns can consume. +type L3VpnContext struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Local gateway IPv4 addresses available for configuration of each L3Vpn. + AvailableLocalAddresses []PolicyIPAddressInfo + // Bypass L3Vpn rules that will be shared across L3Vpns. Only Bypass action is supported on these L3Vpn rules. + BypassRules []L3VpnRule + // If true, enable L3Vpn Service for given tier-0. Enabling/disabling this service affects all L3Vpns under the given tier-0. + Enabled *bool + // Possible values are: + // + // * L3VpnContext#L3VpnContext_IKE_LOG_LEVEL_DEBUG + // * L3VpnContext#L3VpnContext_IKE_LOG_LEVEL_INFO + // * L3VpnContext#L3VpnContext_IKE_LOG_LEVEL_WARN + // * L3VpnContext#L3VpnContext_IKE_LOG_LEVEL_ERROR + // * L3VpnContext#L3VpnContext_IKE_LOG_LEVEL_EMERGENCY + // + // Log level for internet key exchange (IKE). + IkeLogLevel *string + // Policy path referencing Label. A label is used as a mechanism to group route-based L3Vpns in order to apply edge firewall rules on members' VTIs. + Label *string +} +const L3VpnContext_IKE_LOG_LEVEL_DEBUG = "DEBUG" +const L3VpnContext_IKE_LOG_LEVEL_INFO = "INFO" +const L3VpnContext_IKE_LOG_LEVEL_WARN = "WARN" +const L3VpnContext_IKE_LOG_LEVEL_ERROR = "ERROR" +const L3VpnContext_IKE_LOG_LEVEL_EMERGENCY = "EMERGENCY" + +func (s L3VpnContext) GetType__() bindings.BindingType { + return L3VpnContextBindingType() +} + +func (s L3VpnContext) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L3VpnContext._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// For policy-based L3Vpn sessions, a rule specifies as its action the vpn tunnel to be used for transit traffic that meets the rule's match criteria. +type L3VpnRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * L3VpnRule#L3VpnRule_ACTION_PROTECT + // * L3VpnRule#L3VpnRule_ACTION_BYPASS + // + // Action to exchange data with or without protection. PROTECT - Allows to exchange data with ipsec protection. Protect rules are defined per L3Vpn. BYPASS - Allows to exchange data without ipsec protection. Bypass rules are defined per L3VpnContext and affects all policy based L3Vpns. Bypass rules are prioritized over protect rules. + Action *string + // List of remote subnets used in policy-based L3Vpn. + Destinations []L3VpnSubnet + // This field is used to resolve conflicts between multiple L3VpnRules associated with a single L3Vpn or L3VpnContext. format: int32 + SequenceNumber *int64 + // List of local subnets used in policy-based L3Vpn. + Sources []L3VpnSubnet +} +const L3VpnRule_ACTION_PROTECT = "PROTECT" +const L3VpnRule_ACTION_BYPASS = "BYPASS" + +func (s L3VpnRule) GetType__() bindings.BindingType { + return L3VpnRuleBindingType() +} + +func (s L3VpnRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L3VpnRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains information about L3Vpn session. +type L3VpnSession struct { + // Possible values are: + // + // * L3VpnSession#L3VpnSession_RESOURCE_TYPE_POLICYBASEDL3VPNSESSION + // * L3VpnSession#L3VpnSession_RESOURCE_TYPE_ROUTEBASEDL3VPNSESSION + // + // - A Policy Based L3Vpn is a configuration in which protect rules to match local and remote subnet needs to be defined. Tunnel is established for each pair of local and remote subnet defined in protect rules. - A Route Based L3Vpn is more flexible, more powerful and recommended over policy based. IP Tunnel subnet is created and all traffic routed through tunnel subnet (commonly known as VTI) is sent over tunnel. Routes can be learned through BGP. A route based L3Vpn is required when using redundant L3Vpn. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const L3VpnSession__TYPE_IDENTIFIER = "L3VpnSession" +const L3VpnSession_RESOURCE_TYPE_POLICYBASEDL3VPNSESSION = "PolicyBasedL3VpnSession" +const L3VpnSession_RESOURCE_TYPE_ROUTEBASEDL3VPNSESSION = "RouteBasedL3VpnSession" + +func (s L3VpnSession) GetType__() bindings.BindingType { + return L3VpnSessionBindingType() +} + +func (s L3VpnSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L3VpnSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Used to specify subnets in L3Vpn rule. +type L3VpnSubnet struct { + // Subnet used in L3Vpn Rule. format: ipv4-cidr-block + Subnet *string +} + +func (s L3VpnSubnet) GetType__() bindings.BindingType { + return L3VpnSubnetBindingType() +} + +func (s L3VpnSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L3VpnSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence is enabled on a PolicyLbVirtualServer by binding a persistence profile to it. +type L4PolicyLbPersistenceProfile struct { + // Possible values are: + // + // * L4PolicyLbPersistenceProfile#L4PolicyLbPersistenceProfile_PERSISTENCE_IP + // + // This field indicates the persistence method used for the PolicyLbVirtualServer. - SOURCE_IP persistence ensures all connections from a client (identified by IP address) are sent to the same backend server for a specified period. - This object is not required and persistence is disabled by default + Persistence *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_L4POLICYLBPERSISTENCEPROFILE + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_L7POLICYLBPERSISTENCEPROFILE + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_CUSTOMPOLICYLBPERSISTENCEPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const L4PolicyLbPersistenceProfile__TYPE_IDENTIFIER = "L4PolicyLbPersistenceProfile" +const L4PolicyLbPersistenceProfile_PERSISTENCE_IP = "SOURCE_IP" + +func (s L4PolicyLbPersistenceProfile) GetType__() bindings.BindingType { + return L4PolicyLbPersistenceProfileBindingType() +} + +func (s L4PolicyLbPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L4PolicyLbPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// L4PortSet can be specified in comma separated notation of parts. Parts of a L4PortSet includes single integer or range of port in hyphen notation. Example of a PortSet: \"22, 33-70, 44\". +type L4PortSetServiceEntry struct { + DestinationPorts []string + // Possible values are: + // + // * L4PortSetServiceEntry#L4PortSetServiceEntry_L4PROTOCOL_TCP + // * L4PortSetServiceEntry#L4PortSetServiceEntry_L4PROTOCOL_UDP + L4Protocol *string + SourcePorts []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const L4PortSetServiceEntry__TYPE_IDENTIFIER = "L4PortSetServiceEntry" +const L4PortSetServiceEntry_L4PROTOCOL_TCP = "TCP" +const L4PortSetServiceEntry_L4PROTOCOL_UDP = "UDP" + +func (s L4PortSetServiceEntry) GetType__() bindings.BindingType { + return L4PortSetServiceEntryBindingType() +} + +func (s L4PortSetServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L4PortSetServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence is enabled on a PolicyLbVirtualServer by binding a persistence profile to it. +type L7PolicyLbPersistenceProfile struct { + // Possible values are: + // + // * L7PolicyLbPersistenceProfile#L7PolicyLbPersistenceProfile_PERSISTENCE_COOKIE + // + // This field indicates the persistence method used for the PolicyLbVirtualServer. - COOKIE persistence allows related client connections, identified by the same cookie in HTTP requests [Refer to HTTP Cookie for details on HTTP cookies], to be redirected to the same server. Load balancer does not maintain any persistence table for cookie persistence. Instead, it encodes the necessary information in the HTTP cookie value sent to client and relies on the client to store it and send it back in subsequent related HTTP requests. Hence there is no limit on the number of cookie persistence entries that can be supported. - This object is not required and persistence is disabled by default + Persistence *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_L4POLICYLBPERSISTENCEPROFILE + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_L7POLICYLBPERSISTENCEPROFILE + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_CUSTOMPOLICYLBPERSISTENCEPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const L7PolicyLbPersistenceProfile__TYPE_IDENTIFIER = "L7PolicyLbPersistenceProfile" +const L7PolicyLbPersistenceProfile_PERSISTENCE_COOKIE = "COOKIE" + +func (s L7PolicyLbPersistenceProfile) GetType__() bindings.BindingType { + return L7PolicyLbPersistenceProfileBindingType() +} + +func (s L7PolicyLbPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L7PolicyLbPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// LBAccessListControl is used to define how IP access list control can filter the connections from clients. +type LBAccessListControl struct { + // Possible values are: + // + // * LBAccessListControl#LBAccessListControl_ACTION_ALLOW + // * LBAccessListControl#LBAccessListControl_ACTION_DROP + // + // ALLOW means connections matching grouping object IP list are allowed and requests not matching grouping object IP list are dropped. DROP means connections matching grouping object IP list are dropped and requests not matching grouping object IP list are allowed. + Action *string + // The enabled flag indicates whether to enable access list control option. It is false by default. + Enabled *bool + // The path of grouping object which defines the IP addresses or ranges to match the client IP. + GroupPath *string +} +const LBAccessListControl_ACTION_ALLOW = "ALLOW" +const LBAccessListControl_ACTION_DROP = "DROP" + +func (s LBAccessListControl) GetType__() bindings.BindingType { + return LBAccessListControlBindingType() +} + +func (s LBAccessListControl) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBAccessListControl._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// All the active types of LBMonitorProfile extend from this abstract class. This is present for extensibility. +type LBActiveMonitor struct { + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. For ICMP monitor, monitor_port is not required. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE + // + // There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBActiveMonitor__TYPE_IDENTIFIER = "LBActiveMonitor" + +func (s LBActiveMonitor) GetType__() bindings.BindingType { + return LBActiveMonitorBindingType() +} + +func (s LBActiveMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBActiveMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// App profile. +type LBAppProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBHTTPPROFILE + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE + // + // An application profile can be bound to a virtual server to specify the application protocol characteristics. It is used to influence how load balancing is performed. Currently, three types of application profiles are supported: LBFastTCPProfile, LBFastUDPProfile and LBHttpProfile. LBFastTCPProfile or LBFastUDPProfile is typically used when the application is using a custom protocol or a standard protocol not supported by the load balancer. It is also used in cases where the user only wants L4 load balancing mainly because L4 load balancing has much higher performance and scalability, and/or supports connection mirroring. LBHttpProfile is used for both HTTP and HTTPS applications. Though application rules, if bound to the virtual server, can be used to accomplish the same goal, LBHttpProfile is intended to simplify enabling certain common use cases. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBAppProfile__TYPE_IDENTIFIER = "LBAppProfile" +const LBAppProfile_RESOURCE_TYPE_LBHTTPPROFILE = "LBHttpProfile" +const LBAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE = "LBFastTcpProfile" +const LBAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE = "LBFastUdpProfile" + +func (s LBAppProfile) GetType__() bindings.BindingType { + return LBAppProfileBindingType() +} + +func (s LBAppProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBAppProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Match condition for client certficate issuer DN. +type LBClientCertificateIssuerDnCondition struct { + // If true, case is significant when comparing issuer DN value. + CaseSensitive *bool + // Value of issuer DN. + IssuerDn *string + // Possible values are: + // + // * LBClientCertificateIssuerDnCondition#LBClientCertificateIssuerDnCondition_MATCH_TYPE_STARTS_WITH + // * LBClientCertificateIssuerDnCondition#LBClientCertificateIssuerDnCondition_MATCH_TYPE_ENDS_WITH + // * LBClientCertificateIssuerDnCondition#LBClientCertificateIssuerDnCondition_MATCH_TYPE_EQUALS + // * LBClientCertificateIssuerDnCondition#LBClientCertificateIssuerDnCondition_MATCH_TYPE_CONTAINS + // * LBClientCertificateIssuerDnCondition#LBClientCertificateIssuerDnCondition_MATCH_TYPE_REGEX + // + // Match type of issuer DN. + MatchType *string +} +const LBClientCertificateIssuerDnCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBClientCertificateIssuerDnCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBClientCertificateIssuerDnCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBClientCertificateIssuerDnCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBClientCertificateIssuerDnCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBClientCertificateIssuerDnCondition) GetType__() bindings.BindingType { + return LBClientCertificateIssuerDnConditionBindingType() +} + +func (s LBClientCertificateIssuerDnCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBClientCertificateIssuerDnCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Match condition for client certficate subject DN. +type LBClientCertificateSubjectDnCondition struct { + // If true, case is significant when comparing subject DN value. + CaseSensitive *bool + // Possible values are: + // + // * LBClientCertificateSubjectDnCondition#LBClientCertificateSubjectDnCondition_MATCH_TYPE_STARTS_WITH + // * LBClientCertificateSubjectDnCondition#LBClientCertificateSubjectDnCondition_MATCH_TYPE_ENDS_WITH + // * LBClientCertificateSubjectDnCondition#LBClientCertificateSubjectDnCondition_MATCH_TYPE_EQUALS + // * LBClientCertificateSubjectDnCondition#LBClientCertificateSubjectDnCondition_MATCH_TYPE_CONTAINS + // * LBClientCertificateSubjectDnCondition#LBClientCertificateSubjectDnCondition_MATCH_TYPE_REGEX + // + // Match type of subject DN. + MatchType *string + // Value of subject DN. + SubjectDn *string +} +const LBClientCertificateSubjectDnCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBClientCertificateSubjectDnCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBClientCertificateSubjectDnCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBClientCertificateSubjectDnCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBClientCertificateSubjectDnCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBClientCertificateSubjectDnCondition) GetType__() bindings.BindingType { + return LBClientCertificateSubjectDnConditionBindingType() +} + +func (s LBClientCertificateSubjectDnCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBClientCertificateSubjectDnCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Client SSL profile. +type LBClientSslProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * LBClientSslProfile#LBClientSslProfile_CIPHER_GROUP_LABEL_BALANCED + // * LBClientSslProfile#LBClientSslProfile_CIPHER_GROUP_LABEL_HIGH_SECURITY + // * LBClientSslProfile#LBClientSslProfile_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY + // * LBClientSslProfile#LBClientSslProfile_CIPHER_GROUP_LABEL_CUSTOM + // + // It is a label of cipher group which is mostly consumed by GUI. + CipherGroupLabel *string + // Possible values are: + // + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LBClientSslProfile#LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // Supported SSL cipher list to client side. + Ciphers []string + // This flag is set to true when all the ciphers and protocols are FIPS compliant. It is set to false when one of the ciphers or protocols are not FIPS compliant.. + IsFips *bool + // This flag is set to true when all the ciphers and protocols are secure. It is set to false when one of the ciphers or protocols is insecure. + IsSecure *bool + // During SSL handshake as part of the SSL client Hello client sends an ordered list of ciphers that it can support (or prefers) and typically server selects the first one from the top of that list it can also support. For Perfect Forward Secrecy(PFS), server could override the client's preference. + PreferServerCiphers *bool + // Possible values are: + // + // * LBClientSslProfile#LBClientSslProfile_PROTOCOLS_SSL_V2 + // * LBClientSslProfile#LBClientSslProfile_PROTOCOLS_SSL_V3 + // * LBClientSslProfile#LBClientSslProfile_PROTOCOLS_TLS_V1 + // * LBClientSslProfile#LBClientSslProfile_PROTOCOLS_TLS_V1_1 + // * LBClientSslProfile#LBClientSslProfile_PROTOCOLS_TLS_V1_2 + // + // SSL versions TLS1.1 and TLS1.2 are supported and enabled by default. SSLv2, SSLv3, and TLS1.0 are supported, but disabled by default. + Protocols []string + // SSL session caching allows SSL client and server to reuse previously negotiated security parameters avoiding the expensive public key operation during handshake. + SessionCacheEnabled *bool + // Session cache timeout specifies how long the SSL session parameters are held on to and can be reused. format: int64 + SessionCacheTimeout *int64 +} +const LBClientSslProfile_CIPHER_GROUP_LABEL_BALANCED = "BALANCED" +const LBClientSslProfile_CIPHER_GROUP_LABEL_HIGH_SECURITY = "HIGH_SECURITY" +const LBClientSslProfile_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY = "HIGH_COMPATIBILITY" +const LBClientSslProfile_CIPHER_GROUP_LABEL_CUSTOM = "CUSTOM" +const LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LBClientSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LBClientSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LBClientSslProfile_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LBClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LBClientSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LBClientSslProfile_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LBClientSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LBClientSslProfile_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LBClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LBClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LBClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" +const LBClientSslProfile_PROTOCOLS_SSL_V2 = "SSL_V2" +const LBClientSslProfile_PROTOCOLS_SSL_V3 = "SSL_V3" +const LBClientSslProfile_PROTOCOLS_TLS_V1 = "TLS_V1" +const LBClientSslProfile_PROTOCOLS_TLS_V1_1 = "TLS_V1_1" +const LBClientSslProfile_PROTOCOLS_TLS_V1_2 = "TLS_V1_2" + +func (s LBClientSslProfile) GetType__() bindings.BindingType { + return LBClientSslProfileBindingType() +} + +func (s LBClientSslProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBClientSslProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Client SSL profile binding. +type LBClientSslProfileBinding struct { + // Authentication depth is used to set the verification depth in the client certificates chain. format: int64 + CertificateChainDepth *int64 + // Possible values are: + // + // * LBClientSslProfileBinding#LBClientSslProfileBinding_CLIENT_AUTH_REQUIRED + // * LBClientSslProfileBinding#LBClientSslProfileBinding_CLIENT_AUTH_IGNORE + // + // Client authentication mode. + ClientAuth *string + // If client auth type is REQUIRED, client certificate must be signed by one of the trusted Certificate Authorities (CAs), also referred to as root CAs, whose self signed certificates are specified. + ClientAuthCaPaths []string + // A Certificate Revocation List (CRL) can be specified in the client-side SSL profile binding to disallow compromised client certificates. + ClientAuthCrlPaths []string + // A default certificate should be specified which will be used if the server does not host multiple hostnames on the same IP address or if the client does not support SNI extension. + DefaultCertificatePath *string + // Client-side SSL profile binding allows multiple certificates, for different hostnames, to be bound to the same virtual server. + SniCertificatePaths []string + // Client SSL profile defines reusable, application-independent client side SSL properties. + SslProfilePath *string +} +const LBClientSslProfileBinding_CLIENT_AUTH_REQUIRED = "REQUIRED" +const LBClientSslProfileBinding_CLIENT_AUTH_IGNORE = "IGNORE" + +func (s LBClientSslProfileBinding) GetType__() bindings.BindingType { + return LBClientSslProfileBindingBindingType() +} + +func (s LBClientSslProfileBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBClientSslProfileBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to drop the connections. There is no extra propery in this action. If there is no match condition specified, the connection will be always dropped. This action can be specified at HTTP_ACCESS or HTTP_FORWARDING pahse. +type LBConnectionDropAction struct { + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBConnectionDropAction__TYPE_IDENTIFIER = "LBConnectionDropAction" + +func (s LBConnectionDropAction) GetType__() bindings.BindingType { + return LBConnectionDropActionBindingType() +} + +func (s LBConnectionDropAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBConnectionDropAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence is enabled on a LBVirtualServer by binding a persistence profile to it. +type LBCookiePersistenceProfile struct { + // HTTP cookie domain could be configured, only available for insert mode. + CookieDomain *string + // If fallback is true, once the cookie points to a server that is down (i.e. admin state DISABLED or healthcheck state is DOWN), then a new server is selected by default to handle that request. If fallback is false, it will cause the request to be rejected if cookie points to a server. + CookieFallback *bool + // If garble is set to true, cookie value (server IP and port) would be encrypted. If garble is set to false, cookie value would be plain text. + CookieGarble *bool + // Possible values are: + // + // * LBCookiePersistenceProfile#LBCookiePersistenceProfile_COOKIE_MODE_INSERT + // * LBCookiePersistenceProfile#LBCookiePersistenceProfile_COOKIE_MODE_PREFIX + // * LBCookiePersistenceProfile#LBCookiePersistenceProfile_COOKIE_MODE_REWRITE + // + // Cookie persistence mode. + CookieMode *string + // Cookie name. + CookieName *string + // HTTP cookie path could be set, only available for insert mode. + CookiePath *string + // Both session cookie and persistence cookie are supported, if not specified, it's a session cookie. It expires when the browser is closed. + CookieTime *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE + // + // The resource_type property identifies persistence profile type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Persistence shared setting indicates that all LBVirtualServers that consume this LBPersistenceProfile should share the same persistence mechanism when enabled. Meaning, persistence entries of a client accessing one virtual server will also affect the same client's connections to a different virtual server. For example, say there are two virtual servers vip-ip1:80 and vip-ip1:8080 bound to the same Group g1 consisting of two servers (s11:80 and s12:80). By default, each virtual server will have its own persistence table or cookie. So, in the earlier example, there will be two tables (vip-ip1:80, p1) and (vip-ip1:8080, p1) or cookies. So, if a client connects to vip1:80 and later connects to vip1:8080, the second connection may be sent to a different server than the first. When persistence_shared is enabled, then the second connection will always connect to the same server as the original connection. For COOKIE persistence type, the same cookie will be shared by multiple virtual servers. For SOURCE_IP persistence type, the persistence table will be shared across virtual servers. For GENERIC persistence type, the persistence table will be shared across virtual servers which consume the same persistence profile in LBRule actions. + PersistenceShared *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBCookiePersistenceProfile__TYPE_IDENTIFIER = "LBCookiePersistenceProfile" +const LBCookiePersistenceProfile_COOKIE_MODE_INSERT = "INSERT" +const LBCookiePersistenceProfile_COOKIE_MODE_PREFIX = "PREFIX" +const LBCookiePersistenceProfile_COOKIE_MODE_REWRITE = "REWRITE" + +func (s LBCookiePersistenceProfile) GetType__() bindings.BindingType { + return LBCookiePersistenceProfileBindingType() +} + +func (s LBCookiePersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBCookiePersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Cookie time. +type LBCookieTime struct { + // Possible values are: + // + // * LBCookieTime#LBCookieTime_TYPE_LBSESSIONCOOKIETIME + // * LBCookieTime#LBCookieTime_TYPE_LBPERSISTENCECOOKIETIME + // + // Both session cookie and persistence cookie are supported, Use LbSessionCookieTime for session cookie time setting, Use LbPersistenceCookieTime for persistence cookie time setting + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBCookieTime__TYPE_IDENTIFIER = "LBCookieTime" +const LBCookieTime_TYPE_LBSESSIONCOOKIETIME = "LBSessionCookieTime" +const LBCookieTime_TYPE_LBPERSISTENCECOOKIETIME = "LBPersistenceCookieTime" + +func (s LBCookieTime) GetType__() bindings.BindingType { + return LBCookieTimeBindingType() +} + +func (s LBCookieTime) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBCookieTime._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Fast TCP profile. +type LBFastTcpProfile struct { + // It is used to specify how long a closing TCP connection (both FINs received or a RST is received) should be kept for this application before cleaning up the connection. format: int64 + CloseTimeout *int64 + // If flow mirroring is enabled, all the flows to the bounded virtual server are mirrored to the standby node. + HaFlowMirroringEnabled *bool + // It is used to configure how long an idle TCP connection in ESTABLISHED state should be kept for this application before cleaning up. format: int64 + IdleTimeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBHTTPPROFILE + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE + // + // An application profile can be bound to a virtual server to specify the application protocol characteristics. It is used to influence how load balancing is performed. Currently, three types of application profiles are supported: LBFastTCPProfile, LBFastUDPProfile and LBHttpProfile. LBFastTCPProfile or LBFastUDPProfile is typically used when the application is using a custom protocol or a standard protocol not supported by the load balancer. It is also used in cases where the user only wants L4 load balancing mainly because L4 load balancing has much higher performance and scalability, and/or supports connection mirroring. LBHttpProfile is used for both HTTP and HTTPS applications. Though application rules, if bound to the virtual server, can be used to accomplish the same goal, LBHttpProfile is intended to simplify enabling certain common use cases. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBFastTcpProfile__TYPE_IDENTIFIER = "LBFastTcpProfile" + +func (s LBFastTcpProfile) GetType__() bindings.BindingType { + return LBFastTcpProfileBindingType() +} + +func (s LBFastTcpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBFastTcpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Fast UDP profile. +type LBFastUdpProfile struct { + // If flow mirroring is enabled, all the flows to the bounded virtual server are mirrored to the standby node. + FlowMirroringEnabled *bool + // Though UDP is a connectionless protocol, for the purposes of load balancing, all UDP packets with the same flow signature (source and destination IP/ports and IP protocol) received within the idle timeout period are considered to belong to the same connection and are sent to the same backend server. If no packets are received for idle timeout period, the connection (association between flow signature and the selected server) is cleaned up. format: int64 + IdleTimeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBHTTPPROFILE + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE + // + // An application profile can be bound to a virtual server to specify the application protocol characteristics. It is used to influence how load balancing is performed. Currently, three types of application profiles are supported: LBFastTCPProfile, LBFastUDPProfile and LBHttpProfile. LBFastTCPProfile or LBFastUDPProfile is typically used when the application is using a custom protocol or a standard protocol not supported by the load balancer. It is also used in cases where the user only wants L4 load balancing mainly because L4 load balancing has much higher performance and scalability, and/or supports connection mirroring. LBHttpProfile is used for both HTTP and HTTPS applications. Though application rules, if bound to the virtual server, can be used to accomplish the same goal, LBHttpProfile is intended to simplify enabling certain common use cases. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBFastUdpProfile__TYPE_IDENTIFIER = "LBFastUdpProfile" + +func (s LBFastUdpProfile) GetType__() bindings.BindingType { + return LBFastUdpProfileBindingType() +} + +func (s LBFastUdpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBFastUdpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence is enabled on a LBVirtualServer by binding a persistence profile to it. LBGenericPersistenceProfile cannot be attached to virtual server directly, it can be specified in LB rule actions. In HTTP forwarding phase, the profile can be specified in LBVariablePersistenceOnAction. In HTTP response rewriting phase, the profile can be specified in LBVariablePersistenceLearnAction. +type LBGenericPersistenceProfile struct { + // The mirroring enabled flag is to synchronize persistence entries. Persistence entries are not synchronized to the HA peer by default. + HaPersistenceMirroringEnabled *bool + // When all connections complete (reference count reaches 0), persistence entry timer is started with the expiration time. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE + // + // The resource_type property identifies persistence profile type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Persistence shared setting indicates that all LBVirtualServers that consume this LBPersistenceProfile should share the same persistence mechanism when enabled. Meaning, persistence entries of a client accessing one virtual server will also affect the same client's connections to a different virtual server. For example, say there are two virtual servers vip-ip1:80 and vip-ip1:8080 bound to the same Group g1 consisting of two servers (s11:80 and s12:80). By default, each virtual server will have its own persistence table or cookie. So, in the earlier example, there will be two tables (vip-ip1:80, p1) and (vip-ip1:8080, p1) or cookies. So, if a client connects to vip1:80 and later connects to vip1:8080, the second connection may be sent to a different server than the first. When persistence_shared is enabled, then the second connection will always connect to the same server as the original connection. For COOKIE persistence type, the same cookie will be shared by multiple virtual servers. For SOURCE_IP persistence type, the persistence table will be shared across virtual servers. For GENERIC persistence type, the persistence table will be shared across virtual servers which consume the same persistence profile in LBRule actions. + PersistenceShared *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBGenericPersistenceProfile__TYPE_IDENTIFIER = "LBGenericPersistenceProfile" + +func (s LBGenericPersistenceProfile) GetType__() bindings.BindingType { + return LBGenericPersistenceProfileBindingType() +} + +func (s LBGenericPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBGenericPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the LBRule object. This represents active health monitoring over HTTP. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healthchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type LBHttpMonitorProfile struct { + // String to send as part of HTTP health check request body. Valid only for certain HTTP methods like POST. + RequestBody *string + // Array of HTTP request headers. + RequestHeaders []LbHttpRequestHeader + // Possible values are: + // + // * LBHttpMonitorProfile#LBHttpMonitorProfile_REQUEST_METHOD_GET + // * LBHttpMonitorProfile#LBHttpMonitorProfile_REQUEST_METHOD_OPTIONS + // * LBHttpMonitorProfile#LBHttpMonitorProfile_REQUEST_METHOD_POST + // * LBHttpMonitorProfile#LBHttpMonitorProfile_REQUEST_METHOD_HEAD + // * LBHttpMonitorProfile#LBHttpMonitorProfile_REQUEST_METHOD_PUT + // + // The health check method for HTTP monitor type. + RequestMethod *string + // For HTTP active healthchecks, the HTTP request url sent can be customized and can include query parameters. + RequestUrl *string + // Possible values are: + // + // * LBHttpMonitorProfile#LBHttpMonitorProfile_REQUEST_VERSION_1_0 + // * LBHttpMonitorProfile#LBHttpMonitorProfile_REQUEST_VERSION_1_1 + // * LBHttpMonitorProfile#LBHttpMonitorProfile_REQUEST_VERSION_2_0 + // + // HTTP request version. + RequestVersion *string + // If HTTP response body match string (regular expressions not supported) is specified (using LBHttpMonitor.response_body) then the healthcheck HTTP response body is matched against the specified string and server is considered healthy only if there is a match. If the response body string is not specified, HTTP healthcheck is considered successful if the HTTP response status code is 2xx, but it can be configured to accept other status codes as successful. + ResponseBody *string + // The HTTP response status code should be a valid HTTP status code. format: int32 + ResponseStatusCodes []int64 + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. For ICMP monitor, monitor_port is not required. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE + // + // There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +const LBHttpMonitorProfile_REQUEST_METHOD_GET = "GET" +const LBHttpMonitorProfile_REQUEST_METHOD_OPTIONS = "OPTIONS" +const LBHttpMonitorProfile_REQUEST_METHOD_POST = "POST" +const LBHttpMonitorProfile_REQUEST_METHOD_HEAD = "HEAD" +const LBHttpMonitorProfile_REQUEST_METHOD_PUT = "PUT" +const LBHttpMonitorProfile_REQUEST_VERSION_1_0 = "HTTP_VERSION_1_0" +const LBHttpMonitorProfile_REQUEST_VERSION_1_1 = "HTTP_VERSION_1_1" +const LBHttpMonitorProfile_REQUEST_VERSION_2_0 = "HTTP_VERSION_2_0" + +func (s LBHttpMonitorProfile) GetType__() bindings.BindingType { + return LBHttpMonitorProfileBindingType() +} + +func (s LBHttpMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Http profile. +type LBHttpProfile struct { + // If a website is temporarily down or has moved, incoming requests for that virtual server can be temporarily redirected to a URL. + HttpRedirectTo *string + // Certain secure applications may want to force communication over SSL, but instead of rejecting non-SSL connections, they may choose to redirect the client automatically to use SSL. + HttpRedirectToHttps *bool + // It is used to specify the HTTP application idle timeout, it means that how long the load balancer will keep the connection idle to wait for the client to send the next keep-alive request. It is not a TCP socket setting. format: int64 + IdleTimeout *int64 + // NTLM is an authentication protocol that can be used over HTTP. If the flag is set to true, LB will use NTLM challenge/response methodology. + Ntlm *bool + // If it is not specified, it means that request body size is unlimited. format: int64 + RequestBodySize *int64 + // A request with header equal to or below this size is guaranteed to be processed. A request with header larger than request_header_size will be processed up to 32K bytes on best effort basis. format: int64 + RequestHeaderSize *int64 + // When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. When buffering is enabled, LB receives a response from the backend server as soon as possible, saving it into the buffers. + ResponseBuffering *bool + // A response with header larger than response_header_size will be dropped. format: int64 + ResponseHeaderSize *int64 + // If server doesn’t send any packet within this time, the connection is closed. format: int64 + ResponseTimeout *int64 + // Possible values are: + // + // * LBHttpProfile#LBHttpProfile_XFORWARDED_FOR_INSERT + // * LBHttpProfile#LBHttpProfile_XFORWARDED_FOR_REPLACE + // + // When X-Forwareded-For is configured, X-Forwarded-Proto and X-Forwarded-Port information is added automatically. The two additional header information can be also modified or deleted in load balancer rules. + XForwardedFor *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBHTTPPROFILE + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE + // * LBAppProfile#LBAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE + // + // An application profile can be bound to a virtual server to specify the application protocol characteristics. It is used to influence how load balancing is performed. Currently, three types of application profiles are supported: LBFastTCPProfile, LBFastUDPProfile and LBHttpProfile. LBFastTCPProfile or LBFastUDPProfile is typically used when the application is using a custom protocol or a standard protocol not supported by the load balancer. It is also used in cases where the user only wants L4 load balancing mainly because L4 load balancing has much higher performance and scalability, and/or supports connection mirroring. LBHttpProfile is used for both HTTP and HTTPS applications. Though application rules, if bound to the virtual server, can be used to accomplish the same goal, LBHttpProfile is intended to simplify enabling certain common use cases. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpProfile__TYPE_IDENTIFIER = "LBHttpProfile" +const LBHttpProfile_XFORWARDED_FOR_INSERT = "INSERT" +const LBHttpProfile_XFORWARDED_FOR_REPLACE = "REPLACE" + +func (s LBHttpProfile) GetType__() bindings.BindingType { + return LBHttpProfileBindingType() +} + +func (s LBHttpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to redirect HTTP request messages to a new URL. The reply_status value specified in this action is used as the status code of HTTP response message which is sent back to client (Normally a browser). The HTTP status code for redirection is 3xx, for example, 301, 302, 303, 307, etc. The redirect_url is the new URL that the HTTP request message is redirected to. Normally browser will send another HTTP request to the new URL after receiving a redirection response message. Captured variables and built-in variables can be used in redirect_url field. For example, to redirect all HTTP requests to HTTPS requests for a virtual server. We create an LBRule without any conditions, add an LBHttpRedirectAction to the rule. Set the redirect_url field of the LBHttpRedirectAction to: https://$_host$_request_uri And set redirect_status to \"302\", which means found. This rule will redirect all HTTP requests to HTTPS server port on the same host. +type LBHttpRedirectAction struct { + // HTTP response status code. + RedirectStatus *string + // The URL that the HTTP request is redirected to. + RedirectUrl *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRedirectAction__TYPE_IDENTIFIER = "LBHttpRedirectAction" + +func (s LBHttpRedirectAction) GetType__() bindings.BindingType { + return LBHttpRedirectActionBindingType() +} + +func (s LBHttpRedirectAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRedirectAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to reject HTTP request messages. The specified reply_status value is used as the status code for the corresponding HTTP response message which is sent back to client (Normally a browser) indicating the reason it was rejected. Reference official HTTP status code list for your specific HTTP version to set the reply_status properly. LBHttpRejectAction does not support variables. +type LBHttpRejectAction struct { + // Response message. + ReplyMessage *string + // HTTP response status code. + ReplyStatus *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRejectAction__TYPE_IDENTIFIER = "LBHttpRejectAction" + +func (s LBHttpRejectAction) GetType__() bindings.BindingType { + return LBHttpRejectActionBindingType() +} + +func (s LBHttpRejectAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRejectAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match the message body of an HTTP request. Typically, only HTTP POST, PATCH, or PUT requests have request body. The match_type field defines how body_value field is used to match the body of HTTP requests. +type LBHttpRequestBodyCondition struct { + // HTTP request body + BodyValue *string + // If true, case is significant when comparing HTTP body value. + CaseSensitive *bool + // Possible values are: + // + // * LBHttpRequestBodyCondition#LBHttpRequestBodyCondition_MATCH_TYPE_STARTS_WITH + // * LBHttpRequestBodyCondition#LBHttpRequestBodyCondition_MATCH_TYPE_ENDS_WITH + // * LBHttpRequestBodyCondition#LBHttpRequestBodyCondition_MATCH_TYPE_EQUALS + // * LBHttpRequestBodyCondition#LBHttpRequestBodyCondition_MATCH_TYPE_CONTAINS + // * LBHttpRequestBodyCondition#LBHttpRequestBodyCondition_MATCH_TYPE_REGEX + // + // Match type of HTTP body + MatchType *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestBodyCondition__TYPE_IDENTIFIER = "LBHttpRequestBodyCondition" +const LBHttpRequestBodyCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBHttpRequestBodyCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBHttpRequestBodyCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBHttpRequestBodyCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBHttpRequestBodyCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBHttpRequestBodyCondition) GetType__() bindings.BindingType { + return LBHttpRequestBodyConditionBindingType() +} + +func (s LBHttpRequestBodyCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestBodyCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match HTTP request messages by cookie which is a specific type of HTTP header. The match_type and case_sensitive define how to compare cookie value. +type LBHttpRequestCookieCondition struct { + // If true, case is significant when comparing cookie value. + CaseSensitive *bool + // Cookie name. + CookieName *string + // Cookie value. + CookieValue *string + // Possible values are: + // + // * LBHttpRequestCookieCondition#LBHttpRequestCookieCondition_MATCH_TYPE_STARTS_WITH + // * LBHttpRequestCookieCondition#LBHttpRequestCookieCondition_MATCH_TYPE_ENDS_WITH + // * LBHttpRequestCookieCondition#LBHttpRequestCookieCondition_MATCH_TYPE_EQUALS + // * LBHttpRequestCookieCondition#LBHttpRequestCookieCondition_MATCH_TYPE_CONTAINS + // * LBHttpRequestCookieCondition#LBHttpRequestCookieCondition_MATCH_TYPE_REGEX + // + // Match type of cookie value. + MatchType *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestCookieCondition__TYPE_IDENTIFIER = "LBHttpRequestCookieCondition" +const LBHttpRequestCookieCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBHttpRequestCookieCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBHttpRequestCookieCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBHttpRequestCookieCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBHttpRequestCookieCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBHttpRequestCookieCondition) GetType__() bindings.BindingType { + return LBHttpRequestCookieConditionBindingType() +} + +func (s LBHttpRequestCookieCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestCookieCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match HTTP request messages by HTTP header fields. HTTP header fields are components of the header section of HTTP request and response messages. They define the operating parameters of an HTTP transaction. For example, Cookie, Authorization, User-Agent, etc. One condition can be used to match one header field, to match multiple header fields, multiple conditions must be specified. The match_type field defines how header_value field is used to match HTTP requests. The header_name field does not support match types. +type LBHttpRequestHeaderCondition struct { + // If true, case is significant when comparing HTTP header value. + CaseSensitive *bool + // Name of HTTP header + HeaderName *string + // Value of HTTP header + HeaderValue *string + // Possible values are: + // + // * LBHttpRequestHeaderCondition#LBHttpRequestHeaderCondition_MATCH_TYPE_STARTS_WITH + // * LBHttpRequestHeaderCondition#LBHttpRequestHeaderCondition_MATCH_TYPE_ENDS_WITH + // * LBHttpRequestHeaderCondition#LBHttpRequestHeaderCondition_MATCH_TYPE_EQUALS + // * LBHttpRequestHeaderCondition#LBHttpRequestHeaderCondition_MATCH_TYPE_CONTAINS + // * LBHttpRequestHeaderCondition#LBHttpRequestHeaderCondition_MATCH_TYPE_REGEX + // + // Match type of HTTP header value + MatchType *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestHeaderCondition__TYPE_IDENTIFIER = "LBHttpRequestHeaderCondition" +const LBHttpRequestHeaderCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBHttpRequestHeaderCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBHttpRequestHeaderCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBHttpRequestHeaderCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBHttpRequestHeaderCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBHttpRequestHeaderCondition) GetType__() bindings.BindingType { + return LBHttpRequestHeaderConditionBindingType() +} + +func (s LBHttpRequestHeaderCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestHeaderCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to delete header fields of HTTP request messages at HTTP_REQUEST_REWRITE phase. One action can be used to delete all headers with same header name. To delete headers with different header names, multiple actions must be defined. +type LBHttpRequestHeaderDeleteAction struct { + // Name of a header field of HTTP request message. + HeaderName *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestHeaderDeleteAction__TYPE_IDENTIFIER = "LBHttpRequestHeaderDeleteAction" + +func (s LBHttpRequestHeaderDeleteAction) GetType__() bindings.BindingType { + return LBHttpRequestHeaderDeleteActionBindingType() +} + +func (s LBHttpRequestHeaderDeleteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestHeaderDeleteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to rewrite header fields of matched HTTP request messages to specified new values. One action can be used to rewrite one header field. To rewrite multiple header fields, multiple actions must be defined. Captured variables and built-in variables can be used in the header_value field, header_name field does not support variables. +type LBHttpRequestHeaderRewriteAction struct { + // Name of HTTP request header. + HeaderName *string + // Value of HTTP request header. + HeaderValue *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestHeaderRewriteAction__TYPE_IDENTIFIER = "LBHttpRequestHeaderRewriteAction" + +func (s LBHttpRequestHeaderRewriteAction) GetType__() bindings.BindingType { + return LBHttpRequestHeaderRewriteActionBindingType() +} + +func (s LBHttpRequestHeaderRewriteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestHeaderRewriteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match method of HTTP requests. If the method of an HTTP request is same as the method specified in this condition, the HTTP request match this condition. For example, if the method field is set to GET in this condition, any HTTP request with GET method matches the condition. +type LBHttpRequestMethodCondition struct { + // Possible values are: + // + // * LBHttpRequestMethodCondition#LBHttpRequestMethodCondition_METHOD_GET + // * LBHttpRequestMethodCondition#LBHttpRequestMethodCondition_METHOD_OPTIONS + // * LBHttpRequestMethodCondition#LBHttpRequestMethodCondition_METHOD_POST + // * LBHttpRequestMethodCondition#LBHttpRequestMethodCondition_METHOD_HEAD + // * LBHttpRequestMethodCondition#LBHttpRequestMethodCondition_METHOD_PUT + // + // Type of HTTP request method + Method *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestMethodCondition__TYPE_IDENTIFIER = "LBHttpRequestMethodCondition" +const LBHttpRequestMethodCondition_METHOD_GET = "GET" +const LBHttpRequestMethodCondition_METHOD_OPTIONS = "OPTIONS" +const LBHttpRequestMethodCondition_METHOD_POST = "POST" +const LBHttpRequestMethodCondition_METHOD_HEAD = "HEAD" +const LBHttpRequestMethodCondition_METHOD_PUT = "PUT" + +func (s LBHttpRequestMethodCondition) GetType__() bindings.BindingType { + return LBHttpRequestMethodConditionBindingType() +} + +func (s LBHttpRequestMethodCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestMethodCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match URI arguments aka query string of Http request messages, for example, in URI http://exaple.com?foo=1&bar=2, the \"foo=1&bar=2\" is the query string containing URI arguments. In an URI scheme, query string is indicated by the first question mark (\"?\") character and terminated by a number sign (\"#\") character or by the end of the URI. The uri_arguments field can be specified as a regular expression(Set match_type to REGEX). For example, \"foo=(?<x>\\d+)\". It matches HTTP requests whose URI arguments containing \"foo\", the value of foo contains only digits. And the value of foo is captured as $x which can be used in LBRuleAction fields which support variables. +type LBHttpRequestUriArgumentsCondition struct { + // If true, case is significant when comparing URI arguments. + CaseSensitive *bool + // Possible values are: + // + // * LBHttpRequestUriArgumentsCondition#LBHttpRequestUriArgumentsCondition_MATCH_TYPE_STARTS_WITH + // * LBHttpRequestUriArgumentsCondition#LBHttpRequestUriArgumentsCondition_MATCH_TYPE_ENDS_WITH + // * LBHttpRequestUriArgumentsCondition#LBHttpRequestUriArgumentsCondition_MATCH_TYPE_EQUALS + // * LBHttpRequestUriArgumentsCondition#LBHttpRequestUriArgumentsCondition_MATCH_TYPE_CONTAINS + // * LBHttpRequestUriArgumentsCondition#LBHttpRequestUriArgumentsCondition_MATCH_TYPE_REGEX + // + // Match type of URI arguments + MatchType *string + // URI arguments, aka query string of URI. + UriArguments *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestUriArgumentsCondition__TYPE_IDENTIFIER = "LBHttpRequestUriArgumentsCondition" +const LBHttpRequestUriArgumentsCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBHttpRequestUriArgumentsCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBHttpRequestUriArgumentsCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBHttpRequestUriArgumentsCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBHttpRequestUriArgumentsCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBHttpRequestUriArgumentsCondition) GetType__() bindings.BindingType { + return LBHttpRequestUriArgumentsConditionBindingType() +} + +func (s LBHttpRequestUriArgumentsCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestUriArgumentsCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match URIs(Uniform Resource Identifier) of HTTP request messages. The URI field can be specified as a regular expression. If an HTTP request message is requesting an URI which matches specified regular expression, it matches the condition. The syntax of whole URI looks like this: scheme:[//[user[:password]\\\\@]host[:port]][/path][?query][#fragment] This condition matches only the path part of entire URI. When match_type field is specified as REGEX, the uri field is used as a regular expression to match URI path of HTTP requests. For example, to match any URI that has \"/image/\" or \"/images/\", uri field can be specified as: \"/image[s]?/\". Named capturing groups can be used in the uri field to capture substrings of matched URIs and store them in variables for use in LBRuleAction. For example, specify uri field as: \"/news/(?<year>\\d+)/(?<month>\\d+)/(?<article>.\*)\" If the URI path is /articles/news/2017/06/xyz.html, then substring \"2017\" is captured in variable year, \"06\" is captured in variable month, and \"xyz.html\" is captured in variable article. These variables can then be used in an LBRuleAction field which supports variables, such as uri field of LBHttpRequestUriRewriteAction. For example, set the uri field of LBHttpRequestUriRewriteAction as: \"/articles/news/$year-$month-$article\" Then the URI path /articles/news/2017/06/xyz.html is rewritten to: \"/articles/news/2017-06-xyz.html\" +type LBHttpRequestUriCondition struct { + // If true, case is significant when comparing URI. + CaseSensitive *bool + // Possible values are: + // + // * LBHttpRequestUriCondition#LBHttpRequestUriCondition_MATCH_TYPE_STARTS_WITH + // * LBHttpRequestUriCondition#LBHttpRequestUriCondition_MATCH_TYPE_ENDS_WITH + // * LBHttpRequestUriCondition#LBHttpRequestUriCondition_MATCH_TYPE_EQUALS + // * LBHttpRequestUriCondition#LBHttpRequestUriCondition_MATCH_TYPE_CONTAINS + // * LBHttpRequestUriCondition#LBHttpRequestUriCondition_MATCH_TYPE_REGEX + // + // Match type of URI + MatchType *string + // A string used to identify resource + Uri *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestUriCondition__TYPE_IDENTIFIER = "LBHttpRequestUriCondition" +const LBHttpRequestUriCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBHttpRequestUriCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBHttpRequestUriCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBHttpRequestUriCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBHttpRequestUriCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBHttpRequestUriCondition) GetType__() bindings.BindingType { + return LBHttpRequestUriConditionBindingType() +} + +func (s LBHttpRequestUriCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestUriCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to rewrite URIs in matched HTTP request messages. Specify the uri and uri_arguments fields in this condition to rewrite the matched HTTP request message's URI and URI arguments to the new values. Full URI scheme of HTTP messages have following syntax: scheme:[//[user[:password]\\\\@]host[:port]][/path][?query][#fragment] The uri field of this action is used to rewrite the /path part in above scheme. And the uri_arguments field is used to rewrite the query part. Captured variables and built-in variables can be used in the uri and uri_arguments fields. Check the example in LBRuleAction to see how to use variables in this action. +type LBHttpRequestUriRewriteAction struct { + // URI of HTTP request. + Uri *string + // Query string of URI, typically contains key value pairs, for example: foo1=bar1&foo2=bar2. + UriArguments *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestUriRewriteAction__TYPE_IDENTIFIER = "LBHttpRequestUriRewriteAction" + +func (s LBHttpRequestUriRewriteAction) GetType__() bindings.BindingType { + return LBHttpRequestUriRewriteActionBindingType() +} + +func (s LBHttpRequestUriRewriteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestUriRewriteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match the HTTP protocol version of the HTTP request messages. +type LBHttpRequestVersionCondition struct { + // Possible values are: + // + // * LBHttpRequestVersionCondition#LBHttpRequestVersionCondition_VERSION_1_0 + // * LBHttpRequestVersionCondition#LBHttpRequestVersionCondition_VERSION_1_1 + // * LBHttpRequestVersionCondition#LBHttpRequestVersionCondition_VERSION_2_0 + // + // HTTP version + Version *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpRequestVersionCondition__TYPE_IDENTIFIER = "LBHttpRequestVersionCondition" +const LBHttpRequestVersionCondition_VERSION_1_0 = "HTTP_VERSION_1_0" +const LBHttpRequestVersionCondition_VERSION_1_1 = "HTTP_VERSION_1_1" +const LBHttpRequestVersionCondition_VERSION_2_0 = "HTTP_VERSION_2_0" + +func (s LBHttpRequestVersionCondition) GetType__() bindings.BindingType { + return LBHttpRequestVersionConditionBindingType() +} + +func (s LBHttpRequestVersionCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpRequestVersionCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match HTTP response messages from backend servers by HTTP header fields. HTTP header fields are components of the header section of HTTP request and response messages. They define the operating parameters of an HTTP transaction. For example, Cookie, Authorization, User-Agent, etc. One condition can be used to match one header field, to match multiple header fields, multiple conditions must be specified. The match_type field defines how header_value field is used to match HTTP responses. The header_name field does not support match types. +type LBHttpResponseHeaderCondition struct { + // If true, case is significant when comparing HTTP header value. + CaseSensitive *bool + // Name of HTTP header field + HeaderName *string + // Value of HTTP header field + HeaderValue *string + // Possible values are: + // + // * LBHttpResponseHeaderCondition#LBHttpResponseHeaderCondition_MATCH_TYPE_STARTS_WITH + // * LBHttpResponseHeaderCondition#LBHttpResponseHeaderCondition_MATCH_TYPE_ENDS_WITH + // * LBHttpResponseHeaderCondition#LBHttpResponseHeaderCondition_MATCH_TYPE_EQUALS + // * LBHttpResponseHeaderCondition#LBHttpResponseHeaderCondition_MATCH_TYPE_CONTAINS + // * LBHttpResponseHeaderCondition#LBHttpResponseHeaderCondition_MATCH_TYPE_REGEX + // + // Match type of HTTP header value + MatchType *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpResponseHeaderCondition__TYPE_IDENTIFIER = "LBHttpResponseHeaderCondition" +const LBHttpResponseHeaderCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBHttpResponseHeaderCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBHttpResponseHeaderCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBHttpResponseHeaderCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBHttpResponseHeaderCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBHttpResponseHeaderCondition) GetType__() bindings.BindingType { + return LBHttpResponseHeaderConditionBindingType() +} + +func (s LBHttpResponseHeaderCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpResponseHeaderCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to delete header fields of HTTP response messages at HTTP_RESPONSE_REWRITE phase. One action can be used to delete allgi headers with same header name. To delete headers with different header names, multiple actions must be defined. +type LBHttpResponseHeaderDeleteAction struct { + // Name of a header field of HTTP response message. + HeaderName *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpResponseHeaderDeleteAction__TYPE_IDENTIFIER = "LBHttpResponseHeaderDeleteAction" + +func (s LBHttpResponseHeaderDeleteAction) GetType__() bindings.BindingType { + return LBHttpResponseHeaderDeleteActionBindingType() +} + +func (s LBHttpResponseHeaderDeleteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpResponseHeaderDeleteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to rewrite header fields of HTTP response messages to specified new values at HTTP_RESPONSE_REWRITE phase. One action can be used to rewrite one header field. To rewrite multiple header fields, multiple actions must be defined. Captured variables and built-in variables can be used in the header_value field, header_name field does not support variables. +type LBHttpResponseHeaderRewriteAction struct { + // Name of a header field of HTTP request message. + HeaderName *string + // Value of header field + HeaderValue *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpResponseHeaderRewriteAction__TYPE_IDENTIFIER = "LBHttpResponseHeaderRewriteAction" + +func (s LBHttpResponseHeaderRewriteAction) GetType__() bindings.BindingType { + return LBHttpResponseHeaderRewriteActionBindingType() +} + +func (s LBHttpResponseHeaderRewriteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpResponseHeaderRewriteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match SSL handshake and SSL connection at all phases.If multiple properties are configured, the rule is considered a match when all the configured properties are matched. +type LBHttpSslCondition struct { + // The issuer DN match condition of the client certificate for an established SSL connection. + ClientCertificateIssuerDn *LBClientCertificateIssuerDnCondition + // The subject DN match condition of the client certificate for an established SSL connection. + ClientCertificateSubjectDn *LBClientCertificateSubjectDnCondition + // Possible values are: + // + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // Cipher list which supported by client. + ClientSupportedSslCiphers []string + // Possible values are: + // + // * LBHttpSslCondition#LBHttpSslCondition_SESSION_REUSED_IGNORE + // * LBHttpSslCondition#LBHttpSslCondition_SESSION_REUSED_REUSED + // * LBHttpSslCondition#LBHttpSslCondition_SESSION_REUSED_NEW + // + // The type of SSL session reused. + SessionReused *string + // Possible values are: + // + // * LBHttpSslCondition#LBHttpSslCondition_USED_PROTOCOL_SSL_V2 + // * LBHttpSslCondition#LBHttpSslCondition_USED_PROTOCOL_SSL_V3 + // * LBHttpSslCondition#LBHttpSslCondition_USED_PROTOCOL_TLS_V1 + // * LBHttpSslCondition#LBHttpSslCondition_USED_PROTOCOL_TLS_V1_1 + // * LBHttpSslCondition#LBHttpSslCondition_USED_PROTOCOL_TLS_V1_2 + // + // Protocol of an established SSL connection. + UsedProtocol *string + // Possible values are: + // + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_3DES_EDE_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_GCM_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LBHttpSslCondition#LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // Cipher used for an established SSL connection. + UsedSslCipher *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBHttpSslCondition__TYPE_IDENTIFIER = "LBHttpSslCondition" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LBHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_SESSION_REUSED_IGNORE = "IGNORE" +const LBHttpSslCondition_SESSION_REUSED_REUSED = "REUSED" +const LBHttpSslCondition_SESSION_REUSED_NEW = "NEW" +const LBHttpSslCondition_USED_PROTOCOL_SSL_V2 = "SSL_V2" +const LBHttpSslCondition_USED_PROTOCOL_SSL_V3 = "SSL_V3" +const LBHttpSslCondition_USED_PROTOCOL_TLS_V1 = "TLS_V1" +const LBHttpSslCondition_USED_PROTOCOL_TLS_V1_1 = "TLS_V1_1" +const LBHttpSslCondition_USED_PROTOCOL_TLS_V1_2 = "TLS_V1_2" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LBHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" + +func (s LBHttpSslCondition) GetType__() bindings.BindingType { + return LBHttpSslConditionBindingType() +} + +func (s LBHttpSslCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpSslCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the LBRule object. This represents active health monitoring over HTTPS. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healthchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type LBHttpsMonitorProfile struct { + // String to send as part of HTTP health check request body. Valid only for certain HTTP methods like POST. + RequestBody *string + // Array of HTTP request headers. + RequestHeaders []LbHttpRequestHeader + // Possible values are: + // + // * LBHttpsMonitorProfile#LBHttpsMonitorProfile_REQUEST_METHOD_GET + // * LBHttpsMonitorProfile#LBHttpsMonitorProfile_REQUEST_METHOD_OPTIONS + // * LBHttpsMonitorProfile#LBHttpsMonitorProfile_REQUEST_METHOD_POST + // * LBHttpsMonitorProfile#LBHttpsMonitorProfile_REQUEST_METHOD_HEAD + // * LBHttpsMonitorProfile#LBHttpsMonitorProfile_REQUEST_METHOD_PUT + // + // The health check method for HTTP monitor type. + RequestMethod *string + // For HTTPS active healthchecks, the HTTPS request url sent can be customized and can include query parameters. + RequestUrl *string + // Possible values are: + // + // * LBHttpsMonitorProfile#LBHttpsMonitorProfile_REQUEST_VERSION_1_0 + // * LBHttpsMonitorProfile#LBHttpsMonitorProfile_REQUEST_VERSION_1_1 + // * LBHttpsMonitorProfile#LBHttpsMonitorProfile_REQUEST_VERSION_2_0 + // + // HTTP request version. + RequestVersion *string + // If HTTP response body match string (regular expressions not supported) is specified (using LBHttpMonitor.response_body) then the healthcheck HTTP response body is matched against the specified string and server is considered healthy only if there is a match. If the response body string is not specified, HTTP healthcheck is considered successful if the HTTP response status code is 2xx, but it can be configured to accept other status codes as successful. + ResponseBody *string + // The HTTP response status code should be a valid HTTP status code. format: int32 + ResponseStatusCodes []int64 + // The setting is used when the monitor acts as an SSL client and establishing a connection to the backend server. + ServerSslProfileBinding *LBServerSslProfileBinding + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. For ICMP monitor, monitor_port is not required. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE + // + // There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +const LBHttpsMonitorProfile_REQUEST_METHOD_GET = "GET" +const LBHttpsMonitorProfile_REQUEST_METHOD_OPTIONS = "OPTIONS" +const LBHttpsMonitorProfile_REQUEST_METHOD_POST = "POST" +const LBHttpsMonitorProfile_REQUEST_METHOD_HEAD = "HEAD" +const LBHttpsMonitorProfile_REQUEST_METHOD_PUT = "PUT" +const LBHttpsMonitorProfile_REQUEST_VERSION_1_0 = "HTTP_VERSION_1_0" +const LBHttpsMonitorProfile_REQUEST_VERSION_1_1 = "HTTP_VERSION_1_1" +const LBHttpsMonitorProfile_REQUEST_VERSION_2_0 = "HTTP_VERSION_2_0" + +func (s LBHttpsMonitorProfile) GetType__() bindings.BindingType { + return LBHttpsMonitorProfileBindingType() +} + +func (s LBHttpsMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBHttpsMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the LBRule object. This represents active health monitoring over ICMP. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healt hchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type LBIcmpMonitorProfile struct { + // The data size (in byte) of the ICMP healthcheck packet format: int64 + DataLength *int64 + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. For ICMP monitor, monitor_port is not required. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE + // + // There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s LBIcmpMonitorProfile) GetType__() bindings.BindingType { + return LBIcmpMonitorProfileBindingType() +} + +func (s LBIcmpMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBIcmpMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match IP header fields of HTTP messages. Either source_address or group_id should be specified. +type LBIpHeaderCondition struct { + // Source IP address of HTTP message should match IP addresses which are configured in Group in order to perform actions. + GroupPath *string + // Source IP address of HTTP message. IP Address can be expressed as a single IP address like 10.1.1.1, or a range of IP addresses like 10.1.1.101-10.1.1.160. Both IPv4 and IPv6 addresses are supported. format: address-or-block-or-range + SourceAddress *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBIpHeaderCondition__TYPE_IDENTIFIER = "LBIpHeaderCondition" + +func (s LBIpHeaderCondition) GetType__() bindings.BindingType { + return LBIpHeaderConditionBindingType() +} + +func (s LBIpHeaderCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBIpHeaderCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to control access to backend server resources using JSON Web Token(JWT) authentication. The JWT authentication is done before any HTTP manipulation if the HTTP request matches the given condition in LBRule. Any verification failed, the HTTP process will be terminated, and HTTP response with 401 status code and WWW-Authentication header will be returned to client. +type LBJwtAuthAction struct { + // LBJwtKey used for verifying the signature of JWT token + Key *data.StructValue + // Specify whether to pass the JWT to backend server or remove it. By default, it is false which means will not pass the JWT to backend servers. + PassJwtToPool *bool + // A description of the protected area. If no realm is specified, clients often display a formatted hostname instead. The configured realm is returned when client request is rejected with 401 http status. In the response, it will be \"WWW-Authentication: Bearer realm=\". + Realm *string + // JWT is an open standard that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Load balancer will search for every specified tokens one by one for the jwt message until found. This parameter is optional. In case not found or this field is not configured, load balancer searches the Bearer header by default in the http request \"Authorization: Bearer \". + Tokens []string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBJwtAuthAction__TYPE_IDENTIFIER = "LBJwtAuthAction" + +func (s LBJwtAuthAction) GetType__() bindings.BindingType { + return LBJwtAuthActionBindingType() +} + +func (s LBJwtAuthAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBJwtAuthAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The key is used to specify certificate which is used to verify the signature of JWT tokens. +type LBJwtCertificateKey struct { + // Certificate identifier + CertificatePath *string + // Possible values are: + // + // * LBJwtKey#LBJwtKey_TYPE_LBJWTCERTIFICATEKEY + // * LBJwtKey#LBJwtKey_TYPE_LBJWTSYMMETRICKEY + // * LBJwtKey#LBJwtKey_TYPE_LBJWTPUBLICKEY + // + // The property is used to identify JWT key type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBJwtCertificateKey__TYPE_IDENTIFIER = "LBJwtCertificateKey" + +func (s LBJwtCertificateKey) GetType__() bindings.BindingType { + return LBJwtCertificateKeyBindingType() +} + +func (s LBJwtCertificateKey) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBJwtCertificateKey._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// LBJwtKey specifies the symmetric key or asymmetric public key used to decrypt the data in JWT. +type LBJwtKey struct { + // Possible values are: + // + // * LBJwtKey#LBJwtKey_TYPE_LBJWTCERTIFICATEKEY + // * LBJwtKey#LBJwtKey_TYPE_LBJWTSYMMETRICKEY + // * LBJwtKey#LBJwtKey_TYPE_LBJWTPUBLICKEY + // + // The property is used to identify JWT key type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBJwtKey__TYPE_IDENTIFIER = "LBJwtKey" +const LBJwtKey_TYPE_LBJWTCERTIFICATEKEY = "LBJwtCertificateKey" +const LBJwtKey_TYPE_LBJWTSYMMETRICKEY = "LBJwtSymmetricKey" +const LBJwtKey_TYPE_LBJWTPUBLICKEY = "LBJwtPublicKey" + +func (s LBJwtKey) GetType__() bindings.BindingType { + return LBJwtKeyBindingType() +} + +func (s LBJwtKey) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBJwtKey._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The key is used to specify the public key content which is used to verify the signature of JWT tokens. +type LBJwtPublicKey struct { + // Content of public key + PublicKeyContent *string + // Possible values are: + // + // * LBJwtKey#LBJwtKey_TYPE_LBJWTCERTIFICATEKEY + // * LBJwtKey#LBJwtKey_TYPE_LBJWTSYMMETRICKEY + // * LBJwtKey#LBJwtKey_TYPE_LBJWTPUBLICKEY + // + // The property is used to identify JWT key type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBJwtPublicKey__TYPE_IDENTIFIER = "LBJwtPublicKey" + +func (s LBJwtPublicKey) GetType__() bindings.BindingType { + return LBJwtPublicKeyBindingType() +} + +func (s LBJwtPublicKey) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBJwtPublicKey._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The key is used to specify the symmetric key which is used to verify the signature of JWT tokens. +type LBJwtSymmetricKey struct { + // Possible values are: + // + // * LBJwtKey#LBJwtKey_TYPE_LBJWTCERTIFICATEKEY + // * LBJwtKey#LBJwtKey_TYPE_LBJWTSYMMETRICKEY + // * LBJwtKey#LBJwtKey_TYPE_LBJWTPUBLICKEY + // + // The property is used to identify JWT key type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBJwtSymmetricKey__TYPE_IDENTIFIER = "LBJwtSymmetricKey" + +func (s LBJwtSymmetricKey) GetType__() bindings.BindingType { + return LBJwtSymmetricKeyBindingType() +} + +func (s LBJwtSymmetricKey) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBJwtSymmetricKey._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LBMonitorProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE + // + // There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBMonitorProfile__TYPE_IDENTIFIER = "LBMonitorProfile" +const LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE = "LBTcpMonitorProfile" +const LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE = "LBUdpMonitorProfile" +const LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE = "LBIcmpMonitorProfile" +const LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE = "LBHttpMonitorProfile" +const LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE = "LBHttpsMonitorProfile" +const LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE = "LBPassiveMonitorProfile" + +func (s LBMonitorProfile) GetType__() bindings.BindingType { + return LBMonitorProfileBindingType() +} + +func (s LBMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The passive type of LBMonitorProfile. +type LBPassiveMonitorProfile struct { + // When the consecutive failures reach this value, then the member is considered temporarily unavailable for a configurable period format: int64 + MaxFails *int64 + // After this timeout period, the member is tried again for a new connection to see if it is available. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE + // + // There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBPassiveMonitorProfile__TYPE_IDENTIFIER = "LBPassiveMonitorProfile" + +func (s LBPassiveMonitorProfile) GetType__() bindings.BindingType { + return LBPassiveMonitorProfileBindingType() +} + +func (s LBPassiveMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBPassiveMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Persistence cookie time. +type LBPersistenceCookieTime struct { + // HTTP cookie max-age to expire cookie, only available for insert mode. format: int64 + CookieMaxIdle *int64 + // Possible values are: + // + // * LBCookieTime#LBCookieTime_TYPE_LBSESSIONCOOKIETIME + // * LBCookieTime#LBCookieTime_TYPE_LBPERSISTENCECOOKIETIME + // + // Both session cookie and persistence cookie are supported, Use LbSessionCookieTime for session cookie time setting, Use LbPersistenceCookieTime for persistence cookie time setting + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBPersistenceCookieTime__TYPE_IDENTIFIER = "LBPersistenceCookieTime" + +func (s LBPersistenceCookieTime) GetType__() bindings.BindingType { + return LBPersistenceCookieTimeBindingType() +} + +func (s LBPersistenceCookieTime) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBPersistenceCookieTime._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence is enabled on a LBVirtualServer by binding a persistence profile to it. LBGenericPersistenceProfile cannot be attached to LBVirtualServer directly, it can be specified in LBVariablePersistenceOnAction or LBVariablePersistenceLearnAction in LBRule. If a user attaches a LBGenericPersistenceProfile directly to a virtual server, the operation is rejected. +type LBPersistenceProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE + // + // The resource_type property identifies persistence profile type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Persistence shared setting indicates that all LBVirtualServers that consume this LBPersistenceProfile should share the same persistence mechanism when enabled. Meaning, persistence entries of a client accessing one virtual server will also affect the same client's connections to a different virtual server. For example, say there are two virtual servers vip-ip1:80 and vip-ip1:8080 bound to the same Group g1 consisting of two servers (s11:80 and s12:80). By default, each virtual server will have its own persistence table or cookie. So, in the earlier example, there will be two tables (vip-ip1:80, p1) and (vip-ip1:8080, p1) or cookies. So, if a client connects to vip1:80 and later connects to vip1:8080, the second connection may be sent to a different server than the first. When persistence_shared is enabled, then the second connection will always connect to the same server as the original connection. For COOKIE persistence type, the same cookie will be shared by multiple virtual servers. For SOURCE_IP persistence type, the persistence table will be shared across virtual servers. For GENERIC persistence type, the persistence table will be shared across virtual servers which consume the same persistence profile in LBRule actions. + PersistenceShared *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBPersistenceProfile__TYPE_IDENTIFIER = "LBPersistenceProfile" +const LBPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE = "LBSourceIpPersistenceProfile" +const LBPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE = "LBCookiePersistenceProfile" +const LBPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE = "LBGenericPersistenceProfile" + +func (s LBPersistenceProfile) GetType__() bindings.BindingType { + return LBPersistenceProfileBindingType() +} + +func (s LBPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Defining access of a Group from a LBVirtualServer and binding to LBMonitorProfile. +type LBPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the pool. If multiple active monitors are configured, the pool member status is UP only when the health check status for all the monitors are UP. + ActiveMonitorPaths []string + // Possible values are: + // + // * LBPool#LBPool_ALGORITHM_ROUND_ROBIN + // * LBPool#LBPool_ALGORITHM_WEIGHTED_ROUND_ROBIN + // * LBPool#LBPool_ALGORITHM_LEAST_CONNECTION + // * LBPool#LBPool_ALGORITHM_WEIGHTED_LEAST_CONNECTION + // * LBPool#LBPool_ALGORITHM_IP_HASH + // + // Load Balancing algorithm chooses a server for each new connection by going through the list of servers in the pool. Currently, following load balancing algorithms are supported with ROUND_ROBIN as the default. ROUND_ROBIN means that a server is selected in a round-robin fashion. The weight would be ignored even if it is configured. WEIGHTED_ROUND_ROBIN means that a server is selected in a weighted round-robin fashion. Default weight of 1 is used if weight is not configured. LEAST_CONNECTION means that a server is selected when it has the least number of connections. The weight would be ignored even if it is configured. Slow start would be enabled by default. WEIGHTED_LEAST_CONNECTION means that a server is selected in a weighted least connection fashion. Default weight of 1 is used if weight is not configured. Slow start would be enabled by default. IP_HASH means that consistent hash is performed on the source IP address of the incoming connection. This ensures that the same client IP address will always reach the same server as long as no server goes down or up. It may be used on the Internet to provide a best-effort stickiness to clients which refuse session cookies. + Algorithm *string + // Load balancer pool support grouping object as dynamic pool members. When member group is defined, members setting should not be specified. + MemberGroup *LBPoolMemberGroup + // Server pool consists of one or more pool members. Each pool member is identified, typically, by an IP address and a port. + Members []LBPoolMember + // A pool is considered active if there are at least certain minimum number of members. format: int64 + MinActiveMembers *int64 + // Passive healthchecks are disabled by default and can be enabled by attaching a passive health monitor to a server pool. Each time a client connection to a pool member fails, its failed count is incremented. For pools bound to L7 virtual servers, a connection is considered to be failed and failed count is incremented if any TCP connection errors (e.g. TCP RST or failure to send data) or SSL handshake failures occur. For pools bound to L4 virtual servers, if no response is received to a TCP SYN sent to the pool member or if a TCP RST is received in response to a TCP SYN, then the pool member is considered to have failed and the failed count is incremented. + PassiveMonitorPath *string + // Depending on the topology, Source NAT (SNAT) may be required to ensure traffic from the server destined to the client is received by the load balancer. SNAT can be enabled per pool. If SNAT is not enabled for a pool, then load balancer uses the client IP and port (spoofing) while establishing connections to the servers. This is referred to as no-SNAT or TRANSPARENT mode. By default Source NAT is enabled as LBSnatAutoMap. + SnatTranslation *data.StructValue + // TCP multiplexing allows the same TCP connection between load balancer and the backend server to be used for sending multiple client requests from different client TCP connections. + TcpMultiplexingEnabled *bool + // The maximum number of TCP connections per pool that are idly kept alive for sending future client requests. format: int64 + TcpMultiplexingNumber *int64 +} +const LBPool_ALGORITHM_ROUND_ROBIN = "ROUND_ROBIN" +const LBPool_ALGORITHM_WEIGHTED_ROUND_ROBIN = "WEIGHTED_ROUND_ROBIN" +const LBPool_ALGORITHM_LEAST_CONNECTION = "LEAST_CONNECTION" +const LBPool_ALGORITHM_WEIGHTED_LEAST_CONNECTION = "WEIGHTED_LEAST_CONNECTION" +const LBPool_ALGORITHM_IP_HASH = "IP_HASH" + +func (s LBPool) GetType__() bindings.BindingType { + return LBPoolBindingType() +} + +func (s LBPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Pool member. +type LBPoolMember struct { + // Possible values are: + // + // * LBPoolMember#LBPoolMember_ADMIN_STATE_ENABLED + // * LBPoolMember#LBPoolMember_ADMIN_STATE_DISABLED + // * LBPoolMember#LBPoolMember_ADMIN_STATE_GRACEFUL_DISABLED + // + // Member admin state. + AdminState *string + // Backup servers are typically configured with a sorry page indicating to the user that the application is currently unavailable. While the pool is active (a specified minimum number of pool members are active) BACKUP members are skipped during server selection. When the pool is inactive, incoming connections are sent to only the BACKUP member(s). + BackupMember *bool + // Pool member name. + DisplayName *string + // Pool member IP address. format: ip + IpAddress *string + // To ensure members are not overloaded, connections to a member can be capped by the load balancer. When a member reaches this limit, it is skipped during server selection. If it is not specified, it means that connections are unlimited. format: int64 + MaxConcurrentConnections *int64 + // If port is specified, all connections will be sent to this port. Only single port is supported. If unset, the same port the client connected to will be used, it could be overrode by default_pool_member_port setting in virtual server. The port should not specified for port range case. format: port-or-range + Port *string + // Pool member weight is used for WEIGHTED_ROUND_ROBIN balancing algorithm. The weight value would be ignored in other algorithms. format: int64 + Weight *int64 +} +const LBPoolMember_ADMIN_STATE_ENABLED = "ENABLED" +const LBPoolMember_ADMIN_STATE_DISABLED = "DISABLED" +const LBPoolMember_ADMIN_STATE_GRACEFUL_DISABLED = "GRACEFUL_DISABLED" + +func (s LBPoolMember) GetType__() bindings.BindingType { + return LBPoolMemberBindingType() +} + +func (s LBPoolMember) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBPoolMember._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Pool member group. +type LBPoolMemberGroup struct { + // The list is used to show the customized pool member settings. User can only user pool member action API to update the admin state for a specific IP address. + CustomizedMembers []PoolMemberSetting + // Load balancer pool support Group as dynamic pool members. The IP list of the Group would be used as pool member IP setting. + GroupPath *string + // Possible values are: + // + // * LBPoolMemberGroup#LBPoolMemberGroup_IP_REVISION_FILTER_IPV4 + // * LBPoolMemberGroup#LBPoolMemberGroup_IP_REVISION_FILTER_IPV6 + // * LBPoolMemberGroup#LBPoolMemberGroup_IP_REVISION_FILTER_IPV4_IPV6 + // + // Ip revision filter is used to filter IPv4 or IPv6 addresses from the grouping object. If the filter is not specified, both IPv4 and IPv6 addresses would be used as server IPs. The link local and loopback addresses would be always filtered out. + IpRevisionFilter *string + // The size is used to define the maximum number of grouping object IP address list. These IP addresses would be used as pool members. If the grouping object includes more than certain number of IP addresses, the redundant parts would be ignored and those IP addresses would not be treated as pool members. If the size is not specified, one member is budgeted for this dynamic pool so that the pool has at least one member even if some other dynamic pools grow beyond the capacity of load balancer service. Other members are picked according to available dynamic capacity. The unused members would be set to DISABLED so that the load balancer system itself is not overloaded during runtime. format: int64 + MaxIpListSize *int64 + // If port is specified, all connections will be sent to this port. If unset, the same port the client connected to will be used, it could be overridden by default_pool_member_ports setting in virtual server. The port should not specified for multiple ports case. format: int32 + Port *int64 +} +const LBPoolMemberGroup_IP_REVISION_FILTER_IPV4 = "IPV4" +const LBPoolMemberGroup_IP_REVISION_FILTER_IPV6 = "IPV6" +const LBPoolMemberGroup_IP_REVISION_FILTER_IPV4_IPV6 = "IPV4_IPV6" + +func (s LBPoolMemberGroup) GetType__() bindings.BindingType { + return LBPoolMemberGroupBindingType() +} + +func (s LBPoolMemberGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBPoolMemberGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Binding of a LBPool and Group to a LBVirtualServer used to route application traffic passing through load balancers. LBRule uses match conditions to match application traffic passing through a LBVirtualServer using HTTP or HTTPS. Can bind multiple LBVirtualServers to a Group. Each LBRule consists of two optional match conditions, each match contidion defines a criterion for application traffic. If no match conditions are specified, then the LBRule will always match and it is used typically to define default rules. If more than one match condition is specified, then matching strategy determines if all conditions should match or any one condition should match for the LBRule to be considered a match. A match indicates that the LBVirtualServer should route the request to the Group (parent of LBRule). +type LBRule struct { + // A list of actions to be executed at specified phase when load balancer rule matches. The actions are used to manipulate application traffic, such as rewrite URI of HTTP messages, redirect HTTP messages, etc. + Actions []*data.StructValue + // A display name useful for identifying an LBRule. + DisplayName *string + // A list of match conditions used to match application traffic. Multiple match conditions can be specified in one load balancer rule, each match condition defines a criterion to match application traffic. If no match conditions are specified, then the load balancer rule will always match and it is used typically to define default rules. If more than one match condition is specified, then match strategy determines if all conditions should match or any one condition should match for the load balancer rule to considered a match. + MatchConditions []*data.StructValue + // Possible values are: + // + // * LBRule#LBRule_MATCH_STRATEGY_ALL + // * LBRule#LBRule_MATCH_STRATEGY_ANY + // + // If more than one match condition is specified, then matching strategy determines if all conditions should match or any one condition should match for the LB Rule to be considered a match. - ALL indicates that both host_match and path_match must match for this LBRule to be considered a match. - ANY indicates that either host_match or patch match may match for this LBRule to be considered a match. + MatchStrategy *string + // Possible values are: + // + // * LBRule#LBRule_PHASE_HTTP_REQUEST_REWRITE + // * LBRule#LBRule_PHASE_HTTP_FORWARDING + // * LBRule#LBRule_PHASE_HTTP_RESPONSE_REWRITE + // * LBRule#LBRule_PHASE_HTTP_ACCESS + // * LBRule#LBRule_PHASE_TRANSPORT + // + // Each load balancer rule is used at a specific phase of load balancer processing. Currently five phases are supported, HTTP_REQUEST_REWRITE, HTTP_FORWARDING, HTTP_RESPONSE_REWRITE, HTTP_ACCESS and TRANSPORT. When an HTTP request message is received by load balancer, all HTTP_REQUEST_REWRITE rules, if present are executed in the order they are applied to virtual server. And then if HTTP_FORWARDING rules present, only first matching rule's action is executed, remaining rules are not checked. HTTP_FORWARDING rules can have only one action. If the request is forwarded to a backend server and the response goes back to load balancer, all HTTP_RESPONSE_REWRITE rules, if present, are executed in the order they are applied to the virtual server. In HTTP_ACCESS phase, user can define action to control access using JWT authentication. In TRANSPORT phase, user can define the condition to match SNI in TLS client hello and define the action to do SSL end-to-end, SSL offloading or SSL passthrough using a specific load balancer server pool. + Phase *string +} +const LBRule_MATCH_STRATEGY_ALL = "ALL" +const LBRule_MATCH_STRATEGY_ANY = "ANY" +const LBRule_PHASE_HTTP_REQUEST_REWRITE = "HTTP_REQUEST_REWRITE" +const LBRule_PHASE_HTTP_FORWARDING = "HTTP_FORWARDING" +const LBRule_PHASE_HTTP_RESPONSE_REWRITE = "HTTP_RESPONSE_REWRITE" +const LBRule_PHASE_HTTP_ACCESS = "HTTP_ACCESS" +const LBRule_PHASE_TRANSPORT = "TRANSPORT" + +func (s LBRule) GetType__() bindings.BindingType { + return LBRuleBindingType() +} + +func (s LBRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Load balancer rule actions are used to manipulate application traffic. Currently load balancer rules can be used at three load balancer processing phases. Each phase has its own supported type of actions. Supported actions in HTTP_REQUST_REWRITE phase are: LBHttpRequestUriRewriteAction LBHttpRequestHeaderRewriteAction LBHttpRequestHeaderDeleteAction LBVariableAssignmentAction Supported actions in HTTP_FORWARDING phase are: LBHttpRejectAction LBHttpRedirectAction LBSelectPoolAction LBVariablePersistenceOnAction LBConnectionDropAction Supported action in HTTP_RESPONSE_REWRITE phase is: LBHttpResponseHeaderRewriteAction LBHttpResponseHeaderDeleteAction LBVariablePersistenceLearnAction Supported action in HTTP_ACCESS phase is: LBJwtAuthAction LBConnectionDropAction LBVariableAssignmentAction Supported action in TRANSPORT phase is: LBSslModeSelectionAction LBSelectPoolAction If the match type of an LBRuleCondition field is specified as REGEX and named capturing groups are used in the specified regular expression. The groups can be used as variables in LBRuleAction fields. For example, define a rule with LBHttpRequestUriCondition as match condition and LBHttpRequestUriRewriteAction as action. Set match_type field of LBHttpRequestUriCondition to REGEX, and set uri field to \"/news/(?<year>\\d+)/(?<month>\\d+)/(?<article>.\*)\". Set uri field of LBHttpRequestUriRewriteAction to: \"/news/$year-$month/$article\" In uri field of LBHttpRequestUriCondition, the (?<year>\\d+), (?<month>\\d+) and (?<article>.\*) are named capturing groups, they define variables named $year, $month and $article respectively. The defined variables are used in LBHttpRequestUriRewriteAction. For a matched HTTP request with URI \"/news/2017/06/xyz.html\", the substring \"2017\" is captured in variable $year, \"06\" is captured in variable $month, and \"xyz.html\" is captured in variable $article. The LBHttpRequestUriRewriteAction will rewrite the URI to: \"/news/2017-06/xyz.html\" A set of built-in variables can be used in LBRuleAction as well. The name of built-in variables start with underscore, the name of user defined variables is not allowed to start with underscore. Following are some of the built-in variables: $_scheme: Reference the scheme part of matched HTTP messages, could be \"http\" or \"https\". $_host: Host of matched HTTP messages, for example \"www.example.com\". $_server_port: Port part of URI, it is also the port of the server which accepted a request. Default port is 80 for http and 443 for https. $_uri: The URI path, for example \"/products/sample.html\". $_request_uri: Full original request URI with arguments, for example, \"/products/sample.html?a=b&c=d\". $_args: URI arguments, for instance \"a=b&c=d\" $_is_args: \"?\" if a request has URI arguments, or an empty string otherwise. For the full list of built-in variables, please reference the NSX-T Administrator's Guide. +type LBRuleAction struct { + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBRuleAction__TYPE_IDENTIFIER = "LBRuleAction" +const LBRuleAction_TYPE_LBSELECTPOOLACTION = "LBSelectPoolAction" +const LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION = "LBHttpRequestUriRewriteAction" +const LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION = "LBHttpRequestHeaderRewriteAction" +const LBRuleAction_TYPE_LBHTTPREJECTACTION = "LBHttpRejectAction" +const LBRuleAction_TYPE_LBHTTPREDIRECTACTION = "LBHttpRedirectAction" +const LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION = "LBHttpResponseHeaderRewriteAction" +const LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION = "LBHttpRequestHeaderDeleteAction" +const LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION = "LBHttpResponseHeaderDeleteAction" +const LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION = "LBVariableAssignmentAction" +const LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION = "LBVariablePersistenceOnAction" +const LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION = "LBVariablePersistenceLearnAction" +const LBRuleAction_TYPE_LBJWTAUTHACTION = "LBJwtAuthAction" +const LBRuleAction_TYPE_LBSSLMODESELECTIONACTION = "LBSslModeSelectionAction" +const LBRuleAction_TYPE_LBCONNECTIONDROPACTION = "LBConnectionDropAction" + +func (s LBRuleAction) GetType__() bindings.BindingType { + return LBRuleActionBindingType() +} + +func (s LBRuleAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBRuleAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Match conditions are used to match application traffic passing through load balancers. Multiple match conditions can be specified in one load balancer rule, each match condition defines a criterion for application traffic. If inverse field is set to true, the match result of the condition is inverted. If more than one match condition is specified, match strategy determines if all conditions should match or any one condition should match for the load balancer rule to be considered a match. Currently only HTTP messages are supported by load balancer rules. Each load balancer rule is used at a specific phase of load balancer processing. Currently three phases are supported, HTTP_REQUEST_REWRITE, HTTP_FORWARDING and HTTP_RESPONSE_REWRITE. Each phase supports certain types of match conditions, supported match conditions in HTTP_REQUEST_REWRITE phase are: LBHttpRequestMethodCondition LBHttpRequestUriCondition LBHttpRequestUriArgumentsCondition LBHttpRequestVersionCondition LBHttpRequestHeaderCondition LBHttpRequestCookieCondition LBHttpRequestBodyCondition LBTcpHeaderCondition LBIpHeaderCondition LBVariableCondition LBHttpSslCondition Supported match conditions in HTTP_FORWARDING phase are: LBHttpRequestMethodCondition LBHttpRequestUriCondition LBHttpRequestUriArgumentsCondition LBHttpRequestVersionCondition LBHttpRequestHeaderCondition LBHttpRequestCookieCondition LBHttpRequestBodyCondition LBTcpHeaderCondition LBIpHeaderCondition LBVariableCondition LBHttpSslCondition LBSslSniCondition Supported match conditions in HTTP_RESPONSE_REWRITE phase are: LBHttpResponseHeaderCondition LBHttpRequestMethodCondition LBHttpRequestUriCondition LBHttpRequestUriArgumentsCondition LBHttpRequestVersionCondition LBHttpRequestHeaderCondition LBHttpRequestCookieCondition LBTcpHeaderCondition LBIpHeaderCondition LBVariableCondition LBHttpSslCondition Supported match condition in HTTP_ACCESS phase is: LBHttpRequestMethodCondition LBHttpRequestUriCondition LBHttpRequestUriArgumentsCondition LBHttpRequestVersionCondition LBHttpRequestHeaderCondition LBHttpRequestCookieCondition LBHttpRequestBodyCondition LBTcpHeaderCondition LBIpHeaderCondition LBVariableCondition LBHttpSslCondition Supported match condition in TRANSPORT phase is: LBSslSniCondition +type LBRuleCondition struct { + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBRuleCondition__TYPE_IDENTIFIER = "LBRuleCondition" +const LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION = "LBHttpRequestUriCondition" +const LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION = "LBHttpRequestHeaderCondition" +const LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION = "LBHttpRequestMethodCondition" +const LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION = "LBHttpRequestUriArgumentsCondition" +const LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION = "LBHttpRequestVersionCondition" +const LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION = "LBHttpRequestCookieCondition" +const LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION = "LBHttpRequestBodyCondition" +const LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION = "LBHttpResponseHeaderCondition" +const LBRuleCondition_TYPE_LBTCPHEADERCONDITION = "LBTcpHeaderCondition" +const LBRuleCondition_TYPE_LBIPHEADERCONDITION = "LBIpHeaderCondition" +const LBRuleCondition_TYPE_LBVARIABLECONDITION = "LBVariableCondition" +const LBRuleCondition_TYPE_LBHTTPSSLCONDITION = "LBHttpSslCondition" +const LBRuleCondition_TYPE_LBSSLSNICONDITION = "LBSslSniCondition" + +func (s LBRuleCondition) GetType__() bindings.BindingType { + return LBRuleConditionBindingType() +} + +func (s LBRuleCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBRuleCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to select a pool for matched HTTP request messages. The pool is specified by path. The matched HTTP request messages are forwarded to the specified pool. +type LBSelectPoolAction struct { + // Path of load balancer pool. + PoolId *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSelectPoolAction__TYPE_IDENTIFIER = "LBSelectPoolAction" + +func (s LBSelectPoolAction) GetType__() bindings.BindingType { + return LBSelectPoolActionBindingType() +} + +func (s LBSelectPoolAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSelectPoolAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Server SSL profile. +type LBServerSslProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * LBServerSslProfile#LBServerSslProfile_CIPHER_GROUP_LABEL_BALANCED + // * LBServerSslProfile#LBServerSslProfile_CIPHER_GROUP_LABEL_HIGH_SECURITY + // * LBServerSslProfile#LBServerSslProfile_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY + // * LBServerSslProfile#LBServerSslProfile_CIPHER_GROUP_LABEL_CUSTOM + // + // It is a label of cipher group which is mostly consumed by GUI. + CipherGroupLabel *string + // Possible values are: + // + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LBServerSslProfile#LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // Supported SSL cipher list to client side. + Ciphers []string + // This flag is set to true when all the ciphers and protocols are FIPS compliant. It is set to false when one of the ciphers or protocols are not FIPS compliant. + IsFips *bool + // This flag is set to true when all the ciphers and protocols are secure. It is set to false when one of the ciphers or protocols is insecure. + IsSecure *bool + // Possible values are: + // + // * LBServerSslProfile#LBServerSslProfile_PROTOCOLS_SSL_V2 + // * LBServerSslProfile#LBServerSslProfile_PROTOCOLS_SSL_V3 + // * LBServerSslProfile#LBServerSslProfile_PROTOCOLS_TLS_V1 + // * LBServerSslProfile#LBServerSslProfile_PROTOCOLS_TLS_V1_1 + // * LBServerSslProfile#LBServerSslProfile_PROTOCOLS_TLS_V1_2 + // + // SSL versions TLS1.1 and TLS1.2 are supported and enabled by default. SSLv2, SSLv3, and TLS1.0 are supported, but disabled by default. + Protocols []string + // SSL session caching allows SSL client and server to reuse previously negotiated security parameters avoiding the expensive public key operation during handshake. + SessionCacheEnabled *bool +} +const LBServerSslProfile_CIPHER_GROUP_LABEL_BALANCED = "BALANCED" +const LBServerSslProfile_CIPHER_GROUP_LABEL_HIGH_SECURITY = "HIGH_SECURITY" +const LBServerSslProfile_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY = "HIGH_COMPATIBILITY" +const LBServerSslProfile_CIPHER_GROUP_LABEL_CUSTOM = "CUSTOM" +const LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LBServerSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LBServerSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LBServerSslProfile_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LBServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LBServerSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LBServerSslProfile_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LBServerSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LBServerSslProfile_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LBServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LBServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LBServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" +const LBServerSslProfile_PROTOCOLS_SSL_V2 = "SSL_V2" +const LBServerSslProfile_PROTOCOLS_SSL_V3 = "SSL_V3" +const LBServerSslProfile_PROTOCOLS_TLS_V1 = "TLS_V1" +const LBServerSslProfile_PROTOCOLS_TLS_V1_1 = "TLS_V1_1" +const LBServerSslProfile_PROTOCOLS_TLS_V1_2 = "TLS_V1_2" + +func (s LBServerSslProfile) GetType__() bindings.BindingType { + return LBServerSslProfileBindingType() +} + +func (s LBServerSslProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBServerSslProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Server SSL profile binding. +type LBServerSslProfileBinding struct { + // Authentication depth is used to set the verification depth in the server certificates chain. format: int64 + CertificateChainDepth *int64 + // To support client authentication (load balancer acting as a client authenticating to the backend server), client certificate can be specified in the server-side SSL profile binding + ClientCertificatePath *string + // Possible values are: + // + // * LBServerSslProfileBinding#LBServerSslProfileBinding_SERVER_AUTH_REQUIRED + // * LBServerSslProfileBinding#LBServerSslProfileBinding_SERVER_AUTH_IGNORE + // * LBServerSslProfileBinding#LBServerSslProfileBinding_SERVER_AUTH_AUTO_APPLY + // + // Server authentication mode. + ServerAuth *string + // If server auth type is REQUIRED, server certificate must be signed by one of the trusted Certificate Authorities (CAs), also referred to as root CAs, whose self signed certificates are specified. + ServerAuthCaPaths []string + // A Certificate Revocation List (CRL) can be specified in the server-side SSL profile binding to disallow compromised server certificates. + ServerAuthCrlPaths []string + // Server SSL profile defines reusable, application-independent server side SSL properties. + SslProfilePath *string +} +const LBServerSslProfileBinding_SERVER_AUTH_REQUIRED = "REQUIRED" +const LBServerSslProfileBinding_SERVER_AUTH_IGNORE = "IGNORE" +const LBServerSslProfileBinding_SERVER_AUTH_AUTO_APPLY = "AUTO_APPLY" + +func (s LBServerSslProfileBinding) GetType__() bindings.BindingType { + return LBServerSslProfileBindingBindingType() +} + +func (s LBServerSslProfileBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBServerSslProfileBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Loadbalancer Service. +type LBService struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Flag to enable access log + AccessLogEnabled *bool + // LBS could be instantiated (or created) on the Tier-1, etc. For now, only the Tier-1 object is supported. + ConnectivityPath *string + // Flag to enable the load balancer service. + Enabled *bool + // Possible values are: + // + // * LBService#LBService_ERROR_LOG_LEVEL_DEBUG + // * LBService#LBService_ERROR_LOG_LEVEL_INFO + // * LBService#LBService_ERROR_LOG_LEVEL_WARNING + // * LBService#LBService_ERROR_LOG_LEVEL_ERROR + // * LBService#LBService_ERROR_LOG_LEVEL_CRITICAL + // * LBService#LBService_ERROR_LOG_LEVEL_ALERT + // * LBService#LBService_ERROR_LOG_LEVEL_EMERGENCY + // + // Load balancer engine writes information about encountered issues of different severity levels to the error log. This setting is used to define the severity level of the error log. + ErrorLogLevel *string + // If relax_scale_validation is true, the scale validations for virtual servers/pools/pool members/rules are relaxed for load balancer service. When load balancer service is deployed on edge nodes, the scale of virtual servers/pools/pool members for the load balancer service should not exceed the scale number of the largest load balancer size which could be configured on a certain edge form factor. For example, the largest load balancer size supported on a MEDIUM edge node is MEDIUM. So one SMALL load balancer deployed on MEDIUM edge nodes can support the scale number of MEDIUM load balancer. It is not recommended to enable active monitors if relax_scale_validation is true due to performance consideration. If relax_scale_validation is false, scale numbers should be validated for load balancer service. + RelaxScaleValidation *bool + // Possible values are: + // + // * LBService#LBService_SIZE_SMALL + // * LBService#LBService_SIZE_MEDIUM + // * LBService#LBService_SIZE_LARGE + // * LBService#LBService_SIZE_XLARGE + // * LBService#LBService_SIZE_DLB + // + // Load balancer service size. + Size *string +} +const LBService_ERROR_LOG_LEVEL_DEBUG = "DEBUG" +const LBService_ERROR_LOG_LEVEL_INFO = "INFO" +const LBService_ERROR_LOG_LEVEL_WARNING = "WARNING" +const LBService_ERROR_LOG_LEVEL_ERROR = "ERROR" +const LBService_ERROR_LOG_LEVEL_CRITICAL = "CRITICAL" +const LBService_ERROR_LOG_LEVEL_ALERT = "ALERT" +const LBService_ERROR_LOG_LEVEL_EMERGENCY = "EMERGENCY" +const LBService_SIZE_SMALL = "SMALL" +const LBService_SIZE_MEDIUM = "MEDIUM" +const LBService_SIZE_LARGE = "LARGE" +const LBService_SIZE_XLARGE = "XLARGE" +const LBService_SIZE_DLB = "DLB" + +func (s LBService) GetType__() bindings.BindingType { + return LBServiceBindingType() +} + +func (s LBService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Session cookie time. +type LBSessionCookieTime struct { + // Instead of using HTTP Cookie max-age and relying on client to expire the cookie, max idle time and/or max lifetime of the cookie can be used. Max idle time, if configured, specifies the maximum interval the cookie is valid for from the last time it was seen in a request. It is available for insert mode. format: int64 + CookieMaxIdle *int64 + // Max life time, if configured, specifies the maximum interval the cookie is valid for from the first time the cookie was seen in a request. It is available for insert mode. format: int64 + CookieMaxLife *int64 + // Possible values are: + // + // * LBCookieTime#LBCookieTime_TYPE_LBSESSIONCOOKIETIME + // * LBCookieTime#LBCookieTime_TYPE_LBPERSISTENCECOOKIETIME + // + // Both session cookie and persistence cookie are supported, Use LbSessionCookieTime for session cookie time setting, Use LbPersistenceCookieTime for persistence cookie time setting + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSessionCookieTime__TYPE_IDENTIFIER = "LBSessionCookieTime" + +func (s LBSessionCookieTime) GetType__() bindings.BindingType { + return LBSessionCookieTimeBindingType() +} + +func (s LBSessionCookieTime) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSessionCookieTime._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Snat auto map. +type LBSnatAutoMap struct { + // Possible values are: + // + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATAUTOMAP + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATIPPOOL + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATDISABLED + // + // Snat translation type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSnatAutoMap__TYPE_IDENTIFIER = "LBSnatAutoMap" + +func (s LBSnatAutoMap) GetType__() bindings.BindingType { + return LBSnatAutoMapBindingType() +} + +func (s LBSnatAutoMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSnatAutoMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Snat disabled. +type LBSnatDisabled struct { + // Possible values are: + // + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATAUTOMAP + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATIPPOOL + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATDISABLED + // + // Snat translation type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSnatDisabled__TYPE_IDENTIFIER = "LBSnatDisabled" + +func (s LBSnatDisabled) GetType__() bindings.BindingType { + return LBSnatDisabledBindingType() +} + +func (s LBSnatDisabled) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSnatDisabled._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Snat Ip element. +type LBSnatIpElement struct { + // Ip address or ip range such as 1.1.1.1 or 1.1.1.101-1.1.1.160. format: address-or-block-or-range + IpAddress *string + // Subnet prefix length should be not specified if there is only one single IP address or IP range. format: int64 + PrefixLength *int64 +} + +func (s LBSnatIpElement) GetType__() bindings.BindingType { + return LBSnatIpElementBindingType() +} + +func (s LBSnatIpElement) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSnatIpElement._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Snat Ip pool. +type LBSnatIpPool struct { + // If an IP range is specified, the range may contain no more than 64 IP addresses. + IpAddresses []LBSnatIpElement + // Possible values are: + // + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATAUTOMAP + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATIPPOOL + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATDISABLED + // + // Snat translation type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSnatIpPool__TYPE_IDENTIFIER = "LBSnatIpPool" + +func (s LBSnatIpPool) GetType__() bindings.BindingType { + return LBSnatIpPoolBindingType() +} + +func (s LBSnatIpPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSnatIpPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Snat Translation. +type LBSnatTranslation struct { + // Possible values are: + // + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATAUTOMAP + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATIPPOOL + // * LBSnatTranslation#LBSnatTranslation_TYPE_LBSNATDISABLED + // + // Snat translation type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSnatTranslation__TYPE_IDENTIFIER = "LBSnatTranslation" +const LBSnatTranslation_TYPE_LBSNATAUTOMAP = "LBSnatAutoMap" +const LBSnatTranslation_TYPE_LBSNATIPPOOL = "LBSnatIpPool" +const LBSnatTranslation_TYPE_LBSNATDISABLED = "LBSnatDisabled" + +func (s LBSnatTranslation) GetType__() bindings.BindingType { + return LBSnatTranslationBindingType() +} + +func (s LBSnatTranslation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSnatTranslation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence is enabled on a LBVirtualServer by binding a persistence profile to it. +type LBSourceIpPersistenceProfile struct { + // Persistence entries are not synchronized to the HA peer by default. + HaPersistenceMirroringEnabled *bool + // Possible values are: + // + // * LBSourceIpPersistenceProfile#LBSourceIpPersistenceProfile_PURGE_NO_PURGE + // * LBSourceIpPersistenceProfile#LBSourceIpPersistenceProfile_PURGE_FULL + // + // Persistence purge setting. + Purge *string + // When all connections complete (reference count reaches 0), persistence entry timer is started with the expiration time. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE + // * LBPersistenceProfile#LBPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE + // + // The resource_type property identifies persistence profile type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Persistence shared setting indicates that all LBVirtualServers that consume this LBPersistenceProfile should share the same persistence mechanism when enabled. Meaning, persistence entries of a client accessing one virtual server will also affect the same client's connections to a different virtual server. For example, say there are two virtual servers vip-ip1:80 and vip-ip1:8080 bound to the same Group g1 consisting of two servers (s11:80 and s12:80). By default, each virtual server will have its own persistence table or cookie. So, in the earlier example, there will be two tables (vip-ip1:80, p1) and (vip-ip1:8080, p1) or cookies. So, if a client connects to vip1:80 and later connects to vip1:8080, the second connection may be sent to a different server than the first. When persistence_shared is enabled, then the second connection will always connect to the same server as the original connection. For COOKIE persistence type, the same cookie will be shared by multiple virtual servers. For SOURCE_IP persistence type, the persistence table will be shared across virtual servers. For GENERIC persistence type, the persistence table will be shared across virtual servers which consume the same persistence profile in LBRule actions. + PersistenceShared *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSourceIpPersistenceProfile__TYPE_IDENTIFIER = "LBSourceIpPersistenceProfile" +const LBSourceIpPersistenceProfile_PURGE_NO_PURGE = "NO_PURGE" +const LBSourceIpPersistenceProfile_PURGE_FULL = "FULL" + +func (s LBSourceIpPersistenceProfile) GetType__() bindings.BindingType { + return LBSourceIpPersistenceProfileBindingType() +} + +func (s LBSourceIpPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSourceIpPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to select SSL mode. Three types of SSL mode actions can be specified in Transport phase, ssl passthrough, ssl offloading and ssl end-to-end. +type LBSslModeSelectionAction struct { + // Possible values are: + // + // * LBSslModeSelectionAction#LBSslModeSelectionAction_SSL_MODE_PASSTHROUGH + // * LBSslModeSelectionAction#LBSslModeSelectionAction_SSL_MODE_END_TO_END + // * LBSslModeSelectionAction#LBSslModeSelectionAction_SSL_MODE_OFFLOAD + // + // SSL Passthrough: LB establishes a TCP connection with client and another connection with selected backend server. LB won't inspect the stream data between client and backend server, but just pass it through. Backend server exchanges SSL connection with client. SSL Offloading: LB terminiates the connections from client, and establishes SSL connection with it. After receiving the HTTP request, LB connects the selected backend server and talk with it via HTTP without SSL. LB estalishes new connection to selected backend server for each HTTP request, in case ntlm or multiplexing are NOT configured. SSL End-to-End: LB terminiates the connections from client, and establishes SSL connection with it. After receiving the HTTP request, LB connects the selected backend server and talk with it via HTTPS. LB estalishes new SSL connection to selected backend server for each HTTP request, in case ntlm or multiplexing are NOT configured. + SslMode *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSslModeSelectionAction__TYPE_IDENTIFIER = "LBSslModeSelectionAction" +const LBSslModeSelectionAction_SSL_MODE_PASSTHROUGH = "SSL_PASSTHROUGH" +const LBSslModeSelectionAction_SSL_MODE_END_TO_END = "SSL_END_TO_END" +const LBSslModeSelectionAction_SSL_MODE_OFFLOAD = "SSL_OFFLOAD" + +func (s LBSslModeSelectionAction) GetType__() bindings.BindingType { + return LBSslModeSelectionActionBindingType() +} + +func (s LBSslModeSelectionAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSslModeSelectionAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Load balancer abstract SSL profile. +type LBSslProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s LBSslProfile) GetType__() bindings.BindingType { + return LBSslProfileBindingType() +} + +func (s LBSslProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSslProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match SSL SNI in client hello. This condition is only supported in TRANSPORT phase. Only if virtual server is associated with client SSL profile, matching SNI condition in transport phase is available to be configured. +type LBSslSniCondition struct { + // If true, case is significant when comparing SNI value. + CaseSensitive *bool + // Possible values are: + // + // * LBSslSniCondition#LBSslSniCondition_MATCH_TYPE_STARTS_WITH + // * LBSslSniCondition#LBSslSniCondition_MATCH_TYPE_ENDS_WITH + // * LBSslSniCondition#LBSslSniCondition_MATCH_TYPE_EQUALS + // * LBSslSniCondition#LBSslSniCondition_MATCH_TYPE_CONTAINS + // * LBSslSniCondition#LBSslSniCondition_MATCH_TYPE_REGEX + // + // Match type of SNI + MatchType *string + // The SNI(Server Name indication) in client hello message. + Sni *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBSslSniCondition__TYPE_IDENTIFIER = "LBSslSniCondition" +const LBSslSniCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBSslSniCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBSslSniCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBSslSniCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBSslSniCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBSslSniCondition) GetType__() bindings.BindingType { + return LBSslSniConditionBindingType() +} + +func (s LBSslSniCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBSslSniCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match TCP header fields of HTTP messages. Currently, only the TCP source port is supported. Ports can be expressed as a single port number like 80, or a port range like 1024-1030. +type LBTcpHeaderCondition struct { + // TCP source port of HTTP message format: port-or-range + SourcePort *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBTcpHeaderCondition__TYPE_IDENTIFIER = "LBTcpHeaderCondition" + +func (s LBTcpHeaderCondition) GetType__() bindings.BindingType { + return LBTcpHeaderConditionBindingType() +} + +func (s LBTcpHeaderCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBTcpHeaderCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the LBRule object. This represents active health monitoring over TCP. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healthchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type LBTcpMonitorProfile struct { + // Expected data, if specified, can be anywhere in the response and it has to be a string, regular expressions are not supported. + Receive *string + // If both send and receive are not specified, then just a TCP connection is established (3-way handshake) to validate server is healthy, no data is sent. + Send *string + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. For ICMP monitor, monitor_port is not required. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE + // + // There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s LBTcpMonitorProfile) GetType__() bindings.BindingType { + return LBTcpMonitorProfileBindingType() +} + +func (s LBTcpMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBTcpMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the LBRule object. This represents active health monitoring over UDP. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healthchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type LBUdpMonitorProfile struct { + // Expected data, can be anywhere in the response and it has to be a string, regular expressions are not supported. UDP healthcheck is considered failed if there is no server response within the timeout period. + Receive *string + // The data to be sent to the monitored server. + Send *string + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. For ICMP monitor, monitor_port is not required. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBTCPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBUDPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBICMPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBHTTPSMONITORPROFILE + // * LBMonitorProfile#LBMonitorProfile_RESOURCE_TYPE_LBPASSIVEMONITORPROFILE + // + // There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s LBUdpMonitorProfile) GetType__() bindings.BindingType { + return LBUdpMonitorProfileBindingType() +} + +func (s LBUdpMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBUdpMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is used to create a new variable and assign value to it. One action can be used to create one variable. To create multiple variables, multiple actions must be defined. The variables can be used by LBVariableCondition, etc. +type LBVariableAssignmentAction struct { + // Name of the variable to be assigned. + VariableName *string + // Value of variable. + VariableValue *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBVariableAssignmentAction__TYPE_IDENTIFIER = "LBVariableAssignmentAction" + +func (s LBVariableAssignmentAction) GetType__() bindings.BindingType { + return LBVariableAssignmentActionBindingType() +} + +func (s LBVariableAssignmentAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBVariableAssignmentAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This condition is used to match variable's name and value at all phases. The variables could be captured from REGEX or assigned by LBVariableAssignmentAction or system embedded variable. Varialbe_name and variable_value should be matched at the same time. +type LBVariableCondition struct { + // If true, case is significant when comparing variable value. + CaseSensitive *bool + // Possible values are: + // + // * LBVariableCondition#LBVariableCondition_MATCH_TYPE_STARTS_WITH + // * LBVariableCondition#LBVariableCondition_MATCH_TYPE_ENDS_WITH + // * LBVariableCondition#LBVariableCondition_MATCH_TYPE_EQUALS + // * LBVariableCondition#LBVariableCondition_MATCH_TYPE_CONTAINS + // * LBVariableCondition#LBVariableCondition_MATCH_TYPE_REGEX + // + // Match type of variable value + MatchType *string + // Name of the variable to be matched + VariableName *string + // Value of variable to be matched + VariableValue *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBIPHEADERCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBVARIABLECONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LBRuleCondition#LBRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBVariableCondition__TYPE_IDENTIFIER = "LBVariableCondition" +const LBVariableCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LBVariableCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LBVariableCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LBVariableCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LBVariableCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s LBVariableCondition) GetType__() bindings.BindingType { + return LBVariableConditionBindingType() +} + +func (s LBVariableCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBVariableCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is performed in HTTP response rewrite phase. It is used to learn the value of variable from the HTTP response, and insert an entry into the persistence table if the entry doesn't exist. +type LBVariablePersistenceLearnAction struct { + // If the persistence profile path is not specified, a default persistence table is created per virtual server. Currently, only LBGenericPersistenceProfile is supported. + PersistenceProfilePath *string + // The property is used to enable a hash operation for variable value when composing the persistence key. + VariableHashEnabled *bool + // The property is the name of variable to be learnt. It is used to identify which variable's value is learnt from HTTP response. The variable can be a built-in variable such as \"_cookie_JSESSIONID\", a customized variable defined in LBVariableAssignmentAction or a captured variable in regular expression such as \"article\". For the full list of built-in variables, please reference the NSX-T Administrator's Guide. + VariableName *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBVariablePersistenceLearnAction__TYPE_IDENTIFIER = "LBVariablePersistenceLearnAction" + +func (s LBVariablePersistenceLearnAction) GetType__() bindings.BindingType { + return LBVariablePersistenceLearnActionBindingType() +} + +func (s LBVariablePersistenceLearnAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBVariablePersistenceLearnAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This action is performed in HTTP forwarding phase. It is used to inspect the variable of HTTP request, and look up the persistence entry with its value and pool uuid as key. If the persistence entry is found, the HTTP request is forwarded to the recorded backend server according to the persistence entry. If the persistence entry is not found, a new entry is created in the table after backend server is selected. +type LBVariablePersistenceOnAction struct { + // If the persistence profile path is not specified, a default persistence table is created per virtual server. Currently, only LBGenericPersistenceProfile is supported. + PersistenceProfilePath *string + // The property is used to enable a hash operation for variable value when composing the persistence key. + VariableHashEnabled *bool + // The property is the name of variable to be used. It specifies which variable's value of a HTTP Request will be used in the key of persistence entry. The variable can be a built-in variable such as \"_cookie_JSESSIONID\", a customized variable defined in LBVariableAssignmentAction or a captured variable in regular expression such as \"article\". For the full list of built-in variables, please reference the NSX-T Administrator's Guide. + VariableName *string + // Possible values are: + // + // * LBRuleAction#LBRuleAction_TYPE_LBSELECTPOOLACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREJECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LBRuleAction#LBRuleAction_TYPE_LBJWTAUTHACTION + // * LBRuleAction#LBRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LBRuleAction#LBRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LBVariablePersistenceOnAction__TYPE_IDENTIFIER = "LBVariablePersistenceOnAction" + +func (s LBVariablePersistenceOnAction) GetType__() bindings.BindingType { + return LBVariablePersistenceOnActionBindingType() +} + +func (s LBVariablePersistenceOnAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBVariablePersistenceOnAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// All the types of LBVirtualServer extend from this abstract class. This is present for extensibility. +type LBVirtualServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Specifies the access list control to define how to filter the connections from clients. + AccessListControl *LBAccessListControl + // If access log is enabled, all HTTP requests sent to L7 virtual server are logged to the access log file. Both successful returns information responses(1xx), successful responses(2xx), redirection messages(3xx) and unsuccessful requests, backend server returns 4xx or 5xx, are logged to access log, if enabled. All L4 virtual server connections are also logged to the access log if enabled. The non-significant events such as successful requests are not logged if log_significant_event_only is set to true. + AccessLogEnabled *bool + // The application profile defines the application protocol characteristics. It is used to influence how load balancing is performed. Currently, LBFastTCPProfile, LBFastUDPProfile and LBHttpProfile, etc are supported. + ApplicationProfilePath *string + // The setting is used when load balancer acts as an SSL server and terminating the client SSL connection + ClientSslProfileBinding *LBClientSslProfileBinding + // Default pool member ports when member port is not defined. format: port-or-range + DefaultPoolMemberPorts []string + // Flag to enable the load balancer virtual server. + Enabled *bool + // Configures the IP address of the LBVirtualServer where it receives all client connections and distributes them among the backend servers. format: ip + IpAddress *string + // Path to optional object that enables persistence on a virtual server allowing related client connections to be sent to the same backend server. Persistence is disabled by default. + LbPersistenceProfilePath *string + // virtual servers can be associated to LBService(which is similar to physical/virtual load balancer), LB virtual servers, pools and other entities could be defined independently, the LBService identifier list here would be used to maintain the relationship of LBService and other LB entities. + LbServicePath *string + // The property log_significant_event_only can take effect only when access_log_enabled is true. If log_significant_event_only is true, significant events are logged in access log. For L4 virtual server, significant event means unsuccessful(error or dropped) TCP/UDP connections. For L7 virtual server, significant event means unsuccessful connections or HTTP/HTTPS requests which have error response code(e.g. 4xx, 5xx). + LogSignificantEventOnly *bool + // To ensure one virtual server does not over consume resources, affecting other applications hosted on the same LBS, connections to a virtual server can be capped. If it is not specified, it means that connections are unlimited. format: int64 + MaxConcurrentConnections *int64 + // To ensure one virtual server does not over consume resources, connections to a member can be rate limited. If it is not specified, it means that connection rate is unlimited. format: int64 + MaxNewConnectionRate *int64 + // The server pool(LBPool) contains backend servers. Server pool consists of one or more servers, also referred to as pool members, that are similarly configured and are running the same application. + PoolPath *string + // Ports contains a list of at least one port or port range such as \"80\", \"1234-1236\". Each port element in the list should be a single port or a single port range. format: port-or-range + Ports []string + // Load balancer rules allow customization of load balancing behavior using match/action rules. Currently, load balancer rules are supported for only layer 7 virtual servers with LBHttpProfile. + Rules []LBRule + // The setting is used when load balancer acts as an SSL client and establishing a connection to the backend server. + ServerSslProfileBinding *LBServerSslProfileBinding + // When load balancer can not select a backend server to serve the request in default pool or pool in rules, the request would be served by sorry server pool. + SorryPoolPath *string +} + +func (s LBVirtualServer) GetType__() bindings.BindingType { + return LBVirtualServerBindingType() +} + +func (s LBVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LBVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Label that will be displayed for a UI element. +type Label struct { + // If the condition is met then the label will be applied. Examples of expression syntax are provided under example_request section of CreateWidgetConfiguration API. + Condition *string + // If true, displays the label only on hover + Hover *bool + // Icons to be applied at dashboard for the label + Icons []Icon + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Text to be displayed at the label. + Text *string +} + +func (s Label) GetType__() bindings.BindingType { + return LabelBindingType() +} + +func (s Label) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Label._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a Label-Value widget configuration +type LabelValueConfiguration struct { + // Layout of properties can be vertical or grid. If layout is not specified a default vertical layout is applied. + Layout *Layout + // Hyperlink of the specified UI page that provides details. + Navigation *string + // An array of label-value properties. + Properties []PropertyItem + // Possible values are: + // + // * LabelValueConfiguration#LabelValueConfiguration_SUB_TYPE_ALIGNED + // + // A sub-type of LabelValueConfiguration. If sub-type is not specified the parent type is rendered. For VERTICALLY_ALIGNED sub_type, the value is placed below the label. + SubType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LabelValueConfiguration__TYPE_IDENTIFIER = "LabelValueConfiguration" +const LabelValueConfiguration_SUB_TYPE_ALIGNED = "VERTICALLY_ALIGNED" + +func (s LabelValueConfiguration) GetType__() bindings.BindingType { + return LabelValueConfigurationBindingType() +} + +func (s LabelValueConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LabelValueConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LacpGroupConfigInfo struct { + // The key represents the identifier for the group that is unique across VC. + Key *string + // Load balance algorithm used in LACP group. The possible values are dictated by the values available in VC. Please refer VMwareDvsLacpLoadBalanceAlgorithm documentation for a full list of values. A few examples are srcDestIp where source and destination IP are considered, srcIp where only source IP is considered. + LoadBalanceAlgorithm *string + // Possible values are: + // + // * LacpGroupConfigInfo#LacpGroupConfigInfo_MODE_ACTIVE + // * LacpGroupConfigInfo#LacpGroupConfigInfo_MODE_PASSIVE + // + // The mode of LACP can be ACTIVE or PASSIVE. If the mode is ACTIVE, LACP is enabled unconditionally. If the mode is PASSIVE, LACP is enabled only if LACP device is detected. + Mode *string + // The display name of the LACP group. + Name *string + // Names for the uplink ports in the group. + UplinkNames []string + // The number of uplink ports format: int64 + UplinkNum *int64 + // Keys for the uplink ports in the group. Each uplink port is assigned a key that is unique across VC. + UplinkPortKeys []string +} +const LacpGroupConfigInfo_MODE_ACTIVE = "ACTIVE" +const LacpGroupConfigInfo_MODE_PASSIVE = "PASSIVE" + +func (s LacpGroupConfigInfo) GetType__() bindings.BindingType { + return LacpGroupConfigInfoBindingType() +} + +func (s LacpGroupConfigInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LacpGroupConfigInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents layout of a container or widget +type Layout struct { + Properties *LayoutProperties + // Possible values are: + // + // * Layout#Layout_TYPE_HORIZONTAL + // * Layout#Layout_TYPE_VERTICAL + // * Layout#Layout_TYPE_GRID + // + // Describes layout of a container or widget. Layout describes how individual widgets are placed inside the container. For example, if HORIZONTAL is chosen widgets are placed side by side inside the container. If VERTICAL is chosen then widgets are placed one below the other. If GRID is chosen then the container or widget display area is divided into a grid of m rows and n columns, as specified in the properties, and the widgets are placed inside the grid. + Type_ *string +} +const Layout_TYPE_HORIZONTAL = "HORIZONTAL" +const Layout_TYPE_VERTICAL = "VERTICAL" +const Layout_TYPE_GRID = "GRID" + +func (s Layout) GetType__() bindings.BindingType { + return LayoutBindingType() +} + +func (s Layout) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Layout._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Properties of the layout of a container or widget +type LayoutProperties struct { + // Describes the number of columns of grid layout of a container or widget. This property is applicable for grid layout only. format: int32 + NumColumns *int64 + // Describes the number of rows of grid layout of a container or widget. This property is applicable for grid layout only. format: int32 + NumRows *int64 +} + +func (s LayoutProperties) GetType__() bindings.BindingType { + return LayoutPropertiesBindingType() +} + +func (s LayoutProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LayoutProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LbHttpRequestHeader struct { + // Name of HTTP request header + HeaderName *string + // Value of HTTP request header + HeaderValue *string +} + +func (s LbHttpRequestHeader) GetType__() bindings.BindingType { + return LbHttpRequestHeaderBindingType() +} + +func (s LbHttpRequestHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This is the base type for all identity sources that use LDAP for authentication and group membership. +type LdapIdentitySource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LdapIdentitySource#LdapIdentitySource_RESOURCE_TYPE_ACTIVEDIRECTORYIDENTITYSOURCE + // * LdapIdentitySource#LdapIdentitySource_RESOURCE_TYPE_OPENLDAPIDENTITYSOURCE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The subtree of the LDAP identity source to search when locating users and groups. + BaseDn *string + // The name of the authentication domain. When users log into NSX using an identity of the form \"user\\\\@domain\", NSX uses the domain portion to determine which LDAP identity source to use. For Active Directory, this domain name must match the domain of the Active Directory. + DomainName *string + // The list of LDAP servers that provide LDAP service for this identity source. Currently, only one LDAP server is supported. + LdapServers []IdentitySourceLdapServer +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LdapIdentitySource__TYPE_IDENTIFIER = "LdapIdentitySource" +const LdapIdentitySource_RESOURCE_TYPE_ACTIVEDIRECTORYIDENTITYSOURCE = "ActiveDirectoryIdentitySource" +const LdapIdentitySource_RESOURCE_TYPE_OPENLDAPIDENTITYSOURCE = "OpenLdapIdentitySource" + +func (s LdapIdentitySource) GetType__() bindings.BindingType { + return LdapIdentitySourceBindingType() +} + +func (s LdapIdentitySource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LdapIdentitySource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The results of listing LDAP identity sources. +type LdapIdentitySourceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + Results []*data.StructValue +} + +func (s LdapIdentitySourceListResult) GetType__() bindings.BindingType { + return LdapIdentitySourceListResultBindingType() +} + +func (s LdapIdentitySourceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LdapIdentitySourceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Results from probing all LDAP servers in an LDAP identity source configuration. +type LdapIdentitySourceProbeResults struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Probe results for all probed LDAP servers. + Results []IdentitySourceLdapServerProbeResult +} + +func (s LdapIdentitySourceProbeResults) GetType__() bindings.BindingType { + return LdapIdentitySourceProbeResultsBindingType() +} + +func (s LdapIdentitySourceProbeResults) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LdapIdentitySourceProbeResults._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LdapIdentitySourceSearchResultItem struct { + // The Common Name (CN) of the entry, if available. + CommonName *string + // Distinguished name (DN) of the entry. + Dn *string + // For Active Directory (AD) users, this will be the user principal name (UPN), in the format user\\\\@domain. For non-AD users, this will be the user's uid property, followed by \"\\\\@\" and the domain of the directory. For groups, this will be the group's common name, followed by \"\\\\@\" and the domain of the directory. + PrincipalName *string + // Possible values are: + // + // * LdapIdentitySourceSearchResultItem#LdapIdentitySourceSearchResultItem_TYPE_USER + // * LdapIdentitySourceSearchResultItem#LdapIdentitySourceSearchResultItem_TYPE_GROUP + // + // Describes the type of the entry + Type_ *string +} +const LdapIdentitySourceSearchResultItem_TYPE_USER = "USER" +const LdapIdentitySourceSearchResultItem_TYPE_GROUP = "GROUP" + +func (s LdapIdentitySourceSearchResultItem) GetType__() bindings.BindingType { + return LdapIdentitySourceSearchResultItemBindingType() +} + +func (s LdapIdentitySourceSearchResultItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LdapIdentitySourceSearchResultItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A list of LDA entries returned from a search of an LDAP identity source. +type LdapIdentitySourceSearchResultList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + Results []LdapIdentitySourceSearchResultItem +} + +func (s LdapIdentitySourceSearchResultList) GetType__() bindings.BindingType { + return LdapIdentitySourceSearchResultListBindingType() +} + +func (s LdapIdentitySourceSearchResultList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LdapIdentitySourceSearchResultList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detail about one error encountered during a probe. +type LdapProbeError struct { + // Possible values are: + // + // * LdapProbeError#LdapProbeError_ERROR_TYPE_CONNECTION_TIMEOUT + // * LdapProbeError#LdapProbeError_ERROR_TYPE_CONNECTION_REFUSED + // * LdapProbeError#LdapProbeError_ERROR_TYPE_STARTTLS_FAILED + // * LdapProbeError#LdapProbeError_ERROR_TYPE_INVALID_CREDENTIALS + // * LdapProbeError#LdapProbeError_ERROR_TYPE_BASE_DN_NOT_FOUND + // * LdapProbeError#LdapProbeError_ERROR_TYPE_SSL_HANDSHAKE_ERROR + // * LdapProbeError#LdapProbeError_ERROR_TYPE_GENERAL_ERROR + // + // The cause of the error. CONNECTION_TIMEOUT: The connection timed out when contating the LDAP server. Check the hostname/ip. CONNECTION_REFUSED: The connection was refused when contacting the LDAP server. Ensure that the LDAP server is up and that you have the correct ip/hostname. STARTTLS_FAILED: Unable to use StartTLS to upgrade the connection to use TLS. Ensure the LDAP server supports TLS and if not, use LDAP or LDAPS as the protocol. INVALID_CREDENTIALS: The username and/or password are incorrect. THUMBPRINT_MISMATCH: A certificate thumbprint was provided in the LDAP server configuration, but did not match the certificate presented by the LDAP server. BASE_DN_NOT_FOUND: The configured base_dn does not exist on the LDAP server or is not readable. SSL_HANDSHAKE_ERROR: An error occurred while establishing a secure connection with the LDAP server. GENERAL_ERROR: An undetermined error occurred. + ErrorType *string +} +const LdapProbeError_ERROR_TYPE_CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT" +const LdapProbeError_ERROR_TYPE_CONNECTION_REFUSED = "CONNECTION_REFUSED" +const LdapProbeError_ERROR_TYPE_STARTTLS_FAILED = "STARTTLS_FAILED" +const LdapProbeError_ERROR_TYPE_INVALID_CREDENTIALS = "INVALID_CREDENTIALS" +const LdapProbeError_ERROR_TYPE_BASE_DN_NOT_FOUND = "BASE_DN_NOT_FOUND" +const LdapProbeError_ERROR_TYPE_SSL_HANDSHAKE_ERROR = "SSL_HANDSHAKE_ERROR" +const LdapProbeError_ERROR_TYPE_GENERAL_ERROR = "GENERAL_ERROR" + +func (s LdapProbeError) GetType__() bindings.BindingType { + return LdapProbeErrorBindingType() +} + +func (s LdapProbeError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LdapProbeError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents legend that describes the entities of the widget. +type Legend struct { + // Possible values are: + // + // * Legend#Legend_ALIGNMENT_HORIZONTAL + // * Legend#Legend_ALIGNMENT_VERTICAL + // + // Describes the alignment of legend. Alignment of a legend denotes how individual items of the legend are aligned in a container. For example, if VERTICAL is chosen then the items of the legend will appear one below the other and if HORIZONTAL is chosen then the items will appear side by side. + Alignment *string + // If set to true, it will display the counts in legend. If set to false, counts of entities are not displayed in the legend. + DisplayCount *bool + // Possible values are: + // + // * Legend#Legend_POSITION_TOP + // * Legend#Legend_POSITION_BOTTOM + // * Legend#Legend_POSITION_LEFT + // * Legend#Legend_POSITION_RIGHT + // * Legend#Legend_POSITION_TOP_RIGHT + // + // Describes the relative placement of legend. The legend of a widget can be placed either to the TOP or BOTTOM or LEFT or RIGHT relative to the widget. For example, if RIGHT is chosen then legend is placed to the right of the widget. + Position *string + // Possible values are: + // + // * Legend#Legend_TYPE_CIRCLE + // + // Describes the render type for the legend. The legend for an entity describes the entity in the widget. The supported legend type is a circle against which the entity's details such as display_name are shown. The color of the circle denotes the color of the entity shown inside the widget. + Type_ *string + // Show unit of entities in the legend. + Unit *string +} +const Legend_ALIGNMENT_HORIZONTAL = "HORIZONTAL" +const Legend_ALIGNMENT_VERTICAL = "VERTICAL" +const Legend_POSITION_TOP = "TOP" +const Legend_POSITION_BOTTOM = "BOTTOM" +const Legend_POSITION_LEFT = "LEFT" +const Legend_POSITION_RIGHT = "RIGHT" +const Legend_POSITION_TOP_RIGHT = "TOP_RIGHT" +const Legend_TYPE_CIRCLE = "CIRCLE" + +func (s Legend) GetType__() bindings.BindingType { + return LegendBindingType() +} + +func (s Legend) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Legend._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base class for list results from collections +type ListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string +} + +func (s ListResult) GetType__() bindings.BindingType { + return ListResultBindingType() +} + +func (s ListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Local Egress is used on both server and client sites so that the gateway is used for N-S traffic and overhead on L2VPN tunnel is reduced. +type LocalEgress struct { + // Gateway IP for Local Egress. Local egress is enabled only when this list is not empty. format: ip + OptimizedIps []string +} + +func (s LocalEgress) GetType__() bindings.BindingType { + return LocalEgressBindingType() +} + +func (s LocalEgress) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LocalEgress._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Local egress rounting policy +type LocalEgressRoutingEntry struct { + // Next hop address for proximity routing. + NexthopAddress *string + // The destination address of traffic matching a prefix-list is forwarded to the nexthop_address. Traffic matching a prefix list with Action DENY will be dropped. Individual prefix-lists specified could have different actions. + PrefixListPaths []string +} + +func (s LocalEgressRoutingEntry) GetType__() bindings.BindingType { + return LocalEgressRoutingEntryBindingType() +} + +func (s LocalEgressRoutingEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LocalEgressRoutingEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Site specific configuration of Tier0 in multi-site scenario +type LocaleServices struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Policy path to edge cluster. Auto-assigned on Tier0 if associated enforcement-point has only one edge cluster. + EdgeClusterPath *string + // This configuration can be defined only for Active-Standby Tier0 gateway to provide redundancy. For mulitple external interfaces, multiple HA VIP configs must be defined and each config will pair exactly two external interfaces. The VIP will move and will always be owned by the Active node. When this property is configured, configuration of dynamic-routing is not allowed. + HaVipConfigs []Tier0HaVipConfig + // Policy paths to edge nodes. Specified edge is used as preferred edge cluster member when failover mode is set to PREEMPTIVE, not applicable otherwise. + PreferredEdgePaths []string + // Configure all route redistribution properties like enable/disable redistributon, redistribution rule and so on. + RouteRedistributionConfig *Tier0RouteRedistributionConfig + // Possible values are: + // + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_STATIC + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_CONNECTED + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_EXTERNAL_INTERFACE + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_SEGMENT + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_ROUTER_LINK + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_SERVICE_INTERFACE + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_LOOPBACK_INTERFACE + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_DNS_FORWARDER_IP + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_IPSEC_LOCAL_IP + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_NAT + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_EVPN_TEP_IP + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_NAT + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_STATIC + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_LB_VIP + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_LB_SNAT + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_DNS_FORWARDER_IP + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_CONNECTED + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_SERVICE_INTERFACE + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_SEGMENT + // * LocaleServices#LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_IPSEC_LOCAL_ENDPOINT + // + // Enable redistribution of different types of routes on Tier-0. This property is only valid for locale-service under Tier-0. This property is deprecated, please use \"route_redistribution_config\" property to configure redistribution rules. + RouteRedistributionTypes []string +} +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_STATIC = "TIER0_STATIC" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_CONNECTED = "TIER0_CONNECTED" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_EXTERNAL_INTERFACE = "TIER0_EXTERNAL_INTERFACE" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_SEGMENT = "TIER0_SEGMENT" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_ROUTER_LINK = "TIER0_ROUTER_LINK" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_SERVICE_INTERFACE = "TIER0_SERVICE_INTERFACE" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_LOOPBACK_INTERFACE = "TIER0_LOOPBACK_INTERFACE" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_DNS_FORWARDER_IP = "TIER0_DNS_FORWARDER_IP" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_IPSEC_LOCAL_IP = "TIER0_IPSEC_LOCAL_IP" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_NAT = "TIER0_NAT" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER0_EVPN_TEP_IP = "TIER0_EVPN_TEP_IP" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_NAT = "TIER1_NAT" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_STATIC = "TIER1_STATIC" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_LB_VIP = "TIER1_LB_VIP" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_LB_SNAT = "TIER1_LB_SNAT" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_DNS_FORWARDER_IP = "TIER1_DNS_FORWARDER_IP" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_CONNECTED = "TIER1_CONNECTED" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_SERVICE_INTERFACE = "TIER1_SERVICE_INTERFACE" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_SEGMENT = "TIER1_SEGMENT" +const LocaleServices_ROUTE_REDISTRIBUTION_TYPES_TIER1_IPSEC_LOCAL_ENDPOINT = "TIER1_IPSEC_LOCAL_ENDPOINT" + +func (s LocaleServices) GetType__() bindings.BindingType { + return LocaleServicesBindingType() +} + +func (s LocaleServices) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LocaleServices._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of LocaleServices +type LocaleServicesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // LocaleServices results + Results []LocaleServices +} + +func (s LocaleServicesListResult) GetType__() bindings.BindingType { + return LocaleServicesListResultBindingType() +} + +func (s LocaleServicesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LocaleServicesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LogicalPortStatistics struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + DroppedBySecurityPackets *PacketsDroppedBySecurity + MacLearning *MacLearningCounters + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical port + LogicalPortId *string +} + +func (s LogicalPortStatistics) GetType__() bindings.BindingType { + return LogicalPortStatisticsBindingType() +} + +func (s LogicalPortStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LogicalRouterPortCounters struct { + // The number of dropped packets format: int64 + DroppedPackets *int64 + // The total number of bytes format: int64 + TotalBytes *int64 + // The total number of packets format: int64 + TotalPackets *int64 +} + +func (s LogicalRouterPortCounters) GetType__() bindings.BindingType { + return LogicalRouterPortCountersBindingType() +} + +func (s LogicalRouterPortCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LogicalRouterPortStatistics struct { + // The ID of the logical router port + LogicalRouterPortId *string + // Per Node Statistics + PerNodeStatistics []LogicalRouterPortStatisticsPerNode +} + +func (s LogicalRouterPortStatistics) GetType__() bindings.BindingType { + return LogicalRouterPortStatisticsBindingType() +} + +func (s LogicalRouterPortStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LogicalRouterPortStatisticsPerNode struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Rx *LogicalRouterPortCounters + Tx *LogicalRouterPortCounters + // The ID of the TransportNode + TransportNodeId *string +} + +func (s LogicalRouterPortStatisticsPerNode) GetType__() bindings.BindingType { + return LogicalRouterPortStatisticsPerNodeBindingType() +} + +func (s LogicalRouterPortStatisticsPerNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortStatisticsPerNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LogicalRouterPortStatisticsSummary struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Rx *LogicalRouterPortCounters + Tx *LogicalRouterPortCounters + // The ID of the logical router port + LogicalRouterPortId *string +} + +func (s LogicalRouterPortStatisticsSummary) GetType__() bindings.BindingType { + return LogicalRouterPortStatisticsSummaryBindingType() +} + +func (s LogicalRouterPortStatisticsSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortStatisticsSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This holds the state of Logical Router. If there are errors in realizing LR outside of MP, it gives details of the components and specific errors. +type LogicalRouterState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * LogicalRouterState#LogicalRouterState_STATE_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_SUCCESS + // * LogicalRouterState#LogicalRouterState_STATE_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_PARTIAL_SUCCESS + // * LogicalRouterState#LogicalRouterState_STATE_ORPHANED + // * LogicalRouterState#LogicalRouterState_STATE_UNKNOWN + // * LogicalRouterState#LogicalRouterState_STATE_ERROR + // * LogicalRouterState#LogicalRouterState_STATE_IN_SYNC + // * LogicalRouterState#LogicalRouterState_STATE_NOT_AVAILABLE + // * LogicalRouterState#LogicalRouterState_STATE_VM_DEPLOYMENT_QUEUED + // * LogicalRouterState#LogicalRouterState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_VM_DEPLOYMENT_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_POWER_ON_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_VM_POWER_ON_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_REGISTRATION_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_NODE_NOT_READY + // * LogicalRouterState#LogicalRouterState_STATE_NODE_READY + // * LogicalRouterState#LogicalRouterState_STATE_VM_POWER_OFF_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_VM_POWER_OFF_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_VM_UNDEPLOY_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_CONFIG_ERROR + // * LogicalRouterState#LogicalRouterState_STATE_VM_DEPLOYMENT_RESTARTED + // * LogicalRouterState#LogicalRouterState_STATE_REGISTRATION_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * LogicalRouterState#LogicalRouterState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * LogicalRouterState#LogicalRouterState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * LogicalRouterState#LogicalRouterState_STATE_APPLIANCE_INTERNAL_ERROR + // * LogicalRouterState#LogicalRouterState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * LogicalRouterState#LogicalRouterState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * LogicalRouterState#LogicalRouterState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * LogicalRouterState#LogicalRouterState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * LogicalRouterState#LogicalRouterState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterState#LogicalRouterState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterState#LogicalRouterState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterState#LogicalRouterState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * LogicalRouterState#LogicalRouterState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * LogicalRouterState#LogicalRouterState_STATE_INVALID_PNIC_DEVICE_NAME + // * LogicalRouterState#LogicalRouterState_STATE_TRANSPORT_NODE_READY + // * LogicalRouterState#LogicalRouterState_STATE_VM_NETWORK_EDIT_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * LogicalRouterState#LogicalRouterState_STATE_MPA_DISCONNECTED + // * LogicalRouterState#LogicalRouterState_STATE_VM_RENAME_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_VM_CONFIG_EDIT_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_VM_NETWORK_EDIT_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_RENAME_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_CONFIG_EDIT_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_CONFIG_DISCREPANCY + // * LogicalRouterState#LogicalRouterState_STATE_VM_NODE_REFRESH_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_REGISTRATION_TIMEDOUT + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Request identifier of the API which modified the entity. + PendingChangeList []string +} +const LogicalRouterState_STATE_PENDING = "pending" +const LogicalRouterState_STATE_IN_PROGRESS = "in_progress" +const LogicalRouterState_STATE_SUCCESS = "success" +const LogicalRouterState_STATE_FAILED = "failed" +const LogicalRouterState_STATE_PARTIAL_SUCCESS = "partial_success" +const LogicalRouterState_STATE_ORPHANED = "orphaned" +const LogicalRouterState_STATE_UNKNOWN = "unknown" +const LogicalRouterState_STATE_ERROR = "error" +const LogicalRouterState_STATE_IN_SYNC = "in_sync" +const LogicalRouterState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const LogicalRouterState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const LogicalRouterState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const LogicalRouterState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const LogicalRouterState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const LogicalRouterState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const LogicalRouterState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const LogicalRouterState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const LogicalRouterState_STATE_NODE_READY = "NODE_READY" +const LogicalRouterState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const LogicalRouterState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const LogicalRouterState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const LogicalRouterState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const LogicalRouterState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const LogicalRouterState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const LogicalRouterState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const LogicalRouterState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const LogicalRouterState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const LogicalRouterState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const LogicalRouterState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const LogicalRouterState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const LogicalRouterState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const LogicalRouterState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const LogicalRouterState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const LogicalRouterState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const LogicalRouterState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const LogicalRouterState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const LogicalRouterState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const LogicalRouterState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const LogicalRouterState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const LogicalRouterState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const LogicalRouterState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const LogicalRouterState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const LogicalRouterState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const LogicalRouterState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const LogicalRouterState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const LogicalRouterState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const LogicalRouterState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const LogicalRouterState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const LogicalRouterState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const LogicalRouterState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const LogicalRouterState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const LogicalRouterState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const LogicalRouterState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const LogicalRouterState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const LogicalRouterState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const LogicalRouterState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const LogicalRouterState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const LogicalRouterState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" + +func (s LogicalRouterState) GetType__() bindings.BindingType { + return LogicalRouterStateBindingType() +} + +func (s LogicalRouterState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LogicalRouterStatus struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // Possible values are: + // + // * LogicalRouterStatus#LogicalRouterStatus_LOCALE_OPERATION_MODE_PRIMARY_LOCATION + // * LogicalRouterStatus#LogicalRouterStatus_LOCALE_OPERATION_MODE_SECONDARY_LOCATION + // + // Egress mode for the logical router at given mode + LocaleOperationMode *string + // The id of the logical router + LogicalRouterId *string + // Per Node Status + PerNodeStatus []LogicalRouterStatusPerNode +} +const LogicalRouterStatus_LOCALE_OPERATION_MODE_PRIMARY_LOCATION = "PRIMARY_LOCATION" +const LogicalRouterStatus_LOCALE_OPERATION_MODE_SECONDARY_LOCATION = "SECONDARY_LOCATION" + +func (s LogicalRouterStatus) GetType__() bindings.BindingType { + return LogicalRouterStatusBindingType() +} + +func (s LogicalRouterStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LogicalRouterStatusPerNode struct { + // Possible values are: + // + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_ACTIVE + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_STANDBY + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_DOWN + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_SYNC + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_UNKNOWN + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_ADMIN_DOWN + // + // A service router's HA status on an edge node + HighAvailabilityStatus *string + // id of the service router where the router status is retrieved. + ServiceRouterId *string + // id of the transport node where the router status is retrieved. + TransportNodeId *string +} +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_ACTIVE = "ACTIVE" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_STANDBY = "STANDBY" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_DOWN = "DOWN" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_SYNC = "SYNC" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_UNKNOWN = "UNKNOWN" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_ADMIN_DOWN = "ADMIN_DOWN" + +func (s LogicalRouterStatusPerNode) GetType__() bindings.BindingType { + return LogicalRouterStatusPerNodeBindingType() +} + +func (s LogicalRouterStatusPerNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterStatusPerNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type LogicalSwitchStatistics struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + DroppedBySecurityPackets *PacketsDroppedBySecurity + MacLearning *MacLearningCounters + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical Switch + LogicalSwitchId *string +} + +func (s LogicalSwitchStatistics) GetType__() bindings.BindingType { + return LogicalSwitchStatisticsBindingType() +} + +func (s LogicalSwitchStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitchStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents MAC address expressions in the form of an array, to support addition of MAC addresses in a group. Avoid creating groups with multiple MACAddressExpression. In future releases, group will be restricted to contain a single MACAddressExpression. To group MAC addresses, use nested groups instead of multiple MACAddressExpression. +type MACAddressExpression struct { + // This array can consist of one or more MAC addresses. format: mac-address + MacAddresses []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const MACAddressExpression__TYPE_IDENTIFIER = "MACAddressExpression" + +func (s MACAddressExpression) GetType__() bindings.BindingType { + return MACAddressExpressionBindingType() +} + +func (s MACAddressExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MACAddressExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// List of MAC Addresses. +type MACAddressList struct { + // The array contains MAC addresses. format: mac-address + MacAddresses []string +} + +func (s MACAddressList) GetType__() bindings.BindingType { + return MACAddressListBindingType() +} + +func (s MACAddressList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MACAddressList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Mac Discovery Profile +type MacDiscoveryProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Allowing source MAC address change + MacChangeEnabled *bool + // Indicates how long learned MAC address remain. format: int32 + MacLearningAgingTime *int64 + // Allowing source MAC address learning + MacLearningEnabled *bool + // The maximum number of MAC addresses that can be learned on this port format: int32 + MacLimit *int64 + // Possible values are: + // + // * MacDiscoveryProfile#MacDiscoveryProfile_MAC_LIMIT_POLICY_ALLOW + // * MacDiscoveryProfile#MacDiscoveryProfile_MAC_LIMIT_POLICY_DROP + // + // The policy after MAC Limit is exceeded + MacLimitPolicy *string + // This property specifies the limit on the maximum number of MACs learned for a remote virtual machine's MAC to VTEP binding per overlay logical switch. format: int32 + RemoteOverlayMacLimit *int64 + // Allowing flooding for unlearned MAC for ingress traffic + UnknownUnicastFloodingEnabled *bool +} +const MacDiscoveryProfile_MAC_LIMIT_POLICY_ALLOW = "ALLOW" +const MacDiscoveryProfile_MAC_LIMIT_POLICY_DROP = "DROP" + +func (s MacDiscoveryProfile) GetType__() bindings.BindingType { + return MacDiscoveryProfileBindingType() +} + +func (s MacDiscoveryProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacDiscoveryProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Mac Discovery Profiles +type MacDiscoveryProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Mac Discovery profile list results + Results []MacDiscoveryProfile +} + +func (s MacDiscoveryProfileListResult) GetType__() bindings.BindingType { + return MacDiscoveryProfileListResultBindingType() +} + +func (s MacDiscoveryProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacDiscoveryProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type MacLearningCounters struct { + // The number of packets with unknown source MAC address that are dispatched without learning the source MAC address. Applicable only when the MAC limit is reached and MAC Limit policy is MAC_LEARNING_LIMIT_POLICY_ALLOW. format: int64 + MacNotLearnedPacketsAllowed *int64 + // The number of packets with unknown source MAC address that are dropped without learning the source MAC address. Applicable only when the MAC limit is reached and MAC Limit policy is MAC_LEARNING_LIMIT_POLICY_DROP. format: int64 + MacNotLearnedPacketsDropped *int64 + // Number of MACs learned format: int64 + MacsLearned *int64 +} + +func (s MacLearningCounters) GetType__() bindings.BindingType { + return MacLearningCountersBindingType() +} + +func (s MacLearningCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacLearningCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base type for resources that are managed by API clients +type ManagedResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s ManagedResource) GetType__() bindings.BindingType { + return ManagedResourceBindingType() +} + +func (s ManagedResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagedResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type ManagementConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // True if Management nodes publish their fqdns(instead of default IP addresses) across NSX for its reachability. + PublishFqdns *bool +} + +func (s ManagementConfig) GetType__() bindings.BindingType { + return ManagementConfigBindingType() +} + +func (s ManagementConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Metadata Proxy Configuration +type MetadataProxyConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * MetadataProxyConfig#MetadataProxyConfig_CRYPTO_PROTOCOLS_V1 + // * MetadataProxyConfig#MetadataProxyConfig_CRYPTO_PROTOCOLS_V1_1 + // * MetadataProxyConfig#MetadataProxyConfig_CRYPTO_PROTOCOLS_V1_2 + // + // The cryptographic protocols listed here are supported by the metadata proxy. TLSv1.1 and TLSv1.2 are supported by default + CryptoProtocols []string + // Edge clusters configured on MP are auto-discovered by Policy and create corresponding read-only intent objects. + EdgeClusterPath *string + // Only auto-placed metadata proxies are considered for relocation. Must be FALSE, when the preferred_edge_paths property is configured. + EnableStandbyRelocation *bool + // Edge nodes should be members of edge cluster configured in edge_cluster_path. + PreferredEdgePaths []string + // Secret word or phrase to access metadata server. + Secret *string + // This field is a URL. Example formats - http://1.2.3.4:3888/path, http://text-md-proxy:5001/. Port number should be between 3000-9000. + ServerAddress *string + // Valid certificates should be configured. The validity of certificates is not checked. Certificates are managed through /infra/certificates API on Policy. + ServerCertificates []string +} +const MetadataProxyConfig_CRYPTO_PROTOCOLS_V1 = "TLS_V1" +const MetadataProxyConfig_CRYPTO_PROTOCOLS_V1_1 = "TLS_V1_1" +const MetadataProxyConfig_CRYPTO_PROTOCOLS_V1_2 = "TLS_V1_2" + +func (s MetadataProxyConfig) GetType__() bindings.BindingType { + return MetadataProxyConfigBindingType() +} + +func (s MetadataProxyConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MetadataProxyConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base Monitoring Profile Binding Map +type MonitoringProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s MonitoringProfileBindingMap) GetType__() bindings.BindingType { + return MonitoringProfileBindingMapBindingType() +} + +func (s MonitoringProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MonitoringProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Combines two or more widgetconfigurations into a multi-widget +type MultiWidgetConfiguration struct { + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Array of widgets that are part of the multi-widget. + Widgets []WidgetItem + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const MultiWidgetConfiguration__TYPE_IDENTIFIER = "MultiWidgetConfiguration" + +func (s MultiWidgetConfiguration) GetType__() bindings.BindingType { + return MultiWidgetConfigurationBindingType() +} + +func (s MultiWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MultiWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Credential info to connect to an NSX-T type of enforcement point. +type NSXTConnectionInfo struct { + // Edge Cluster UUIDs on enforcement point. Edge cluster information is required for creating logical L2, L3 constructs on enforcement point. Max 1 edge cluster ID. This is a deprecated property. The edge cluster id is now auto populated from enforcement point and its value can be read using APIs GET /infra/sites/site-id/enforcement-points/enforcementpoint-id/edge-clusters and GET /infra/sites/site-id/enforcement-points/enforcementpoint-1/edge-clusters/edge-cluster-id. The value passed through this property will be ignored. + EdgeClusterIds []string + // Password. + Password *string + // Thumbprint of EnforcementPoint in the form of a SHA-256 hash represented in lower case HEX. + Thumbprint *string + // Transport Zone UUIDs on enforcement point. Transport zone information is required for creating logical L2, L3 constructs on enforcement point. Max 1 transport zone ID. This is a deprecated property. The transport zone id is now auto populated from enforcement point and its value can be read using APIs GET /infra/sites/site-id/enforcement-points/enforcementpoint-id/transport-zones and GET /infra/sites/site-id/enforcement-points/enforcementpoint-id/transport-zones/transport-zone-id. The value passed through this property will be ignored. + TransportZoneIds []string + // Username. + Username *string + // Value of this property could be Hostname or IP. For instance: - On an NSX-T MP running on default port, the value could be \"10.192.1.1\" - On an NSX-T MP running on custom port, the value could be \"192.168.1.1:32789\" - On an NSX-T MP in VMC deployments, the value could be \"192.168.1.1:5480/nsxapi\" + EnforcementPointAddress *string + // Possible values are: + // + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXTCONNECTIONINFO + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXVCONNECTIONINFO + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_CVXCONNECTIONINFO + // + // Resource Type of Enforcement Point Connection Info. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NSXTConnectionInfo__TYPE_IDENTIFIER = "NSXTConnectionInfo" + +func (s NSXTConnectionInfo) GetType__() bindings.BindingType { + return NSXTConnectionInfoBindingType() +} + +func (s NSXTConnectionInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSXTConnectionInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Credential info to connect to an NSX-V type of enforcement point. +type NSXVConnectionInfo struct { + // Password. + Password *string + // Thumbprint of EnforcementPoint in the form of a SHA-256 hash represented in lower case HEX. + Thumbprint *string + // Username. + Username *string + // Value of this property could be Hostname or IP. For instance: - On an NSX-T MP running on default port, the value could be \"10.192.1.1\" - On an NSX-T MP running on custom port, the value could be \"192.168.1.1:32789\" - On an NSX-T MP in VMC deployments, the value could be \"192.168.1.1:5480/nsxapi\" + EnforcementPointAddress *string + // Possible values are: + // + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXTCONNECTIONINFO + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_NSXVCONNECTIONINFO + // * EnforcementPointConnectionInfo#EnforcementPointConnectionInfo_RESOURCE_TYPE_CVXCONNECTIONINFO + // + // Resource Type of Enforcement Point Connection Info. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NSXVConnectionInfo__TYPE_IDENTIFIER = "NSXVConnectionInfo" + +func (s NSXVConnectionInfo) GetType__() bindings.BindingType { + return NSXVConnectionInfoBindingType() +} + +func (s NSXVConnectionInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSXVConnectionInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains Neighbor Discovery Protocol (ND) snooping related configuration. +type NdSnoopingConfig struct { + // Enable this method will snoop the NS (Neighbor Solicitation) and NA (Neighbor Advertisement) messages in the ND (Neighbor Discovery Protocol) family of messages which are transmitted by a VM. From the NS messages, we will learn about the source which sent this NS message. From the NA message, we will learn the resolved address in the message which the VM is a recipient of. Addresses snooped by this method are subject to TOFU (Trust on First Use) policies as enforced by the system. + NdSnoopingEnabled *bool + // Maximum number of ND (Neighbor Discovery Protocol) snooped IPv6 addresses format: int32 + NdSnoopingLimit *int64 +} + +func (s NdSnoopingConfig) GetType__() bindings.BindingType { + return NdSnoopingConfigBindingType() +} + +func (s NdSnoopingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NdSnoopingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Neighbor discovery protocol header +type NdpHeader struct { + // The IP address of the destination of the solicitation. It MUST NOT be a multicast address. format: ipv6 + DstIp *string + // Possible values are: + // + // * NdpHeader#NdpHeader_MSG_TYPE_SOLICITATION + // * NdpHeader#NdpHeader_MSG_TYPE_ADVERTISEMENT + // + // This field specifies the type of the Neighbor discover message being sent. NEIGHBOR_SOLICITATION - Neighbor Solicitation message to discover the link-layer address of an on-link IPv6 node or to confirm a previously determined link-layer address. NEIGHBOR_ADVERTISEMENT - Neighbor Advertisement message in response to a Neighbor Solicitation message. + MsgType *string +} +const NdpHeader_MSG_TYPE_SOLICITATION = "NEIGHBOR_SOLICITATION" +const NdpHeader_MSG_TYPE_ADVERTISEMENT = "NEIGHBOR_ADVERTISEMENT" + +func (s NdpHeader) GetType__() bindings.BindingType { + return NdpHeaderBindingType() +} + +func (s NdpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NdpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Nested expressions is a list of condition expressions that must follow the below criteria: 0. Only allowed expressions in a NestedExpression are Condition and ConjunctionOperator. 1. A non-empty expression list, must be of odd size. In a list, with indices starting from 0, all condition expressions must be at even indices, separated by the conjunction expressions AND at odd indices. 2. There may be at most 5 condition expressions inside a list. 3. NestedExpressions are homogeneous in nature, i.e, all expressions inside a nested expression must have the same member type. +type NestedExpression struct { + // Expression. + Expressions []*data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NestedExpression__TYPE_IDENTIFIER = "NestedExpression" + +func (s NestedExpression) GetType__() bindings.BindingType { + return NestedExpressionBindingType() +} + +func (s NestedExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NestedExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A ServiceEntry that represents nesting service +type NestedServiceServiceEntry struct { + // path of nested service + NestedServicePath *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NestedServiceServiceEntry__TYPE_IDENTIFIER = "NestedServiceServiceEntry" + +func (s NestedServiceServiceEntry) GetType__() bindings.BindingType { + return NestedServiceServiceEntryBindingType() +} + +func (s NestedServiceServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NestedServiceServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Network error related to container objects. +type NetworkError struct { + // Error code of network related error. + ErrorCode *string + // Detailed message of network related error. + ErrorMessage *string + // Additional error information in json format. + Spec *string +} + +func (s NetworkError) GetType__() bindings.BindingType { + return NetworkErrorBindingType() +} + +func (s NetworkError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NetworkError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Role +type NsxRole struct { + // Possible values are: + // + // * NsxRole#NsxRole_PERMISSIONS_READ_API + // * NsxRole#NsxRole_PERMISSIONS_READ_WRITE_API + // * NsxRole#NsxRole_PERMISSIONS_CRUD + // * NsxRole#NsxRole_PERMISSIONS_READ + // * NsxRole#NsxRole_PERMISSIONS_EXECUTE + // * NsxRole#NsxRole_PERMISSIONS_NONE + // + // Please use the /user-info/permissions api to get the permission that the user has on each feature. + Permissions []string + // This field represents the identifier of the role. With the introduction of custom roles, this field is no longer an enum. + Role *string +} +const NsxRole_PERMISSIONS_READ_API = "read-api" +const NsxRole_PERMISSIONS_READ_WRITE_API = "read-write-api" +const NsxRole_PERMISSIONS_CRUD = "crud" +const NsxRole_PERMISSIONS_READ = "read" +const NsxRole_PERMISSIONS_EXECUTE = "execute" +const NsxRole_PERMISSIONS_NONE = "none" + +func (s NsxRole) GetType__() bindings.BindingType { + return NsxRoleBindingType() +} + +func (s NsxRole) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxRole._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The current statistics counters of the DNS forwarder including cache usages and query numbers per forwarders, on an NSX-T type of enforcement point. +type NsxTDNSForwarderStatistics struct { + // The total number of cached entries format: int64 + CachedEntries *int64 + // The statistics of conditional forwarder zones + ConditionalForwarderStatistics []NsxTDNSForwarderZoneStatistics + // The configured cache size, in kb format: int64 + ConfiguredCacheSize *int64 + // The statistics of default forwarder zone + DefaultForwarderStatistics *NsxTDNSForwarderZoneStatistics + // The total number of queries answered from local cache format: int64 + QueriesAnsweredLocally *int64 + // The total number of forwarded DNS queries format: int64 + QueriesForwarded *int64 + // Time stamp of the current statistics, in ms format: int64 + Timestamp *int64 + // The total number of received DNS queries format: int64 + TotalQueries *int64 + // The statistics of used cache + UsedCacheStatistics []NsxtPerNodeUsedCacheStatistics + // Policy path referencing the enforcement point from where the statistics are fetched. + EnforcementPointPath *string + // Possible values are: + // + // * DNSForwarderStatisticsPerEnforcementPoint#DNSForwarderStatisticsPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSFORWARDERSTATISTICS + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NsxTDNSForwarderStatistics__TYPE_IDENTIFIER = "NsxTDNSForwarderStatistics" + +func (s NsxTDNSForwarderStatistics) GetType__() bindings.BindingType { + return NsxTDNSForwarderStatisticsBindingType() +} + +func (s NsxTDNSForwarderStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxTDNSForwarderStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The current runtime status of the DNS forwarder. +type NsxTDNSForwarderStatus struct { + // Extra message, if available + ExtraMessage *string + // Possible values are: + // + // * NsxTDNSForwarderStatus#NsxTDNSForwarderStatus_STATUS_UP + // * NsxTDNSForwarderStatus#NsxTDNSForwarderStatus_STATUS_DOWN + // * NsxTDNSForwarderStatus#NsxTDNSForwarderStatus_STATUS_ERROR + // * NsxTDNSForwarderStatus#NsxTDNSForwarderStatus_STATUS_NO_BACKUP + // * NsxTDNSForwarderStatus#NsxTDNSForwarderStatus_STATUS_UNKNOWN + // + // UP means the DNS forwarder is working correctly on the active transport node and the stand-by transport node (if present). Failover will occur if either node goes down. DOWN means the DNS forwarder is down on both active transport node and standby node (if present). The DNS forwarder does not function in this situation. Error means there is some error on one or both transport node, or no status was reported from one or both transport nodes. The DNS forwarder may be working (or not working). NO_BACKUP means DNS forwarder is working in only one transport node, either because it is down on the standby node, or no standby is configured. An forwarder outage will occur if the active node goes down. + Status *string + // Time stamp of the current status, in ms format: int64 + Timestamp *int64 + // Policy path referencing the enforcement point from where the status is fetched. + EnforcementPointPath *string + // Possible values are: + // + // * DNSForwarderStatusPerEnforcementPoint#DNSForwarderStatusPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSFORWARDERSTATUS + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NsxTDNSForwarderStatus__TYPE_IDENTIFIER = "NsxTDNSForwarderStatus" +const NsxTDNSForwarderStatus_STATUS_UP = "UP" +const NsxTDNSForwarderStatus_STATUS_DOWN = "DOWN" +const NsxTDNSForwarderStatus_STATUS_ERROR = "ERROR" +const NsxTDNSForwarderStatus_STATUS_NO_BACKUP = "NO_BACKUP" +const NsxTDNSForwarderStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s NsxTDNSForwarderStatus) GetType__() bindings.BindingType { + return NsxTDNSForwarderStatusBindingType() +} + +func (s NsxTDNSForwarderStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxTDNSForwarderStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Statistics counters of the DNS forwarder zone. +type NsxTDNSForwarderZoneStatistics struct { + // Domain names configured for the forwarder. Empty if this is the default forwarder. + DomainNames []string + // Statistics per upstream server. + UpstreamStatistics []NsxtUpstreamServerStatistics +} + +func (s NsxTDNSForwarderZoneStatistics) GetType__() bindings.BindingType { + return NsxTDNSForwarderZoneStatisticsBindingType() +} + +func (s NsxTDNSForwarderZoneStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxTDNSForwarderZoneStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Answer of dns nslookup +type NsxtDnsAnswer struct { + // Authoritative answers + AuthoritativeAnswers []NsxtDnsQueryAnswer + // Dns server ip address and port, format is \"ip address#port\". + DnsServer *string + // ID of the edge node that performed the query. + EdgeNodeId *string + // Non authoritative answers + NonAuthoritativeAnswers []NsxtDnsQueryAnswer + // It can be NXDOMAIN or error message which is not consisted of authoritative_answer or non_authoritative_answer. + RawAnswer *string + // Policy path referencing the enforcement point from where the DNS forwarder nslookup answer is fetched. + EnforcementPointPath *string + // Possible values are: + // + // * PolicyDnsAnswerPerEnforcementPoint#PolicyDnsAnswerPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSANSWER + // + // Resource type of the DNS forwarder nslookup answer. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NsxtDnsAnswer__TYPE_IDENTIFIER = "NsxTDnsAnswer" + +func (s NsxtDnsAnswer) GetType__() bindings.BindingType { + return NsxtDnsAnswerBindingType() +} + +func (s NsxtDnsAnswer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxtDnsAnswer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Answer of nslookup +type NsxtDnsQueryAnswer struct { + // Resolved IP address matched with the nslookup address provided as a request parameter. + Address *string + // Matched name of the given address. + Name *string +} + +func (s NsxtDnsQueryAnswer) GetType__() bindings.BindingType { + return NsxtDnsQueryAnswerBindingType() +} + +func (s NsxtDnsQueryAnswer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxtDnsQueryAnswer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Query statistics counters of used cache from node +type NsxtPerNodeUsedCacheStatistics struct { + // The total number of cached entries format: int64 + CachedEntries *int64 + // UUID of active/standby transport node + NodeId *string + // The memory size used in cache, in kb format: int64 + UsedCacheSize *int64 +} + +func (s NsxtPerNodeUsedCacheStatistics) GetType__() bindings.BindingType { + return NsxtPerNodeUsedCacheStatisticsBindingType() +} + +func (s NsxtPerNodeUsedCacheStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxtPerNodeUsedCacheStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Query statistics counters to an upstream server including successfully forwarded queries and failed queries. +type NsxtUpstreamServerStatistics struct { + // Queries failed to forward. format: int64 + QueriesFailed *int64 + // Queries forwarded successfully format: int64 + QueriesSucceeded *int64 + // Upstream server ip format: ip + UpstreamServer *string +} + +func (s NsxtUpstreamServerStatistics) GetType__() bindings.BindingType { + return NsxtUpstreamServerStatisticsBindingType() +} + +func (s NsxtUpstreamServerStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxtUpstreamServerStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// RBAC Objects qualifier +type ObjectRolePermissionGroup struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Does children of this object inherit this rule + InheritanceDisabled *bool + // Possible values are: + // + // * ObjectRolePermissionGroup#ObjectRolePermissionGroup_OPERATION_CRUD + // * ObjectRolePermissionGroup#ObjectRolePermissionGroup_OPERATION_READ + // * ObjectRolePermissionGroup#ObjectRolePermissionGroup_OPERATION_EXECUTE + // * ObjectRolePermissionGroup#ObjectRolePermissionGroup_OPERATION_NONE + // + // Allowed operation + Operation *string + // Path prefix + PathPrefix *string + // Role name + RoleName *string + // Is rule disabled or not + RuleDisabled *bool +} +const ObjectRolePermissionGroup_OPERATION_CRUD = "crud" +const ObjectRolePermissionGroup_OPERATION_READ = "read" +const ObjectRolePermissionGroup_OPERATION_EXECUTE = "execute" +const ObjectRolePermissionGroup_OPERATION_NONE = "none" + +func (s ObjectRolePermissionGroup) GetType__() bindings.BindingType { + return ObjectRolePermissionGroupBindingType() +} + +func (s ObjectRolePermissionGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ObjectRolePermissionGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of RBAC Objects +type ObjectRolePermissionGroupListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // ObjectRolePermissionGroup list results + Results []ObjectRolePermissionGroup +} + +func (s ObjectRolePermissionGroupListResult) GetType__() bindings.BindingType { + return ObjectRolePermissionGroupListResultBindingType() +} + +func (s ObjectRolePermissionGroupListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ObjectRolePermissionGroupListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// An identity source service that runs OpenLDAP. The service allows selected user accounts defined in OpenLDAP to log into and access NSX-T. +type OpenLdapIdentitySource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LdapIdentitySource#LdapIdentitySource_RESOURCE_TYPE_ACTIVEDIRECTORYIDENTITYSOURCE + // * LdapIdentitySource#LdapIdentitySource_RESOURCE_TYPE_OPENLDAPIDENTITYSOURCE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The subtree of the LDAP identity source to search when locating users and groups. + BaseDn *string + // The name of the authentication domain. When users log into NSX using an identity of the form \"user\\\\@domain\", NSX uses the domain portion to determine which LDAP identity source to use. For Active Directory, this domain name must match the domain of the Active Directory. + DomainName *string + // The list of LDAP servers that provide LDAP service for this identity source. Currently, only one LDAP server is supported. + LdapServers []IdentitySourceLdapServer +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const OpenLdapIdentitySource__TYPE_IDENTIFIER = "OpenLdapIdentitySource" + +func (s OpenLdapIdentitySource) GetType__() bindings.BindingType { + return OpenLdapIdentitySourceBindingType() +} + +func (s OpenLdapIdentitySource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OpenLdapIdentitySource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents which federated global resources have been overrriden on a specific Site. +type OverriddenResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Policy resource path of the overridden resource. + IntentPath *string + // Site path to the specific site that has overridden the global resource. + SitePath *string +} + +func (s OverriddenResource) GetType__() bindings.BindingType { + return OverriddenResourceBindingType() +} + +func (s OverriddenResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OverriddenResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of OverriddenResource. +type OverriddenResourceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // OverriddenResource list results. + Results []OverriddenResource +} + +func (s OverriddenResourceListResult) GetType__() bindings.BindingType { + return OverriddenResourceListResultBindingType() +} + +func (s OverriddenResourceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OverriddenResourceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type PacketData struct { + // If the requested frame_size is too small (given the payload and traceflow metadata requirement of 16 bytes), the traceflow request will fail with an appropriate message. The frame will be zero padded to the requested size. format: int64 + FrameSize *int64 + // Possible values are: + // + // * PacketData#PacketData_RESOURCE_TYPE_BINARYPACKETDATA + // * PacketData#PacketData_RESOURCE_TYPE_FIELDSPACKETDATA + // + // Packet configuration + ResourceType string + // A flag, when set true, indicates that the traceflow packet is of L3 routing. + Routed *bool + // Possible values are: + // + // * PacketData#PacketData_TRANSPORT_TYPE_BROADCAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNICAST + // * PacketData#PacketData_TRANSPORT_TYPE_MULTICAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNKNOWN + // + // transport type of the traceflow packet + TransportType *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PacketData__TYPE_IDENTIFIER = "PacketData" +const PacketData_RESOURCE_TYPE_BINARYPACKETDATA = "BinaryPacketData" +const PacketData_RESOURCE_TYPE_FIELDSPACKETDATA = "FieldsPacketData" +const PacketData_TRANSPORT_TYPE_BROADCAST = "BROADCAST" +const PacketData_TRANSPORT_TYPE_UNICAST = "UNICAST" +const PacketData_TRANSPORT_TYPE_MULTICAST = "MULTICAST" +const PacketData_TRANSPORT_TYPE_UNKNOWN = "UNKNOWN" + +func (s PacketData) GetType__() bindings.BindingType { + return PacketDataBindingType() +} + +func (s PacketData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type PacketTypeAndCounter struct { + // The number of packets. format: int64 + Counter *int64 + // The type of the packets + PacketType *string +} + +func (s PacketTypeAndCounter) GetType__() bindings.BindingType { + return PacketTypeAndCounterBindingType() +} + +func (s PacketTypeAndCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketTypeAndCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type PacketsDroppedBySecurity struct { + // The number of packets dropped by \"BPDU filter\". format: int64 + BpduFilterDropped *int64 + // The number of IPv4 packets dropped by \"DHCP client block\". format: int64 + DhcpClientDroppedIpv4 *int64 + // The number of IPv6 packets dropped by \"DHCP client block\". format: int64 + DhcpClientDroppedIpv6 *int64 + // The number of IPv4 packets dropped by \"DHCP server block\". format: int64 + DhcpServerDroppedIpv4 *int64 + // The number of IPv6 packets dropped by \"DHCP server block\". format: int64 + DhcpServerDroppedIpv6 *int64 + // The packets dropped by \"Spoof Guard\"; supported packet types are IPv4, IPv6, ARP, ND, non-IP. + SpoofGuardDropped []PacketTypeAndCounter +} + +func (s PacketsDroppedBySecurity) GetType__() bindings.BindingType { + return PacketsDroppedBySecurityBindingType() +} + +func (s PacketsDroppedBySecurity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketsDroppedBySecurity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This object allows enabling or disabling of partial patch functionality. Enabling partial patch allows patching of a subset of the fields of any object. After enabling partial patching, any object payload provided will be merged with the existing object payload. Note that while all mandatory fields are expected to be provided during the creation of any object, enabling partial patch will allow patching of existing objects with a subset of mandatory fields. +type PartialPatchConfig struct { + // boolean value used to enable/disable partial patch + EnablePartialPatch *bool +} + +func (s PartialPatchConfig) GetType__() bindings.BindingType { + return PartialPatchConfigBindingType() +} + +func (s PartialPatchConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PartialPatchConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Patch Resources is an action to create/patch resources in response to an event. +type PatchResources struct { + // Patch body representing a Hierarchical Patch payload. The resources included in the body are patched replacing the injections' keys with their actual values. + Body *data.StructValue + // Injections holding keys (variables) and their corresponding values. + Injections []Injection + // Possible values are: + // + // * Action#Action_RESOURCE_TYPE_PATCHRESOURCES + // * Action#Action_RESOURCE_TYPE_SETFIELDS + // + // Reaction Action resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PatchResources__TYPE_IDENTIFIER = "PatchResources" + +func (s PatchResources) GetType__() bindings.BindingType { + return PatchResourcesBindingType() +} + +func (s PatchResources) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PatchResources._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents policy path expressions in the form of an array, to support addition of objects like groups, segments and policy logical ports in a group. +type PathExpression struct { + // This array can consist of one or more policy paths. Only policy paths of groups, segments and policy logical ports are allowed. + Paths []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * Expression#Expression_RESOURCE_TYPE_CONDITION + // * Expression#Expression_RESOURCE_TYPE_CONJUNCTIONOPERATOR + // * Expression#Expression_RESOURCE_TYPE_NESTEDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IPADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_MACADDRESSEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_EXTERNALIDEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_PATHEXPRESSION + // * Expression#Expression_RESOURCE_TYPE_IDENTITYGROUPEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PathExpression__TYPE_IDENTIFIER = "PathExpression" + +func (s PathExpression) GetType__() bindings.BindingType { + return PathExpressionBindingType() +} + +func (s PathExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PathExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// RBAC Objects qualifier +type PathPermissionGroup struct { + // Full Object Path + ObjectPath *string + // Possible values are: + // + // * PathPermissionGroup#PathPermissionGroup_OPERATION_CRUD + // * PathPermissionGroup#PathPermissionGroup_OPERATION_READ + // * PathPermissionGroup#PathPermissionGroup_OPERATION_EXECUTE + // * PathPermissionGroup#PathPermissionGroup_OPERATION_NONE + // + // Allowed operation + Operation *string +} +const PathPermissionGroup_OPERATION_CRUD = "crud" +const PathPermissionGroup_OPERATION_READ = "read" +const PathPermissionGroup_OPERATION_EXECUTE = "execute" +const PathPermissionGroup_OPERATION_NONE = "none" + +func (s PathPermissionGroup) GetType__() bindings.BindingType { + return PathPermissionGroupBindingType() +} + +func (s PathPermissionGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PathPermissionGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The certificate chain presented by a remote TLS service. +type PeerCertificateChain struct { + // List of X509Certificates. + Details []X509Certificate + // PEM encoded certificate data. + PemEncoded *string +} + +func (s PeerCertificateChain) GetType__() bindings.BindingType { + return PeerCertificateChainBindingType() +} + +func (s PeerCertificateChain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PeerCertificateChain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Information about recent changes, if any, that are not reflected in the Enforced Realized Status. +type PendingChangesInfoNsxt struct { + // Flag describing whether there are any pending changes that are not reflected in the status. + PendingChangesFlag *bool +} + +func (s PendingChangesInfoNsxt) GetType__() bindings.BindingType { + return PendingChangesInfoNsxtBindingType() +} + +func (s PendingChangesInfoNsxt) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PendingChangesInfoNsxt._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Restore step status +type PerStepRestoreStatus struct { + // A description of the restore status + Description *string + // Possible values are: + // + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_INITIAL + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_RUNNING + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_SUSPENDED_BY_USER + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_SUSPENDED_FOR_USER_ACTION + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_FAILED + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_SUCCESS + // + // Per step restore status value + Value *string +} +const PerStepRestoreStatus_VALUE_INITIAL = "INITIAL" +const PerStepRestoreStatus_VALUE_RUNNING = "RUNNING" +const PerStepRestoreStatus_VALUE_SUSPENDED_BY_USER = "SUSPENDED_BY_USER" +const PerStepRestoreStatus_VALUE_SUSPENDED_FOR_USER_ACTION = "SUSPENDED_FOR_USER_ACTION" +const PerStepRestoreStatus_VALUE_FAILED = "FAILED" +const PerStepRestoreStatus_VALUE_SUCCESS = "SUCCESS" + +func (s PerStepRestoreStatus) GetType__() bindings.BindingType { + return PerStepRestoreStatusBindingType() +} + +func (s PerStepRestoreStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PerStepRestoreStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Defines the point of a graph. +type PointDefinition struct { + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // An expression that represents the points of the graph + Field *string + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Multi-line text to be shown on tooltip while hovering over the point of a graph. + Tooltip []Tooltip + // Represents the variable for the X value of points that are plotted on the graph. + XValue *string + // Represents the variable for the Y value of points that are plotted on the graph. + YValue *string +} + +func (s PointDefinition) GetType__() bindings.BindingType { + return PointDefinitionBindingType() +} + +func (s PointDefinition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PointDefinition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Ordered list of Rules. This object is created by default along with the Domain. +type Policy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // - Distributed Firewall - Policy framework provides five pre-defined categories for classifying a security policy. They are \"Ethernet\",\"Emergency\", \"Infrastructure\" \"Environment\" and \"Application\". There is a pre-determined order in which the policy framework manages the priority of these security policies. Ethernet category is for supporting layer 2 firewall rules. The other four categories are applicable for layer 3 rules. Amongst them, the Emergency category has the highest priority followed by Infrastructure, Environment and then Application rules. Administrator can choose to categorize a security policy into the above categories or can choose to leave it empty. If empty it will have the least precedence w.r.t the above four categories. - Edge Firewall - Policy Framework for Edge Firewall provides six pre-defined categories \"Emergency\", \"SystemRules\", \"SharedPreRules\", \"LocalGatewayRules\", \"AutoServiceRules\" and \"Default\", in order of priority of rules. All categories are allowed for Gatetway Policies that belong to 'default' Domain. However, for user created domains, category is restricted to \"SharedPreRules\" or \"LocalGatewayRules\" only. Also, the users can add/modify/delete rules from only the \"SharedPreRules\" and \"LocalGatewayRules\" categories. If user doesn't specify the category then defaulted to \"Rules\". System generated category is used by NSX created rules, for example BFD rules. Autoplumbed category used by NSX verticals to autoplumb data path rules. Finally, \"Default\" category is the placeholder default rules with lowest in the order of priority. + Category *string + // Comments for security policy lock/unlock. + Comments *string + // This field is to indicate the internal sequence number of a policy with respect to the policies across categories. format: int32 + InternalSequenceNumber *int64 + // A flag to indicate whether policy is a default policy. + IsDefault *bool + // ID of the user who last modified the lock for the secruity policy. + LockModifiedBy *string + // SecurityPolicy locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Indicates whether a security policy should be locked. If the security policy is locked by a user, then no other user would be able to modify this security policy. Once the user releases the lock, other users can update this security policy. + Locked *bool + // The count of rules in the policy. format: int32 + RuleCount *int64 + // Provides a mechanism to apply the rules in this policy for a specified time duration. + SchedulerPath *string + // The list of group paths where the rules in this policy will get applied. This scope will take precedence over rule level scope. Supported only for security and redirection policies. In case of RedirectionPolicy, it is expected only when the policy is NS and redirecting to service chain. + Scope []string + // This field is used to resolve conflicts between security policies across domains. In order to change the sequence number of a policy one can fire a POST request on the policy entity with a query parameter action=revise The sequence number field will reflect the value of the computed sequence number upon execution of the above mentioned POST request. For scenarios where the administrator is using a template to update several security policies, the only way to set the sequence number is to explicitly specify the sequence number for each security policy. If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple policies with the same sequence number then their order is not deterministic. If a specific order of policies is desired, then one has to specify unique sequence numbers or use the POST request on the policy entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // Stateful or Stateless nature of security policy is enforced on all rules in this security policy. When it is stateful, the state of the network connects are tracked and a stateful packet inspection is performed. Layer3 security policies can be stateful or stateless. By default, they are stateful. Layer2 security policies can only be stateless. + Stateful *bool + // Ensures that a 3 way TCP handshake is done before the data packets are sent. tcp_strict=true is supported only for stateful security policies. + TcpStrict *bool +} + +func (s Policy) GetType__() bindings.BindingType { + return PolicyBindingType() +} + +func (s Policy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Policy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Alarm base class of realized policy object +type PolicyAlarmResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // Detailed information about errors from an API call made to the enforcement point, if any. + ErrorDetails *PolicyApiError + // error message to describe the issue + Message *string + // path of the object on which alarm is created + SourceReference *string + // This field will refer to the source site on which the alarm is generated. This field is populated by GM, when it receives corresponding notification from LM. + SourceSiteId *string +} + +func (s PolicyAlarmResource) GetType__() bindings.BindingType { + return PolicyAlarmResourceBindingType() +} + +func (s PolicyAlarmResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyAlarmResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// PolicyAlarmResource list result +type PolicyAlarmResourceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of alarm resources + Results []PolicyAlarmResource +} + +func (s PolicyAlarmResourceListResult) GetType__() bindings.BindingType { + return PolicyAlarmResourceListResultBindingType() +} + +func (s PolicyAlarmResourceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyAlarmResourceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed information about an API Error +type PolicyApiError struct { + // Further details about the error + Details *string + // A numeric error code format: int64 + ErrorCode *int64 + // Additional data about the error + ErrorData *data.StructValue + // A description of the error + ErrorMessage *string + // The module name where the error occurred + ModuleName *string + // Other errors related to this error + RelatedErrors []PolicyRelatedApiError +} + +func (s PolicyApiError) GetType__() bindings.BindingType { + return PolicyApiErrorBindingType() +} + +func (s PolicyApiError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyApiError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Policy Attributes data holder +type PolicyAttributes struct { + // Possible values are: + // + // * PolicyAttributes#PolicyAttributes_DATATYPE_STRING + // + // Datatype for attribute + Datatype *string + // Description for attribute value + Description *string + // Describes whether the APP_ID value is ALG type or not. + IsALGType *bool + // Possible values are: + // + // * PolicyAttributes#PolicyAttributes_KEY_APP_ID + // * PolicyAttributes#PolicyAttributes_KEY_DOMAIN_NAME + // * PolicyAttributes#PolicyAttributes_KEY_URL_CATEGORY + // + // Key for attribute + Key *string + // Reference to sub attributes for the attribute + SubAttributes []PolicySubAttributes + // Multiple attribute values can be specified as elements of array. + Value []string +} +const PolicyAttributes_DATATYPE_STRING = "STRING" +const PolicyAttributes_KEY_APP_ID = "APP_ID" +const PolicyAttributes_KEY_DOMAIN_NAME = "DOMAIN_NAME" +const PolicyAttributes_KEY_URL_CATEGORY = "URL_CATEGORY" + +func (s PolicyAttributes) GetType__() bindings.BindingType { + return PolicyAttributesBindingType() +} + +func (s PolicyAttributes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyAttributes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A Policy Based VPN requires to define protect rules that match local and peer subnets. IPSec security associations is negotiated for each pair of local and peer subnet. +type PolicyBasedIPSecVpnSession struct { + // Rules + Rules []IPSecVpnRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_RESOURCE_TYPE_POLICYBASEDIPSECVPNSESSION + // * IPSecVpnSession#IPSecVpnSession_RESOURCE_TYPE_ROUTEBASEDIPSECVPNSESSION + // + // A Policy Based VPN requires to define protect rules that match local and peer subnets. IPSec security associations is negotiated for each pair of local and peer subnet. A Route Based VPN is more flexible, more powerful and recommended over policy based VPN. IP Tunnel port is created and all traffic routed via tunnel port is protected. Routes can be configured statically or can be learned through BGP. A route based VPN is must for establishing redundant VPN session to remote site. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_AUTHENTICATION_MODE_PSK + // * IPSecVpnSession#IPSecVpnSession_AUTHENTICATION_MODE_CERTIFICATE + // + // Peer authentication mode. PSK - In this mode a secret key shared between local and peer sites is to be used for authentication. The secret key can be a string with a maximum length of 128 characters. CERTIFICATE - In this mode a certificate defined at the global level is to be used for authentication. + AuthenticationMode *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_CNSA + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_SUITE_B_GCM_128 + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_SUITE_B_GCM_256 + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_PRIME + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_FOUNDATION + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_FIPS + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_NONE + // + // Compliance suite. + ComplianceSuite *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_INITIATOR + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_RESPOND_ONLY + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_ON_DEMAND + // + // Connection initiation mode used by local endpoint to establish ike connection with peer site. INITIATOR - In this mode local endpoint initiates tunnel setup and will also respond to incoming tunnel setup requests from peer gateway. RESPOND_ONLY - In this mode, local endpoint shall only respond to incoming tunnel setup requests. It shall not initiate the tunnel setup. ON_DEMAND - In this mode local endpoint will initiate tunnel creation once first packet matching the policy rule is received and will also respond to incoming initiation request. + ConnectionInitiationMode *string + // Policy path referencing Dead Peer Detection (DPD) profile. Default is set to system default profile. + DpdProfilePath *string + // Enable/Disable IPSec VPN session. + Enabled *bool + // Policy path referencing IKE profile to be used. Default is set according to system default profile. + IkeProfilePath *string + // Policy path referencing Local endpoint. + LocalEndpointPath *string + // Public IPV4 address of the remote device terminating the VPN connection. + PeerAddress *string + // Peer ID to uniquely identify the peer site. The peer ID is the public IP address of the remote device terminating the VPN tunnel. When NAT is configured for the peer, enter the private IP address of the peer. + PeerId *string + // IPSec Pre-shared key. Maximum length of this field is 128 characters. + Psk *string + // TCP Maximum Segment Size Clamping Direction and Value. + TcpMssClamping *TcpMaximumSegmentSizeClamping + // Policy path referencing Tunnel profile to be used. Default is set to system default profile. + TunnelProfilePath *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PolicyBasedIPSecVpnSession__TYPE_IDENTIFIER = "PolicyBasedIPSecVpnSession" + +func (s PolicyBasedIPSecVpnSession) GetType__() bindings.BindingType { + return PolicyBasedIPSecVpnSessionBindingType() +} + +func (s PolicyBasedIPSecVpnSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyBasedIPSecVpnSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A Policy-based L3Vpn session is a configuration in which a specific vpn tunnel is referenced in a policy whose action is set as tunnel. +type PolicyBasedL3VpnSession struct { + // L3Vpn rules that are specific to the L3Vpn. Only L3Vpn rules with PROTECT action are supported. + Rules []L3VpnRule + // Possible values are: + // + // * L3VpnSession#L3VpnSession_RESOURCE_TYPE_POLICYBASEDL3VPNSESSION + // * L3VpnSession#L3VpnSession_RESOURCE_TYPE_ROUTEBASEDL3VPNSESSION + // + // - A Policy Based L3Vpn is a configuration in which protect rules to match local and remote subnet needs to be defined. Tunnel is established for each pair of local and remote subnet defined in protect rules. - A Route Based L3Vpn is more flexible, more powerful and recommended over policy based. IP Tunnel subnet is created and all traffic routed through tunnel subnet (commonly known as VTI) is sent over tunnel. Routes can be learned through BGP. A route based L3Vpn is required when using redundant L3Vpn. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PolicyBasedL3VpnSession__TYPE_IDENTIFIER = "PolicyBasedL3VpnSession" + +func (s PolicyBasedL3VpnSession) GetType__() bindings.BindingType { + return PolicyBasedL3VpnSessionBindingType() +} + +func (s PolicyBasedL3VpnSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyBasedL3VpnSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type PolicyBgpNeighborStatus struct { + // Address families of BGP neighbor + AddressFamilies []BgpAddressFamily + // BGP capabilities sent to BGP neighbor. + AnnouncedCapabilities []string + // Count of connection drop format: int64 + ConnectionDropCount *int64 + // Possible values are: + // + // * PolicyBgpNeighborStatus#PolicyBgpNeighborStatus_CONNECTION_STATE_INVALID + // * PolicyBgpNeighborStatus#PolicyBgpNeighborStatus_CONNECTION_STATE_IDLE + // * PolicyBgpNeighborStatus#PolicyBgpNeighborStatus_CONNECTION_STATE_CONNECT + // * PolicyBgpNeighborStatus#PolicyBgpNeighborStatus_CONNECTION_STATE_ACTIVE + // * PolicyBgpNeighborStatus#PolicyBgpNeighborStatus_CONNECTION_STATE_OPEN_SENT + // * PolicyBgpNeighborStatus#PolicyBgpNeighborStatus_CONNECTION_STATE_OPEN_CONFIRM + // * PolicyBgpNeighborStatus#PolicyBgpNeighborStatus_CONNECTION_STATE_ESTABLISHED + // * PolicyBgpNeighborStatus#PolicyBgpNeighborStatus_CONNECTION_STATE_UNKNOWN + // + // Current state of the BGP session. + ConnectionState *string + // Transport node + EdgePath *string + // Count of connections established format: int64 + EstablishedConnectionCount *int64 + // Current state of graceful restart of BGP neighbor. Possible values are - 1. GR_AND_HELPER - Graceful restart with Helper 2. HELPER_ONLY - Helper only 3. DISABLE - Disabled + GracefulRestartMode *string + // If a HELLO packet is not seen from BGP Peer withing hold_time then BGP neighbor will be marked as down. format: int64 + HoldTime *int64 + // Time in ms to wait for HELLO packet from BGP peer format: int64 + KeepAliveInterval *int64 + // Timestamp when the data was last updated, unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // TCP port number of Local BGP connection format: int64 + LocalPort *int64 + // Count of messages received from the neighbor format: int64 + MessagesReceived *int64 + // Count of messages sent to the neighbor format: int64 + MessagesSent *int64 + // BGP capabilities negotiated with BGP neighbor. + NegotiatedCapability []string + // The IP of the BGP neighbor format: ip + NeighborAddress *string + // Router ID of the BGP neighbor. + NeighborRouterId *string + // AS number of the BGP neighbor + RemoteAsNumber *string + // TCP port number of remote BGP Connection format: int64 + RemotePort *int64 + // Remote site details. + RemoteSite *ResourceReference + // The Ip address of logical port format: ip + SourceAddress *string + // Policy path to Tier0 + Tier0Path *string + // Time(in milliseconds) since connection was established. format: int64 + TimeSinceEstablished *int64 + // Sum of in prefixes counts across all address families. format: int64 + TotalInPrefixCount *int64 + // Sum of out prefixes counts across all address families. format: int64 + TotalOutPrefixCount *int64 +} +const PolicyBgpNeighborStatus_CONNECTION_STATE_INVALID = "INVALID" +const PolicyBgpNeighborStatus_CONNECTION_STATE_IDLE = "IDLE" +const PolicyBgpNeighborStatus_CONNECTION_STATE_CONNECT = "CONNECT" +const PolicyBgpNeighborStatus_CONNECTION_STATE_ACTIVE = "ACTIVE" +const PolicyBgpNeighborStatus_CONNECTION_STATE_OPEN_SENT = "OPEN_SENT" +const PolicyBgpNeighborStatus_CONNECTION_STATE_OPEN_CONFIRM = "OPEN_CONFIRM" +const PolicyBgpNeighborStatus_CONNECTION_STATE_ESTABLISHED = "ESTABLISHED" +const PolicyBgpNeighborStatus_CONNECTION_STATE_UNKNOWN = "UNKNOWN" + +func (s PolicyBgpNeighborStatus) GetType__() bindings.BindingType { + return PolicyBgpNeighborStatusBindingType() +} + +func (s PolicyBgpNeighborStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyBgpNeighborStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type PolicyBgpNeighborsStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Status of BGP neighbors of the Tier0 + Results []PolicyBgpNeighborStatus +} + +func (s PolicyBgpNeighborsStatusListResult) GetType__() bindings.BindingType { + return PolicyBgpNeighborsStatusListResultBindingType() +} + +func (s PolicyBgpNeighborsStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyBgpNeighborsStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type PolicyComplianceStatus struct { + // Timestamp of last update format: int64 + LastUpdatedTime *int64 + // List of non compliant configuration and impacted services + NonCompliantConfigs []PolicyNonCompliantConfig +} + +func (s PolicyComplianceStatus) GetType__() bindings.BindingType { + return PolicyComplianceStatusBindingType() +} + +func (s PolicyComplianceStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyComplianceStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents an object on the desired state. +type PolicyConfigResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s PolicyConfigResource) GetType__() bindings.BindingType { + return PolicyConfigResourceBindingType() +} + +func (s PolicyConfigResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyConfigResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// An entity that encapsulates attributes and sub-attributes of various network services (eg. L7 services, domain name, encryption algorithm) The entity will be consumed in firewall rules and can be added in new tuple called profile in firewall rules. To get a list of supported attributes and sub-attributes fire the following REST API GET https://<policy-mgr>/policy/api/v1/infra/context-profiles/attributes +type PolicyContextProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Property containing attributes/sub-attributes for Policy Context Profile. + Attributes []PolicyAttributes +} + +func (s PolicyContextProfile) GetType__() bindings.BindingType { + return PolicyContextProfileBindingType() +} + +func (s PolicyContextProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyContextProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// List result of PolicyContextProfiles +type PolicyContextProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of PolicyContextProfiles + Results []PolicyContextProfile +} + +func (s PolicyContextProfileListResult) GetType__() bindings.BindingType { + return PolicyContextProfileListResultBindingType() +} + +func (s PolicyContextProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyContextProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DNS forwarder nslookup answer per enforcement point. +type PolicyDnsAnswerPerEnforcementPoint struct { + // Policy path referencing the enforcement point from where the DNS forwarder nslookup answer is fetched. + EnforcementPointPath *string + // Possible values are: + // + // * PolicyDnsAnswerPerEnforcementPoint#PolicyDnsAnswerPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSANSWER + // + // Resource type of the DNS forwarder nslookup answer. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PolicyDnsAnswerPerEnforcementPoint__TYPE_IDENTIFIER = "PolicyDnsAnswerPerEnforcementPoint" +const PolicyDnsAnswerPerEnforcementPoint_RESOURCE_TYPE_NSXTDNSANSWER = "NsxTDnsAnswer" + +func (s PolicyDnsAnswerPerEnforcementPoint) GetType__() bindings.BindingType { + return PolicyDnsAnswerPerEnforcementPointBindingType() +} + +func (s PolicyDnsAnswerPerEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyDnsAnswerPerEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Used to configure DNS Forwarder +type PolicyDnsForwarder struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Max of 5 DNS servers can be configured + ConditionalForwarderZonePaths []string + // This is the zone to which DNS requests are forwarded by default + DefaultForwarderZonePath *string + // The flag, which suggests whether the DNS forwarder is enabled or disabled. The default is True. + Enabled *bool + // This is the IP on which the DNS Forwarder listens. format: ipv4 + ListenerIp *string + // Possible values are: + // + // * PolicyDnsForwarder#PolicyDnsForwarder_LOG_LEVEL_DEBUG + // * PolicyDnsForwarder#PolicyDnsForwarder_LOG_LEVEL_INFO + // * PolicyDnsForwarder#PolicyDnsForwarder_LOG_LEVEL_WARNING + // * PolicyDnsForwarder#PolicyDnsForwarder_LOG_LEVEL_ERROR + // * PolicyDnsForwarder#PolicyDnsForwarder_LOG_LEVEL_FATAL + // + // Set log_level to DISABLED will stop dumping fowarder log. + LogLevel *string +} +const PolicyDnsForwarder_LOG_LEVEL_DEBUG = "DEBUG" +const PolicyDnsForwarder_LOG_LEVEL_INFO = "INFO" +const PolicyDnsForwarder_LOG_LEVEL_WARNING = "WARNING" +const PolicyDnsForwarder_LOG_LEVEL_ERROR = "ERROR" +const PolicyDnsForwarder_LOG_LEVEL_FATAL = "FATAL" + +func (s PolicyDnsForwarder) GetType__() bindings.BindingType { + return PolicyDnsForwarderBindingType() +} + +func (s PolicyDnsForwarder) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyDnsForwarder._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Used to configure zones on DNS Forwarder +type PolicyDnsForwarderZone struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // List of domain names on which conditional forwarding is based. This field is required if the DNS Zone is being used for a conditional forwarder. This field will also be used for conditional reverse lookup. Example 1, if for one of the zones, one of the entries in the fqdn is example.com, all the DNS requests under the domain example.com will be served by the corresponding upstream DNS server. Example 2, if for one of the zones, one of the entries in the fqdn list is \"13.12.30.in-addr.arpa\", reverse lookup for 30.12.13.0/24 will go to the corresponding DNS server. + DnsDomainNames []string + // The source IP used by the DNS Forwarder zone. format: ipv4 + SourceIp *string + // Max of 3 DNS servers can be configured format: ipv4 + UpstreamServers []string +} + +func (s PolicyDnsForwarderZone) GetType__() bindings.BindingType { + return PolicyDnsForwarderZoneBindingType() +} + +func (s PolicyDnsForwarderZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyDnsForwarderZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of DNS Forwarder Zones +type PolicyDnsForwarderZoneListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Dns Forwarder Zone list results + Results []PolicyDnsForwarderZone +} + +func (s PolicyDnsForwarderZoneListResult) GetType__() bindings.BindingType { + return PolicyDnsForwarderZoneListResultBindingType() +} + +func (s PolicyDnsForwarderZoneListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyDnsForwarderZoneListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A draft which stores the system generated as well as user intended changes in a hierarchical body format. +type PolicyDraft struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Flag to indicate whether draft is auto created. True indicates that the draft is an auto draft. False indicates that the draft is a manual draft. + IsAutoDraft *bool + // Comments for a policy draft lock/unlock. + LockComments *string + // ID of the user who last modified the lock for a policy draft. + LockModifiedBy *string + // Policy draft locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Indicates whether a draft should be locked. If the draft is locked by an user, then no other user would be able to modify or publish this draft. Once the user releases the lock, other users can then modify or publish this draft. + Locked *bool + // When specified, a manual draft will be created w.r.t. the specified draft. If not specified, manual draft will be created w.r.t. the current published configuration. For an auto draft, this will always be null. + RefDraftPath *string + // Configuration changes against the current configuration, tracked by the system. The value is stored in a hierarchical body format. + SystemArea *Infra + // These are user defined configuration changes, which are applicable only in case of manual drafts. During the publish of a draft, system_area changes gets applied first, and then these changes. The value must be in a hierarchical body format. + UserArea *Infra +} + +func (s PolicyDraft) GetType__() bindings.BindingType { + return PolicyDraftBindingType() +} + +func (s PolicyDraft) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyDraft._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This holds the list of policy drafts. +type PolicyDraftListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of policy drafts. + Results []PolicyDraft +} + +func (s PolicyDraftListResult) GetType__() bindings.BindingType { + return PolicyDraftListResultBindingType() +} + +func (s PolicyDraftListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyDraftListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Edge Cluster. +type PolicyEdgeCluster struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Flag to indicate status of inter site l2 and l3 forwarding in federation. + InterSiteForwardingEnabled *bool + // UUID of Edge Cluster on NSX-T enforcement point. + NsxId *string + // List of remote tunnel endpoint ipaddress configured on edge cluster. format: ip + RtepIps []string +} + +func (s PolicyEdgeCluster) GetType__() bindings.BindingType { + return PolicyEdgeClusterBindingType() +} + +func (s PolicyEdgeCluster) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyEdgeCluster._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Edge Cluster +type PolicyEdgeClusterListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Edge Cluster list result. + Results []PolicyEdgeCluster +} + +func (s PolicyEdgeClusterListResult) GetType__() bindings.BindingType { + return PolicyEdgeClusterListResultBindingType() +} + +func (s PolicyEdgeClusterListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyEdgeClusterListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Edge Node. +type PolicyEdgeNode struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Member index of edge node in edge cluster. format: int64 + MemberIndex *int64 + // UUID of edge node on NSX-T enforcement point. + NsxId *string +} + +func (s PolicyEdgeNode) GetType__() bindings.BindingType { + return PolicyEdgeNodeBindingType() +} + +func (s PolicyEdgeNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyEdgeNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Edge Node +type PolicyEdgeNodeListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Edge Node list result. + Results []PolicyEdgeNode +} + +func (s PolicyEdgeNodeListResult) GetType__() bindings.BindingType { + return PolicyEdgeNodeListResultBindingType() +} + +func (s PolicyEdgeNodeListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyEdgeNodeListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type PolicyExcludeList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // List of the members in the exclude list + Members []string +} + +func (s PolicyExcludeList) GetType__() bindings.BindingType { + return PolicyExcludeListBindingType() +} + +func (s PolicyExcludeList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyExcludeList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// It represent the resource with details of name and fields it owns. +type PolicyFineTuningResourceInfo struct { + // List of all field of any resource + Fields []PolicyFineTuningResourceInfoDetail + // It will represent resource with name and fields. + ResourceName *string +} + +func (s PolicyFineTuningResourceInfo) GetType__() bindings.BindingType { + return PolicyFineTuningResourceInfoBindingType() +} + +func (s PolicyFineTuningResourceInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFineTuningResourceInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains the details of resource field +type PolicyFineTuningResourceInfoDetail struct { + // It will represent resource with name and fields. + FieldName *string + // List of all field of any resource + SubType *PolicyFineTuningResourceInfo +} + +func (s PolicyFineTuningResourceInfoDetail) GetType__() bindings.BindingType { + return PolicyFineTuningResourceInfoDetailBindingType() +} + +func (s PolicyFineTuningResourceInfoDetail) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFineTuningResourceInfoDetail._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between CPU Memory Thresholds Profile and Transport Node. Using this entity, user can specify intent for applying Firewall CPU Memory Thresholds Profile to particular Transport Node. +type PolicyFirewallCPUMemThresholdsProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated Profile + ProfilePath *string + // Sequence number is used to resolve conflicts when two profiles get applied to a single node. Lower value gets higher precedence. Two binding maps having the same profile path should have the same sequence number. format: int64 + SequenceNumber *int64 + // References of transport nodes on which the profile intended to be applied. + TransportNodes []PolicyResourceReference +} + +func (s PolicyFirewallCPUMemThresholdsProfileBindingMap) GetType__() bindings.BindingType { + return PolicyFirewallCPUMemThresholdsProfileBindingMapBindingType() +} + +func (s PolicyFirewallCPUMemThresholdsProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallCPUMemThresholdsProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Firewall CPU Memory Thresholds Profile Binding Maps +type PolicyFirewallCPUMemThresholdsProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Firewall CPU Memory Thresholds Profile Binding Map list results + Results []PolicyFirewallCPUMemThresholdsProfileBindingMap +} + +func (s PolicyFirewallCPUMemThresholdsProfileBindingMapListResult) GetType__() bindings.BindingType { + return PolicyFirewallCPUMemThresholdsProfileBindingMapListResultBindingType() +} + +func (s PolicyFirewallCPUMemThresholdsProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallCPUMemThresholdsProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A profile holding CPU and memory thresholds configuration. +type PolicyFirewallCpuMemThresholdsProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // CPU utilization thresholds percentage to monitor and report for distributed firewall. format: int64 + CpuThresholdPercentage *int64 + // Heap memory thresholds percentage to monitor and report for distributed firewall. format: int64 + MemThresholdPercentage *int64 +} + +func (s PolicyFirewallCpuMemThresholdsProfile) GetType__() bindings.BindingType { + return PolicyFirewallCpuMemThresholdsProfileBindingType() +} + +func (s PolicyFirewallCpuMemThresholdsProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallCpuMemThresholdsProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of PolicyFirewallCpuMemThresholdsProfile +type PolicyFirewallCpuMemThresholdsProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // PolicyFirewallCpuMemThresholdsProfile list results + Results []PolicyFirewallCpuMemThresholdsProfile +} + +func (s PolicyFirewallCpuMemThresholdsProfileListResult) GetType__() bindings.BindingType { + return PolicyFirewallCpuMemThresholdsProfileListResultBindingType() +} + +func (s PolicyFirewallCpuMemThresholdsProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallCpuMemThresholdsProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between Firewall Flood Protection profile and Group. Using this entity, user can specify intent for applying Firewall Flood Protection profile to particular Group. +type PolicyFirewallFloodProtectionProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated Profile + ProfilePath *string + // Sequence number is used to resolve conflicts when two profiles get applied to a single port. Lower value gets higher precedence. Two binding maps having the same profile path should have the same sequence number. format: int64 + SequenceNumber *int64 +} + +func (s PolicyFirewallFloodProtectionProfileBindingMap) GetType__() bindings.BindingType { + return PolicyFirewallFloodProtectionProfileBindingMapBindingType() +} + +func (s PolicyFirewallFloodProtectionProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallFloodProtectionProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Firewall Flood Protection Profile Binding Maps +type PolicyFirewallFloodProtectionProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Firewall Flood Protection Profile Binding Map list results + Results []PolicyFirewallFloodProtectionProfileBindingMap +} + +func (s PolicyFirewallFloodProtectionProfileBindingMapListResult) GetType__() bindings.BindingType { + return PolicyFirewallFloodProtectionProfileBindingMapListResultBindingType() +} + +func (s PolicyFirewallFloodProtectionProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallFloodProtectionProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// An entity that encapsulates attributes to schedule firewall rules to be active to allow or block traffic for a specific period of time. Note that at least one property out of \"days\", \"start_time\", \"end_time\", \"start_date\", \"end_date\" is required. +type PolicyFirewallScheduler struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * PolicyFirewallScheduler#PolicyFirewallScheduler_DAYS_SUNDAY + // * PolicyFirewallScheduler#PolicyFirewallScheduler_DAYS_MONDAY + // * PolicyFirewallScheduler#PolicyFirewallScheduler_DAYS_TUESDAY + // * PolicyFirewallScheduler#PolicyFirewallScheduler_DAYS_WEDNESDAY + // * PolicyFirewallScheduler#PolicyFirewallScheduler_DAYS_THURSDAY + // * PolicyFirewallScheduler#PolicyFirewallScheduler_DAYS_FRIDAY + // * PolicyFirewallScheduler#PolicyFirewallScheduler_DAYS_SATURDAY + // + // Days of week on which rules will be enforced. If property is omitted, then days of the week will not considered while calculating the firewall schedule. It should not be present when the recurring flag is false. + Days []string + // End date on which schedule to end. Example, 12/22/2019. + EndDate *string + // If recurring field is set false, then this field must be present. The schedule will be enforced till the end time of the specified end date. If recurring field is set true, then this field should not be present. + EndTime *string + // Flag to indicate whether firewall schedule recurs or not. The default value is true and it should be set to false when the firewall schedule does not recur and is a one time time interval. + Recurring *bool + // Start date on which schedule to start. Example, 02/22/2019. + StartDate *string + // Time in 24 hour and minutes in multiple of 30. Example, 9:00. If recurring field is set false, then this field must be present. The schedule will start getting enforced from the start time of the specified start date. If recurring field is set true, then this field should not be present. + StartTime *string + // The recurring time interval in a day during which the schedule will be applicable. It should not be present when the recurring flag is false. + TimeInterval []PolicyTimeIntervalValue + // Possible values are: + // + // * PolicyFirewallScheduler#PolicyFirewallScheduler_TIMEZONE_UTC + // * PolicyFirewallScheduler#PolicyFirewallScheduler_TIMEZONE_LOCAL + // + // Host Timezone to be used to enforce firewall rules. + Timezone *string +} +const PolicyFirewallScheduler_DAYS_SUNDAY = "SUNDAY" +const PolicyFirewallScheduler_DAYS_MONDAY = "MONDAY" +const PolicyFirewallScheduler_DAYS_TUESDAY = "TUESDAY" +const PolicyFirewallScheduler_DAYS_WEDNESDAY = "WEDNESDAY" +const PolicyFirewallScheduler_DAYS_THURSDAY = "THURSDAY" +const PolicyFirewallScheduler_DAYS_FRIDAY = "FRIDAY" +const PolicyFirewallScheduler_DAYS_SATURDAY = "SATURDAY" +const PolicyFirewallScheduler_TIMEZONE_UTC = "UTC" +const PolicyFirewallScheduler_TIMEZONE_LOCAL = "LOCAL" + +func (s PolicyFirewallScheduler) GetType__() bindings.BindingType { + return PolicyFirewallSchedulerBindingType() +} + +func (s PolicyFirewallScheduler) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallScheduler._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// List result of PolicyFirewallSchedulers +type PolicyFirewallSchedulerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of PolicyFirewallSchedulers + Results []PolicyFirewallScheduler +} + +func (s PolicyFirewallSchedulerListResult) GetType__() bindings.BindingType { + return PolicyFirewallSchedulerListResultBindingType() +} + +func (s PolicyFirewallSchedulerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallSchedulerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A profile holding TCP, UDP and ICMP session timeout configuration. +type PolicyFirewallSessionTimerProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // The timeout value for the connection after an ICMP error came back in response to an ICMP packet. format: int64 + IcmpErrorReply *int64 + // The timeout value of connection in seconds after the first packet. This will be the initial timeout for the new ICMP flow. format: int64 + IcmpFirstPacket *int64 + // The timeout value of connection in seconds after one endpoint sends an RST. format: int64 + TcpClosed *int64 + // The timeout value of connection in seconds after the first FIN has been sent. format: int64 + TcpClosing *int64 + // The timeout value of connection in seconds once the connection has become fully established. format: int64 + TcpEstablished *int64 + // The timeout value of connection in seconds after both FINs have been exchanged and connection is closed. format: int64 + TcpFinwait *int64 + // The timeout value of connection in seconds after the first packet has been sent. format: int64 + TcpFirstPacket *int64 + // The timeout value of connection in seconds after a second packet has been transferred. format: int64 + TcpOpening *int64 + // The timeout value of connection in seconds after the first packet. This will be the initial timeout for the new UDP flow. format: int64 + UdpFirstPacket *int64 + // The timeout value of connection in seconds if both hosts have sent packets. format: int64 + UdpMultiple *int64 + // The timeout value of connection in seconds if the source host sends more than one packet but the destination host has never sent one back. format: int64 + UdpSingle *int64 +} + +func (s PolicyFirewallSessionTimerProfile) GetType__() bindings.BindingType { + return PolicyFirewallSessionTimerProfileBindingType() +} + +func (s PolicyFirewallSessionTimerProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallSessionTimerProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between Firewall Timer session profile and Group. Using this entity, user can specify intent for applying Firewall Timer session profile to particular Group. +type PolicyFirewallSessionTimerProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated Firewall Timer Session Profile + FirewallSessionTimerProfilePath *string + // Sequence number is used to resolve conflicts when two profiles get applied to a single port. Lower value gets higher precedence. Two binding maps having the same profile path should have the same sequence number. format: int64 + SequenceNumber *int64 +} + +func (s PolicyFirewallSessionTimerProfileBindingMap) GetType__() bindings.BindingType { + return PolicyFirewallSessionTimerProfileBindingMapBindingType() +} + +func (s PolicyFirewallSessionTimerProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallSessionTimerProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Firewall Session Timer Profile Binding Maps +type PolicyFirewallSessionTimerProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Firewall Session Timer Profile Binding Map list results + Results []PolicyFirewallSessionTimerProfileBindingMap +} + +func (s PolicyFirewallSessionTimerProfileBindingMapListResult) GetType__() bindings.BindingType { + return PolicyFirewallSessionTimerProfileBindingMapListResultBindingType() +} + +func (s PolicyFirewallSessionTimerProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallSessionTimerProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Policy Firewall Session timeout profiles +type PolicyFirewallSessionTimerProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Policy Firewall Session timeout profile list results + Results []PolicyFirewallSessionTimerProfile +} + +func (s PolicyFirewallSessionTimerProfileListResult) GetType__() bindings.BindingType { + return PolicyFirewallSessionTimerProfileListResultBindingType() +} + +func (s PolicyFirewallSessionTimerProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyFirewallSessionTimerProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paginated collection of IP members belonging to a Group. +type PolicyGroupIPMembersListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of IP addresses that belong to the given Group format: address-or-block-or-range + Results []string +} + +func (s PolicyGroupIPMembersListResult) GetType__() bindings.BindingType { + return PolicyGroupIPMembersListResultBindingType() +} + +func (s PolicyGroupIPMembersListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyGroupIPMembersListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Details of the member belonging to a Group +type PolicyGroupMemberDetails struct { + // The display name of the member on the enforcement point + DisplayName *string + // The ID of the member on the enforcement point + Id *string + // The path of the member, if relevant + Path *string +} + +func (s PolicyGroupMemberDetails) GetType__() bindings.BindingType { + return PolicyGroupMemberDetailsBindingType() +} + +func (s PolicyGroupMemberDetails) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyGroupMemberDetails._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paginated collection of members belonging to a Group. +type PolicyGroupMembersListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of members that belong to the given Group + Results []PolicyGroupMemberDetails +} + +func (s PolicyGroupMembersListResult) GetType__() bindings.BindingType { + return PolicyGroupMembersListResultBindingType() +} + +func (s PolicyGroupMembersListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyGroupMembersListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Used to specify the display name and value of the IPv4Address. +type PolicyIPAddressInfo struct { + // Value of the IPv4Address. format: ipv4 + AddressValue *string + // Display name used to help identify the IPv4Address. + DisplayName *string + // Next hop used in auto-plumbing of static route. If a value is not provided, static route will not be auto-plumbed. format: ipv4 + NextHop *string +} + +func (s PolicyIPAddressInfo) GetType__() bindings.BindingType { + return PolicyIPAddressInfoBindingType() +} + +func (s PolicyIPAddressInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyIPAddressInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// IGMP profile. +type PolicyIgmpProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Max Response Time inserted into Group-Specific Queries sent in response to Leave Group messages, and is also the amount of time between Group-Specific Query messages. This value may be tuned to modify the \"leave latency\" of the network. A reduced value results in reduced time to detect the loss of the last member of a group. format: int32 + LastMemberQueryInterval *int64 + // Interval(seconds) between general IGMP host-query messages. format: int32 + QueryInterval *int64 + // The query response interval(seconds) is the maximum amount of time that can elapse between when the querier router sends a host-query message and when it receives a response from a host. Configuring this interval allows admins to adjust the burstiness of IGMP messages on the subnet; larger values make the traffic less bursty, as host responses are spread out over a larger interval. The number of seconds represented by the query_max_response_time must be less than the query_interval. format: int32 + QueryMaxResponseTime *int64 + // The Robustness Variable allows tuning for the expected packet loss on a subnet. If a subnet is expected to be lossy, the Robustness Variable may be increased. IGMP is robust to (Robustness Variable-1) packet losses. The Robustness Variable must not be zero, and SHOULD NOT be one. format: int32 + RobustnessVariable *int64 +} + +func (s PolicyIgmpProfile) GetType__() bindings.BindingType { + return PolicyIgmpProfileBindingType() +} + +func (s PolicyIgmpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyIgmpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Parameters to let the admin specify a relative position of a security policy or rule w.r.t to another one. +type PolicyInsertParameters struct { + // The security policy/rule path if operation is 'insert_after' or 'insert_before' + AnchorPath *string + // Possible values are: + // + // * PolicyInsertParameters#PolicyInsertParameters_OPERATION_TOP + // * PolicyInsertParameters#PolicyInsertParameters_OPERATION_BOTTOM + // * PolicyInsertParameters#PolicyInsertParameters_OPERATION_AFTER + // * PolicyInsertParameters#PolicyInsertParameters_OPERATION_BEFORE + // + // Operation + Operation *string +} +const PolicyInsertParameters_OPERATION_TOP = "insert_top" +const PolicyInsertParameters_OPERATION_BOTTOM = "insert_bottom" +const PolicyInsertParameters_OPERATION_AFTER = "insert_after" +const PolicyInsertParameters_OPERATION_BEFORE = "insert_before" + +func (s PolicyInsertParameters) GetType__() bindings.BindingType { + return PolicyInsertParametersBindingType() +} + +func (s PolicyInsertParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyInsertParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier0 or Tier1 interface statistics on specific Enforcement Point. +type PolicyInterfaceStatistics struct { + // The ID of the logical router port + LogicalRouterPortId *string + // Per Node Statistics + PerNodeStatistics []LogicalRouterPortStatisticsPerNode +} + +func (s PolicyInterfaceStatistics) GetType__() bindings.BindingType { + return PolicyInterfaceStatisticsBindingType() +} + +func (s PolicyInterfaceStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyInterfaceStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier0 or Tier1 interface statistics on specific Enforcement Point. +type PolicyInterfaceStatisticsSummary struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Rx *LogicalRouterPortCounters + Tx *LogicalRouterPortCounters + // The ID of the logical router port + LogicalRouterPortId *string + // Policy path for the interface + InterfacePolicyPath *string +} + +func (s PolicyInterfaceStatisticsSummary) GetType__() bindings.BindingType { + return PolicyInterfaceStatisticsSummaryBindingType() +} + +func (s PolicyInterfaceStatisticsSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyInterfaceStatisticsSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Label to reference group of policy entities of same type. +type PolicyLabel struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Policy entity paths referred by the label instance + Refs []string + // Policy intent entity type from PolicyResourceType + Type_ *string +} + +func (s PolicyLabel) GetType__() bindings.BindingType { + return PolicyLabelBindingType() +} + +func (s PolicyLabel) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyLabel._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Domains +type PolicyLabelListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Policy label list results + Results []PolicyLabel +} + +func (s PolicyLabelListResult) GetType__() bindings.BindingType { + return PolicyLabelListResultBindingType() +} + +func (s PolicyLabelListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyLabelListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// All the types of PolicyLbMonitorProfile extend from this abstract class. This is present for extensibility. +type PolicyLbMonitorProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_TCPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_UDPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_ICMPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPSPOLICYLBMONITORPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PolicyLbMonitorProfile__TYPE_IDENTIFIER = "PolicyLbMonitorProfile" +const PolicyLbMonitorProfile_RESOURCE_TYPE_TCPPOLICYLBMONITORPROFILE = "TcpPolicyLbMonitorProfile" +const PolicyLbMonitorProfile_RESOURCE_TYPE_UDPPOLICYLBMONITORPROFILE = "UdpPolicyLbMonitorProfile" +const PolicyLbMonitorProfile_RESOURCE_TYPE_ICMPPOLICYLBMONITORPROFILE = "IcmpPolicyLbMonitorProfile" +const PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPPOLICYLBMONITORPROFILE = "HttpPolicyLbMonitorProfile" +const PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPSPOLICYLBMONITORPROFILE = "HttpsPolicyLbMonitorProfile" + +func (s PolicyLbMonitorProfile) GetType__() bindings.BindingType { + return PolicyLbMonitorProfileBindingType() +} + +func (s PolicyLbMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyLbMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence is enabled on a PolicyLbVirtualServer by binding a persistence profile to it. +type PolicyLbPersistenceProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_L4POLICYLBPERSISTENCEPROFILE + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_L7POLICYLBPERSISTENCEPROFILE + // * PolicyLbPersistenceProfile#PolicyLbPersistenceProfile_RESOURCE_TYPE_CUSTOMPOLICYLBPERSISTENCEPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PolicyLbPersistenceProfile__TYPE_IDENTIFIER = "PolicyLbPersistenceProfile" +const PolicyLbPersistenceProfile_RESOURCE_TYPE_L4POLICYLBPERSISTENCEPROFILE = "L4PolicyLbPersistenceProfile" +const PolicyLbPersistenceProfile_RESOURCE_TYPE_L7POLICYLBPERSISTENCEPROFILE = "L7PolicyLbPersistenceProfile" +const PolicyLbPersistenceProfile_RESOURCE_TYPE_CUSTOMPOLICYLBPERSISTENCEPROFILE = "CustomPolicyLbPersistenceProfile" + +func (s PolicyLbPersistenceProfile) GetType__() bindings.BindingType { + return PolicyLbPersistenceProfileBindingType() +} + +func (s PolicyLbPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyLbPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Defining access of a Group from a PolicyLbVirtualServer and binding to PolicyLbMonitorProfile. +type PolicyLbPoolAccess struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * PolicyLbPoolAccess#PolicyLbPoolAccess_ALGORITHM_ROUND_ROBIN + // * PolicyLbPoolAccess#PolicyLbPoolAccess_ALGORITHM_LEAST_CONNECTION + // + // Load balanding algorithm controls how the incoming connections are distributed among the members. - ROUND_ROBIN - requests to the application servers are distributed in a round-robin fashion, - LEAST_CONNECTION - next request is assigned to the server with the least number of active connections + Algorithm *string + // IP Port list for applications within the Group to allow for non-uniform port usage by applications + IpPortList []IPAddressPortPair + // Path of the PolicyLbMonitorProfile to actively monitor the PolicyLbPoolAccess's Group + LbMonitorProfile *string + // Port for LoadBalancer to send connections to the PolicyLbPoolAccess's Group. Pool_port could be optional, if it is not specified, LB will use PolicyLbVirtualServer port to connect to backend servers. If the PolicyLbMonitorProfile is configured in PolicyLbPoolAccess and active monitor IP protocol is TCP/UDP(which requires TCP or UDP port number), monitor_port should be specified if pool_port is unset. format: int32 + PoolPort *int64 + // Possible values are: + // + // * PolicyLbPoolAccess#PolicyLbPoolAccess_SOURCE_NAT_ENABLED + // * PolicyLbPoolAccess#PolicyLbPoolAccess_SOURCE_NAT_DISABLED + // + // Depending on the topology, Source NAT (SNAT) may be required to ensure traffic from the server destined to the client is received by the load balancer. SNAT can be enabled per pool. If SNAT is not enabled for a pool, then load balancer uses the client IP and port (spoofing) while establishing connections to the servers. This is referred to as no-SNAT or TRANSPARENT mode. SNAT is enabled by default and will use the load balancer interface IP and an ephemeral port as the source IP and port of the server side connection. + SourceNat *string +} +const PolicyLbPoolAccess_ALGORITHM_ROUND_ROBIN = "ROUND_ROBIN" +const PolicyLbPoolAccess_ALGORITHM_LEAST_CONNECTION = "LEAST_CONNECTION" +const PolicyLbPoolAccess_SOURCE_NAT_ENABLED = "ENABLED" +const PolicyLbPoolAccess_SOURCE_NAT_DISABLED = "DISABLED" + +func (s PolicyLbPoolAccess) GetType__() bindings.BindingType { + return PolicyLbPoolAccessBindingType() +} + +func (s PolicyLbPoolAccess) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyLbPoolAccess._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Binding of a LbPoolAccess and Group to a PolicyLbVirtualServer used to route application traffic passing through load balancers. PolicyLbRule uses match conditions to match application traffic passing through a PolicyLbVirtualServer using HTTP or HTTPS. Can bind multiple PolicyLbVirtualServers to a Group. Each PolicyLbRule consists of two optional match conditions, each match contidion defines a criterion for application traffic. If no match conditions are specified, then the PolicyLbRule will always match and it is used typically to define default rules. If more than one match condition is specified, then matching strategy determines if all conditions should match or any one condition should match for the PolicyLbRule to be considered a match. A match indicates that the PolicyLbVirtualServer should route the request to the Group (parent of PolicyLbRule). +type PolicyLbRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // This condition is used to match HTTP request messages by the specific HTTP header field, Host. The Host request header specifies the domain name of the server. The supplied Host HTTP header match condition will be matched as a regular expression. The regular expressions in load balancer rules use the features common to both Java regular expressions and Perl Compatible Regular Expressions (PCREs) with some restrictions. Reference http://www.pcre .org for PCRE and the NSX-T Administrator's Guide for the restrictions. Please note, when regular expressions are used in JSON (JavaScript Object Notation) string, every backslash character (\\) needs to be escaped by one additional backslash character. + HostMatch *string + // The path of PolicyLbVirtualServer to bind to this PolicyLbRule and its Group + LbVirtualServer *string + // Possible values are: + // + // * PolicyLbRule#PolicyLbRule_MATCH_STRATEGY_ALL + // * PolicyLbRule#PolicyLbRule_MATCH_STRATEGY_ANY + // + // If more than one match condition is specified, then matching strategy determines if all conditions should match or any one condition should match for the LB Rule to be considered a match. - ALL indicates that both host_match and path_match must match for this PolicyLbRule to be considered a match - ANY indicates that either host_match or patch match may match for this PolicyLbRule to be considered a match + MatchStrategy *string + // This condition is used to match URIs(Uniform Resource Identifier) of HTTP request messages. The URI field can be specified as a regluar expression. If an HTTP request message is requesting an URI which matches specified regular expression, it matches the condition. The syntax of whole URI looks like this: scheme:[//[user[:password]\\\\@]host[:port]][/path][?query][#fragment] This condition matches only the path part of entire URI. The path_match field is used as a regular expression to match URI path of HTTP requests. For example, to match any URI that has \"/image/\" or \"/images/\", uri field can be specified as: \"/image[s]?/\". The regular expressions in load balancer rules use the features common to both Java regular expressions and Perl Compatible Regular Expressions (PCREs) with some restrictions. Reference http://www.pcre .org for PCRE and the NSX-T Administrator's Guide for the restrictions. Please note, when regular expressions are used in JSON (JavaScript Object Notation) string, every backslash character (\\) needs to be escaped by one additional backslash character. + PathMatch *string + // This field is used to resolve conflicts between multiple PolicyLbRules associated with a single PolicyLbVirtualServer and will be applied numerically or low to high format: int32 + SequenceNumber *int64 +} +const PolicyLbRule_MATCH_STRATEGY_ALL = "ALL" +const PolicyLbRule_MATCH_STRATEGY_ANY = "ANY" + +func (s PolicyLbRule) GetType__() bindings.BindingType { + return PolicyLbRuleBindingType() +} + +func (s PolicyLbRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyLbRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// All the types of PolicyLbVirtualServer extend from this abstract class. This is present for extensibility. +type PolicyLbVirtualServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_TCPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_UDPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPSPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_CUSTOMPOLICYLBVIRTUALSERVER + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If access log is enabled, all HTTP requests sent to an L7 virtual server are logged to the access log file. Both successful requests (backend server returns 2xx) and unsuccessful requests (backend server returns 4xx or 5xx) are logged to access log, if enabled. + AccessLogEnabled *bool + // Configures the IP address of the PolicyLbVirtualServer where it receives all client connections and distributes them among the backend servers. format: ip + IpAddress *string + // Path to optional object that enables persistence on a virtual server allowing related client connections to be sent to the same backend server. Persistence is disabled by default. + LbPersistenceProfile *string + // Ports contains a list of at least one port or port range such as \"80\", \"1234-1236\". Each port element in the list should be a single port or a single port range. format: port-or-range + Ports []string + // Path to router type object that PolicyLbVirtualServer connects to. The only supported router object is Network. + RouterPath *string + TrafficSource *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PolicyLbVirtualServer__TYPE_IDENTIFIER = "PolicyLbVirtualServer" +const PolicyLbVirtualServer_RESOURCE_TYPE_TCPPOLICYLBVIRTUALSERVER = "TcpPolicyLbVirtualServer" +const PolicyLbVirtualServer_RESOURCE_TYPE_UDPPOLICYLBVIRTUALSERVER = "UdpPolicyLbVirtualServer" +const PolicyLbVirtualServer_RESOURCE_TYPE_HTTPPOLICYLBVIRTUALSERVER = "HttpPolicyLbVirtualServer" +const PolicyLbVirtualServer_RESOURCE_TYPE_HTTPSPOLICYLBVIRTUALSERVER = "HttpsPolicyLbVirtualServer" +const PolicyLbVirtualServer_RESOURCE_TYPE_CUSTOMPOLICYLBVIRTUALSERVER = "CustomPolicyLbVirtualServer" + +func (s PolicyLbVirtualServer) GetType__() bindings.BindingType { + return PolicyLbVirtualServerBindingType() +} + +func (s PolicyLbVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyLbVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of security policies +type PolicyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string +} + +func (s PolicyListResult) GetType__() bindings.BindingType { + return PolicyListResultBindingType() +} + +func (s PolicyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Multicast routing configuration. +type PolicyMulticastConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Enable/disable Multicast Configuration. + Enabled *bool + // Updates to IGMP profile applied on all Tier0 gateways consuming the configuration. + IgmpProfilePath *string + // Updates to PIM profile applied on all Tier0 gateways consuming the configuration. + PimProfilePath *string + // Replication multicast range. Required when enabled. format: ipv4-cidr-block + ReplicationMulticastRange *string +} + +func (s PolicyMulticastConfig) GetType__() bindings.BindingType { + return PolicyMulticastConfigBindingType() +} + +func (s PolicyMulticastConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyMulticastConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Gives the statistics count of a NAT rule. +type PolicyNATRuleCounters struct { + // Gives the total number of active sessions. format: int64 + ActiveSessions *int64 + // Gives the total number of bytes. format: int64 + TotalBytes *int64 + // Gives the total number of packets. format: int64 + TotalPackets *int64 +} + +func (s PolicyNATRuleCounters) GetType__() bindings.BindingType { + return PolicyNATRuleCountersBindingType() +} + +func (s PolicyNATRuleCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNATRuleCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents NAT section. This object is created by default when corresponding tier-0/tier-1 is created. Under tier-0/tier-1 there will be 4 different NATs(sections). (INTERNAL, USER, DEFAULT and NAT64). +type PolicyNat struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * PolicyNat#PolicyNat_NAT_TYPE_INTERNAL + // * PolicyNat#PolicyNat_NAT_TYPE_USER + // * PolicyNat#PolicyNat_NAT_TYPE_DEFAULT + // * PolicyNat#PolicyNat_NAT_TYPE_NAT64 + // + // Represents a NAT section under tier-0/tier-1. + NatType *string +} +const PolicyNat_NAT_TYPE_INTERNAL = "INTERNAL" +const PolicyNat_NAT_TYPE_USER = "USER" +const PolicyNat_NAT_TYPE_DEFAULT = "DEFAULT" +const PolicyNat_NAT_TYPE_NAT64 = "NAT64" + +func (s PolicyNat) GetType__() bindings.BindingType { + return PolicyNatBindingType() +} + +func (s PolicyNat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a NAT rule between source and destination at T0/T1 router. +type PolicyNatRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * PolicyNatRule#PolicyNatRule_ACTION_SNAT + // * PolicyNatRule#PolicyNatRule_ACTION_DNAT + // * PolicyNatRule#PolicyNatRule_ACTION_REFLEXIVE + // * PolicyNatRule#PolicyNatRule_ACTION_NO_SNAT + // * PolicyNatRule#PolicyNatRule_ACTION_NO_DNAT + // * PolicyNatRule#PolicyNatRule_ACTION_NAT64 + // + // Source NAT(SNAT) - translates a source IP address in an outbound packet so that the packet appears to originate from a different network. SNAT is only supported when the logical router is running in active-standby mode. Destination NAT(DNAT) - translates the destination IP address of inbound packets so that packets are delivered to a target address into another network. DNAT is only supported when the logical router is running in active-standby mode. Reflexive NAT(REFLEXIVE) - IP-Range and CIDR are supported to define the \"n\". The number of original networks should be exactly the same as that of translated networks. The address translation is deterministic. Reflexive is supported on both Active/Standby and Active/Active LR. NO_SNAT and NO_DNAT - These do not have support for translated_fields, only source_network and destination_network fields are supported. NAT64 - translates an external IPv6 address to a internal IPv4 address. + Action *string + // This supports single IP address or comma separated list of single IP addresses or CIDR. This does not support IP range or IP sets. For DNAT and NO_DNAT rules, this is a mandatory field, and represents the destination network for the incoming packets. For other type of rules, optionally it can contain destination network of outgoing packets. NULL value for this field represents ANY network. format: list-of-address-or-block-or-range + DestinationNetwork *string + // The flag, which suggests whether the NAT rule is enabled or disabled. The default is True. + Enabled *bool + // Possible values are: + // + // * PolicyNatRule#PolicyNatRule_FIREWALL_MATCH_MATCH_EXTERNAL_ADDRESS + // * PolicyNatRule#PolicyNatRule_FIREWALL_MATCH_MATCH_INTERNAL_ADDRESS + // * PolicyNatRule#PolicyNatRule_FIREWALL_MATCH_BYPASS + // + // It indicates how the firewall matches the address after NATing if firewall stage is not skipped. MATCH_EXTERNAL_ADDRESS indicates the firewall will be applied to external address of a NAT rule. For SNAT, the external address is the translated source address after NAT is done. For DNAT, the external address is the original destination address before NAT is done. For REFLEXIVE, to egress traffic, the firewall will be applied to the translated source address after NAT is done; To ingress traffic, the firewall will be applied to the original destination address before NAT is done. MATCH_INTERNAL_ADDRESS indicates the firewall will be applied to internal address of a NAT rule. For SNAT, the internal address is the original source address before NAT is done. For DNAT, the internal address is the translated destination address after NAT is done. For REFLEXIVE, to egress traffic, the firewall will be applied to the original source address before NAT is done; To ingress traffic, the firewall will be applied to the translated destination address after NAT is done. BYPASS indicates the firewall stage will be skipped. For NO_SNAT or NO_DNAT, it must be BYPASS or leave it unassigned + FirewallMatch *string + // The flag, which suggests whether the logging of NAT rule is enabled or disabled. The default is False. + Logging *bool + // Represents the array of policy paths of ProviderInterface or NetworkInterface or labels of type ProviderInterface or NetworkInterface on which the NAT rule should get enforced. The interfaces must belong to the same router for which the NAT Rule is created. + Scope []string + // The sequence_number decides the rule_priority of a NAT rule. Sequence_number and rule_priority have 1:1 mapping.For each NAT section, there will be reserved rule_priority numbers.The valid range of rule_priority number is from 0 to 2147483647(MAX_INT). 1. INTERNAL section rule_priority reserved from 0 - 1023 (1024 rules) valid sequence_number range 0 - 1023 2. USER section rule_priority reserved from 1024 - 2147482623 (2147481600 rules) valid sequence_number range 0 - 2147481599 3. DEFAULT section rule_priority reserved from 2147482624 - 2147483647 (1024 rules) valid sequence_number range 0 - 1023 format: int32 + SequenceNumber *int64 + // It represents the path of Service on which the NAT rule will be applied. If not provided or if it is blank then Policy manager will consider it as ANY. + Service *string + // This supports single IP address or comma separated list of single IP addresses or CIDR. This does not support IP range or IP sets. For SNAT, NO_SNAT, NAT64 and REFLEXIVE rules, this is a mandatory field and represents the source network of the packets leaving the network. For DNAT and NO_DNAT rules, optionally it can contain source network of incoming packets. NULL value for this field represents ANY network. format: list-of-address-or-block-or-range + SourceNetwork *string + // This supports single IP address or comma separated list of single IP addresses or CIDR. This does not support IP range or IP sets. For SNAT, DNAT, NAT64 and REFLEXIVE rules, this ia a mandatory field, which represents the translated network address. For NO_SNAT and NO_DNAT this should be empty. format: list-of-address-or-block-or-range + TranslatedNetwork *string + // Port number or port range format: port-or-range + TranslatedPorts *string +} +const PolicyNatRule_ACTION_SNAT = "SNAT" +const PolicyNatRule_ACTION_DNAT = "DNAT" +const PolicyNatRule_ACTION_REFLEXIVE = "REFLEXIVE" +const PolicyNatRule_ACTION_NO_SNAT = "NO_SNAT" +const PolicyNatRule_ACTION_NO_DNAT = "NO_DNAT" +const PolicyNatRule_ACTION_NAT64 = "NAT64" +const PolicyNatRule_FIREWALL_MATCH_MATCH_EXTERNAL_ADDRESS = "MATCH_EXTERNAL_ADDRESS" +const PolicyNatRule_FIREWALL_MATCH_MATCH_INTERNAL_ADDRESS = "MATCH_INTERNAL_ADDRESS" +const PolicyNatRule_FIREWALL_MATCH_BYPASS = "BYPASS" + +func (s PolicyNatRule) GetType__() bindings.BindingType { + return PolicyNatRuleBindingType() +} + +func (s PolicyNatRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNatRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of NAT Rules +type PolicyNatRuleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // NAT Rules list results + Results []PolicyNatRule +} + +func (s PolicyNatRuleListResult) GetType__() bindings.BindingType { + return PolicyNatRuleListResultBindingType() +} + +func (s PolicyNatRuleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNatRuleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Gives the Statistics of a NAT rule. +type PolicyNatRuleStatistics struct { + // Gives the total number of active sessions. format: int64 + ActiveSessions *int64 + // Gives the total number of bytes. format: int64 + TotalBytes *int64 + // Gives the total number of packets. format: int64 + TotalPackets *int64 + // Timestamp when the data was last updated. format: int64 + LastUpdateTimestamp *int64 + // The warning message about the NAT Rule Statistics. + WarningMessage *string +} + +func (s PolicyNatRuleStatistics) GetType__() bindings.BindingType { + return PolicyNatRuleStatisticsBindingType() +} + +func (s PolicyNatRuleStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNatRuleStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Gives the collection of NAT rule statistics per enforcement point. +type PolicyNatRuleStatisticsListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // NAT rules statistics per enforcement point + Results []PolicyNatRuleStatisticsPerEnforcementPoint +} + +func (s PolicyNatRuleStatisticsListResult) GetType__() bindings.BindingType { + return PolicyNatRuleStatisticsListResultBindingType() +} + +func (s PolicyNatRuleStatisticsListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNatRuleStatisticsListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Gives the statistics of a NAT rule per enforcement point. +type PolicyNatRuleStatisticsPerEnforcementPoint struct { + // Policy Path referencing the enforcement point from where the statistics are fetched. + EnforcementPointPath *string + // Path of NAT Rule. + RulePath *string + // Gives NAT rule stats on an enforcement point. + RuleStatistics []PolicyNatRuleStatistics +} + +func (s PolicyNatRuleStatisticsPerEnforcementPoint) GetType__() bindings.BindingType { + return PolicyNatRuleStatisticsPerEnforcementPointBindingType() +} + +func (s PolicyNatRuleStatisticsPerEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNatRuleStatisticsPerEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Gives the statistics of a NAT rule per logical router on specified enforcement point. +type PolicyNatRuleStatisticsPerLogicalRouter struct { + // Policy Path referencing the enforcement point from where the statistics are fetched. + EnforcementPointPath *string + // Timestamp when the data was last updated. format: int64 + LastUpdateTimestamp *int64 + // Detailed Rule statistics per logical router. + PerNodeStatistics []PolicyNatRuleStatisticsPerTransportNode + // Path of the router. + RouterPath *string + // Rolled up statistics for all rules on the logical router. + Statistics *PolicyNATRuleCounters +} + +func (s PolicyNatRuleStatisticsPerLogicalRouter) GetType__() bindings.BindingType { + return PolicyNatRuleStatisticsPerLogicalRouterBindingType() +} + +func (s PolicyNatRuleStatisticsPerLogicalRouter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNatRuleStatisticsPerLogicalRouter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Gives the collection of NAT rule statistics per logical router on specified enforcement point. +type PolicyNatRuleStatisticsPerLogicalRouterListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // NAT rules statistics per logical router + Results []PolicyNatRuleStatisticsPerLogicalRouter +} + +func (s PolicyNatRuleStatisticsPerLogicalRouterListResult) GetType__() bindings.BindingType { + return PolicyNatRuleStatisticsPerLogicalRouterListResultBindingType() +} + +func (s PolicyNatRuleStatisticsPerLogicalRouterListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNatRuleStatisticsPerLogicalRouterListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Gives the Statistics of a NAT rule. +type PolicyNatRuleStatisticsPerTransportNode struct { + // Gives the total number of active sessions. format: int64 + ActiveSessions *int64 + // Gives the total number of bytes. format: int64 + TotalBytes *int64 + // Gives the total number of packets. format: int64 + TotalPackets *int64 + // Timestamp when the data was last updated. format: int64 + LastUpdateTimestamp *int64 + // Policy path of the Edge Node. + TransportNodePath *string +} + +func (s PolicyNatRuleStatisticsPerTransportNode) GetType__() bindings.BindingType { + return PolicyNatRuleStatisticsPerTransportNodeBindingType() +} + +func (s PolicyNatRuleStatisticsPerTransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNatRuleStatisticsPerTransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type PolicyNonCompliantConfig struct { + // Resources/Services impacted by non compliant configuration + AffectedResources []PolicyResourceReference + // Detail description of non compliant configuration with suggestive action + Description *string + // Code for non compliant configuration format: int64 + NonComplianceCode *int64 + // Id and name of non compliant resource/service + ReportedBy *PolicyResourceReference +} + +func (s PolicyNonCompliantConfig) GetType__() bindings.BindingType { + return PolicyNonCompliantConfigBindingType() +} + +func (s PolicyNonCompliantConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyNonCompliantConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// PIM profile. +type PolicyPimProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Static IPv4 multicast address configuration. format: ip + RpAddress *string +} + +func (s PolicyPimProfile) GetType__() bindings.BindingType { + return PolicyPimProfileBindingType() +} + +func (s PolicyPimProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyPimProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Abstract base class for all the realized policy objects +type PolicyRealizedResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // Alarm info detail + Alarms []PolicyAlarmResource + // Desire state paths of this object + IntentReference []string + // Realization API of this object on enforcement point + RealizationApi *string + // Realization id of this object + RealizationSpecificIdentifier *string + // It define the root cause for runtime error. + RuntimeError *string + // Possible values could be UP, DOWN, UNKNOWN, DEGRADED This list is not exhaustive. + RuntimeStatus *string + // Possible values are: + // + // * PolicyRealizedResource#PolicyRealizedResource_STATE_UNAVAILABLE + // * PolicyRealizedResource#PolicyRealizedResource_STATE_UNREALIZED + // * PolicyRealizedResource#PolicyRealizedResource_STATE_REALIZED + // * PolicyRealizedResource#PolicyRealizedResource_STATE_ERROR + // + // Realization state of this object + State *string +} +const PolicyRealizedResource_STATE_UNAVAILABLE = "UNAVAILABLE" +const PolicyRealizedResource_STATE_UNREALIZED = "UNREALIZED" +const PolicyRealizedResource_STATE_REALIZED = "REALIZED" +const PolicyRealizedResource_STATE_ERROR = "ERROR" + +func (s PolicyRealizedResource) GetType__() bindings.BindingType { + return PolicyRealizedResourceBindingType() +} + +func (s PolicyRealizedResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyRealizedResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed information about errors from API call to an enforcement point +type PolicyRelatedApiError struct { + // Further details about the error + Details *string + // A numeric error code format: int64 + ErrorCode *int64 + // Additional data about the error + ErrorData *data.StructValue + // A description of the error + ErrorMessage *string + // The module name where the error occurred + ModuleName *string +} + +func (s PolicyRelatedApiError) GetType__() bindings.BindingType { + return PolicyRelatedApiErrorBindingType() +} + +func (s PolicyRelatedApiError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyRelatedApiError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Abstract base class for all the policy objects. +type PolicyResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string +} + +func (s PolicyResource) GetType__() bindings.BindingType { + return PolicyResourceBindingType() +} + +func (s PolicyResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Policy resource reference. +type PolicyResourceReference struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string + // Absolute path of this object. + Path *string +} + +func (s PolicyResourceReference) GetType__() bindings.BindingType { + return PolicyResourceReferenceBindingType() +} + +func (s PolicyResourceReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyResourceReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Policy resource reference for enforcement point +type PolicyResourceReferenceForEP struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string + // Absolute path of this object. + Path *string +} + +func (s PolicyResourceReferenceForEP) GetType__() bindings.BindingType { + return PolicyResourceReferenceForEPBindingType() +} + +func (s PolicyResourceReferenceForEP) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyResourceReferenceForEP._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paginated collection of policy resource references for enforcement point +type PolicyResourceReferenceForEPListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of policy resource references for enforcement point + Results []PolicyResourceReferenceForEP +} + +func (s PolicyResourceReferenceForEPListResult) GetType__() bindings.BindingType { + return PolicyResourceReferenceForEPListResultBindingType() +} + +func (s PolicyResourceReferenceForEPListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyResourceReferenceForEPListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of PolicyResourceReference +type PolicyResourceReferenceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Policy resource references list results + Results []PolicyResourceReference +} + +func (s PolicyResourceReferenceListResult) GetType__() bindings.BindingType { + return PolicyResourceReferenceListResultBindingType() +} + +func (s PolicyResourceReferenceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyResourceReferenceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Alarm associated with the PolicyRuntimeInfoPerEP that exposes potential errors when retrieving runtime information from the enforcement point. +type PolicyRuntimeAlarm struct { + // Detailed information about errors from an API call made to the enforcement point, if any. + ErrorDetails *PolicyApiError + // Alarm error id. + ErrorId *string + // Error message describing the issue. + Message *string +} + +func (s PolicyRuntimeAlarm) GetType__() bindings.BindingType { + return PolicyRuntimeAlarmBindingType() +} + +func (s PolicyRuntimeAlarm) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyRuntimeAlarm._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Runtime Info Per Enforcement Point. +type PolicyRuntimeInfoPerEP struct { + // Alarm information details. + Alarm *PolicyRuntimeAlarm + // Policy Path referencing the enforcement point where the info is fetched. + EnforcementPointPath *string +} + +func (s PolicyRuntimeInfoPerEP) GetType__() bindings.BindingType { + return PolicyRuntimeInfoPerEPBindingType() +} + +func (s PolicyRuntimeInfoPerEP) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyRuntimeInfoPerEP._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Service chain is a set of network Services. A Service chain is made up of ordered list of service profiles belonging to any same or different services. +type PolicyServiceChain struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * PolicyServiceChain#PolicyServiceChain_FAILURE_POLICY_ALLOW + // * PolicyServiceChain#PolicyServiceChain_FAILURE_POLICY_BLOCK + // + // Failure policy for the service defines the action to be taken i.e to allow or to block the traffic during failure scenarios. + FailurePolicy *string + // Forward path service profiles are applied to ingress traffic. + ForwardPathServiceProfiles []string + // Possible values are: + // + // * PolicyServiceChain#PolicyServiceChain_PATH_SELECTION_POLICY_ANY + // * PolicyServiceChain#PolicyServiceChain_PATH_SELECTION_POLICY_LOCAL + // * PolicyServiceChain#PolicyServiceChain_PATH_SELECTION_POLICY_REMOTE + // * PolicyServiceChain#PolicyServiceChain_PATH_SELECTION_POLICY_ROUND_ROBIN + // + // Path selection policy can be - ANY - Service Insertion is free to redirect to any service path regardless of any load balancing considerations or flow pinning. LOCAL - Preference to be given to local service insances. REMOTE - Preference to be given to the SVM co-located on the same host. ROUND_ROBIN - All active service paths are hit with equal probability. + PathSelectionPolicy *string + // Reverse path service profiles are applied to egress traffic and is optional. 2 different set of profiles can be defined for forward and reverse path. If not defined, the reverse of the forward path service profile is applied. + ReversePathServiceProfiles []string + // Path to service segment using which the traffic needs to be redirected. + ServiceSegmentPath []string +} +const PolicyServiceChain_FAILURE_POLICY_ALLOW = "ALLOW" +const PolicyServiceChain_FAILURE_POLICY_BLOCK = "BLOCK" +const PolicyServiceChain_PATH_SELECTION_POLICY_ANY = "ANY" +const PolicyServiceChain_PATH_SELECTION_POLICY_LOCAL = "LOCAL" +const PolicyServiceChain_PATH_SELECTION_POLICY_REMOTE = "REMOTE" +const PolicyServiceChain_PATH_SELECTION_POLICY_ROUND_ROBIN = "ROUND_ROBIN" + +func (s PolicyServiceChain) GetType__() bindings.BindingType { + return PolicyServiceChainBindingType() +} + +func (s PolicyServiceChain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyServiceChain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents an instance of partner Service and its configuration. +type PolicyServiceInstance struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * PolicyServiceInstance#PolicyServiceInstance_DEPLOYMENT_MODE_STAND_ALONE + // * PolicyServiceInstance#PolicyServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY + // + // Deployment mode specifies how the partner appliance will be deployed i.e. in HA or standalone mode. + DeploymentMode *string + // Unique name of Partner Service in the Marketplace + PartnerServiceName *string + // Possible values are: + // + // * PolicyServiceInstance#PolicyServiceInstance_TRANSPORT_TYPE_L2_BRIDGE + // * PolicyServiceInstance#PolicyServiceInstance_TRANSPORT_TYPE_L3_ROUTED + // + // Transport to be used while deploying Service-VM. + TransportType *string + // List of attributes specific to a partner for which the service is created. There attributes are passed on to the partner appliance. + Attributes []Attribute + // Id of the compute(ResourcePool) to which this service needs to be deployed. + ComputeId *string + // UUID of VCenter/Compute Manager as seen on NSX Manager, to which this service needs to be deployed. + ContextId *string + // Form factor for the deployment of partner service. + DeploymentSpecName *string + // Template for the deployment of partnet service. + DeploymentTemplateName *string + // Possible values are: + // + // * PolicyServiceInstance#PolicyServiceInstance_FAILURE_POLICY_ALLOW + // * PolicyServiceInstance#PolicyServiceInstance_FAILURE_POLICY_BLOCK + // + // Failure policy for the Service VM. If this values is not provided, it will be defaulted to FAIL_CLOSE. + FailurePolicy *string + // Gateway address for primary management console. If the provided segment already has gateway, this field can be omitted. But if it is provided, it takes precedence always. However, if provided segment does not have gateway, this field must be provided. format: address-or-block-or-range + PrimaryGatewayAddress *string + // Management IP Address of primary interface of the Service format: address-or-block-or-range + PrimaryInterfaceMgmtIp *string + // Path of the segment to which primary interface of the Service VM needs to be connected + PrimaryInterfaceNetwork *string + // Id of the standard or ditsributed port group for primary management console. Please note that only 1 of the 2 values from 1. primary_interface_network 2. primary_portgroup_id are allowed to be passed. Both can't be passed in the same request. + PrimaryPortgroupId *string + // Subnet for primary management console IP. If the provided segment already has subnet, this field can be omitted. But if it is provided, it takes precedence always. However, if provided segment does not have subnet, this field must be provided. format: address-or-block-or-range + PrimarySubnetMask *string + // Gateway address for secondary management console. If the provided segment already has gateway, this field can be omitted. But if it is provided, it takes precedence always. However, if provided segment does not have gateway, this field must be provided. format: address-or-block-or-range + SecondaryGatewayAddress *string + // Management IP Address of secondary interface of the Service format: address-or-block-or-range + SecondaryInterfaceMgmtIp *string + // Path of segment to which secondary interface of the Service VM needs to be connected + SecondaryInterfaceNetwork *string + // Id of the standard or ditsributed port group for secondary management console. Please note that only 1 of the 2 values from 1. secondary_interface_network 2. secondary_portgroup_id are allowed to be passed. Both can't be passed in the same request. + SecondaryPortgroupId *string + // Subnet for secondary management console IP. If the provided segment already has subnet, this field can be omitted. But if it is provided, it takes precedence always. However, if provided segment does not have subnet, this field must be provided. format: address-or-block-or-range + SecondarySubnetMask *string + // Id of the storage(Datastore). VC moref of Datastore to which this service needs to be deployed. + StorageId *string +} +const PolicyServiceInstance_DEPLOYMENT_MODE_STAND_ALONE = "STAND_ALONE" +const PolicyServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY = "ACTIVE_STANDBY" +const PolicyServiceInstance_TRANSPORT_TYPE_L2_BRIDGE = "L2_BRIDGE" +const PolicyServiceInstance_TRANSPORT_TYPE_L3_ROUTED = "L3_ROUTED" +const PolicyServiceInstance_FAILURE_POLICY_ALLOW = "ALLOW" +const PolicyServiceInstance_FAILURE_POLICY_BLOCK = "BLOCK" + +func (s PolicyServiceInstance) GetType__() bindings.BindingType { + return PolicyServiceInstanceBindingType() +} + +func (s PolicyServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Service profile represents specialization of a vendor template. User may provide any of the vendor_template_name or vendor_template_key properties. But in case of multiple vendor templates with the same name, it is recommended to use the vendor_template_key. When both attributes are provided, name is ignored and only key is used to identify the template. If there are multiple templates with same name, and vendor_template_name is provided, realization will fail. +type PolicyServiceProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // List of attributes specific to a partner for which the service is created. These attributes are passed on to the partner appliance and are opaque to NSX. If a vendor template exposes configurable parameters, then their values are specified here. + Attributes []Attribute + // Possible values are: + // + // * PolicyServiceProfile#PolicyServiceProfile_REDIRECTION_ACTION_PUNT + // * PolicyServiceProfile#PolicyServiceProfile_REDIRECTION_ACTION_COPY + // + // The redirection action represents if the packet is exclusively redirected to the service, or if a copy is forwarded to the service. Redirection action is not applicable to guest introspection service. + RedirectionAction *string + // The vendor template key property of actual vendor template. This should be used when multiple templates with same name exist. + VendorTemplateKey *string + // Name of the vendor template for which this Service Profile is being created. + VendorTemplateName *string +} +const PolicyServiceProfile_REDIRECTION_ACTION_PUNT = "PUNT" +const PolicyServiceProfile_REDIRECTION_ACTION_COPY = "COPY" + +func (s PolicyServiceProfile) GetType__() bindings.BindingType { + return PolicyServiceProfileBindingType() +} + +func (s PolicyServiceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyServiceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Policy Sub Attributes data holder +type PolicySubAttributes struct { + // Possible values are: + // + // * PolicySubAttributes#PolicySubAttributes_DATATYPE_STRING + // + // Datatype for sub attribute + Datatype *string + // Possible values are: + // + // * PolicySubAttributes#PolicySubAttributes_KEY_TLS_CIPHER_SUITE + // * PolicySubAttributes#PolicySubAttributes_KEY_TLS_VERSION + // * PolicySubAttributes#PolicySubAttributes_KEY_CIFS_SMB_VERSION + // + // Key for sub attribute + Key *string + // Multiple sub attribute values can be specified as elements of array. + Value []string +} +const PolicySubAttributes_DATATYPE_STRING = "STRING" +const PolicySubAttributes_KEY_TLS_CIPHER_SUITE = "TLS_CIPHER_SUITE" +const PolicySubAttributes_KEY_TLS_VERSION = "TLS_VERSION" +const PolicySubAttributes_KEY_CIFS_SMB_VERSION = "CIFS_SMB_VERSION" + +func (s PolicySubAttributes) GetType__() bindings.BindingType { + return PolicySubAttributesBindingType() +} + +func (s PolicySubAttributes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicySubAttributes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Time interval on which firewall schedule will be applicable +type PolicyTimeIntervalValue struct { + // Time in 24 hour and minutes in multiple of 30. Example, 17:30. + EndInterval *string + // Time in 24 hour and minutes in multiple of 30. Example, 9:00. + StartInterval *string +} + +func (s PolicyTimeIntervalValue) GetType__() bindings.BindingType { + return PolicyTimeIntervalValueBindingType() +} + +func (s PolicyTimeIntervalValue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTimeIntervalValue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Transport Zone. +type PolicyTransportZone struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Flag to indicate if the transport zone is the default one. Only one transport zone can be the default one for a given transport zone type. + IsDefault *bool + // UUID of transport zone on NSX-T enforcement point. + NsxId *string + // Possible values are: + // + // * PolicyTransportZone#PolicyTransportZone_TZ_TYPE_OVERLAY_STANDARD + // * PolicyTransportZone#PolicyTransportZone_TZ_TYPE_OVERLAY_ENS + // * PolicyTransportZone#PolicyTransportZone_TZ_TYPE_VLAN_BACKED + // * PolicyTransportZone#PolicyTransportZone_TZ_TYPE_UNKNOWN + // + // Transport Zone Type. + TzType *string + // The names of switching uplink teaming policies that all transport nodes in this transport zone support. Uplinkin teaming policies are only valid for VLAN backed transport zones. + UplinkTeamingPolicyNames []string +} +const PolicyTransportZone_TZ_TYPE_OVERLAY_STANDARD = "OVERLAY_STANDARD" +const PolicyTransportZone_TZ_TYPE_OVERLAY_ENS = "OVERLAY_ENS" +const PolicyTransportZone_TZ_TYPE_VLAN_BACKED = "VLAN_BACKED" +const PolicyTransportZone_TZ_TYPE_UNKNOWN = "UNKNOWN" + +func (s PolicyTransportZone) GetType__() bindings.BindingType { + return PolicyTransportZoneBindingType() +} + +func (s PolicyTransportZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTransportZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Transport Zone +type PolicyTransportZoneListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Transport Zone list result. + Results []PolicyTransportZone +} + +func (s PolicyTransportZoneListResult) GetType__() bindings.BindingType { + return PolicyTransportZoneListResultBindingType() +} + +func (s PolicyTransportZoneListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTransportZoneListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The type contains information about the configuration of the feature for a specific node. It contains information like the whether the feature is enabled/disabled, the context profiles defining the category list to detect. +type PolicyUrlCategorizationConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // The ids of the context profiles that provides the list of categories to be detected. + ContextProfiles []string + // Property which specifies the enabling/disabling of the feature. + Enabled *bool + // The frequency in minutes at which the updates are downloaded from the URL categorization cloud service. The minimum allowed value is 5 minutes. format: int32 + UpdateFrequency *int64 +} + +func (s PolicyUrlCategorizationConfig) GetType__() bindings.BindingType { + return PolicyUrlCategorizationConfigBindingType() +} + +func (s PolicyUrlCategorizationConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyUrlCategorizationConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The setting is used to add, update or remove pool members from pool. For static pool members, admin_state, display_name and weight can be updated. For dynamic pool members, only admin_state can be updated. +type PoolMemberSetting struct { + // Possible values are: + // + // * PoolMemberSetting#PoolMemberSetting_ADMIN_STATE_ENABLED + // * PoolMemberSetting#PoolMemberSetting_ADMIN_STATE_DISABLED + // * PoolMemberSetting#PoolMemberSetting_ADMIN_STATE_GRACEFUL_DISABLED + // + // Member admin state + AdminState *string + // Only applicable to static pool members. If supplied for a pool defined by a grouping object, update API would fail. + DisplayName *string + // Pool member IP address format: ip + IpAddress *string + // Pool member port number format: port-or-range + Port *string + // Only applicable to static pool members. If supplied for a pool defined by a grouping object, update API would fail. format: int64 + Weight *int64 +} +const PoolMemberSetting_ADMIN_STATE_ENABLED = "ENABLED" +const PoolMemberSetting_ADMIN_STATE_DISABLED = "DISABLED" +const PoolMemberSetting_ADMIN_STATE_GRACEFUL_DISABLED = "GRACEFUL_DISABLED" + +func (s PoolMemberSetting) GetType__() bindings.BindingType { + return PoolMemberSettingBindingType() +} + +func (s PoolMemberSetting) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PoolMemberSetting._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed information about static address for the port. +type PortAddressBindingEntry struct { + // IP Address for port binding + IpAddress *string + // Mac address for port binding format: mac-address + MacAddress *string + // VLAN ID for port binding format: int64 + VlanId *int64 +} + +func (s PortAddressBindingEntry) GetType__() bindings.BindingType { + return PortAddressBindingEntryBindingType() +} + +func (s PortAddressBindingEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortAddressBindingEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detail information about port attachment +type PortAttachment struct { + // Possible values are: + // + // * PortAttachment#PortAttachment_ALLOCATE_ADDRESSES_IP_POOL + // * PortAttachment#PortAttachment_ALLOCATE_ADDRESSES_MAC_POOL + // * PortAttachment#PortAttachment_ALLOCATE_ADDRESSES_BOTH + // * PortAttachment#PortAttachment_ALLOCATE_ADDRESSES_NONE + // + // Indicate how IP will be allocated for the port + AllocateAddresses *string + // ID used to identify/look up a child attachment behind a parent attachment + AppId *string + // If type is CHILD and the parent port is on the same segment as the child port, then this field should be VIF ID of the parent port. If type is CHILD and the parent port is on a different segment, then this field should be policy path of the parent port. If type is INDEPENDENT/STATIC, then this field should be transport node ID. + ContextId *string + // Possible values are: + // + // * PortAttachment#PortAttachment_CONTEXT_TYPE_PARENT + // + // Set to PARENT when type field is CHILD. Read only field. + ContextType *string + // Possible values are: + // + // * PortAttachment#PortAttachment_HYPERBUS_MODE_ENABLE + // * PortAttachment#PortAttachment_HYPERBUS_MODE_DISABLE + // + // Flag to indicate if hyperbus configuration is required. + HyperbusMode *string + // VIF UUID on NSX Manager. If the attachement type is PARENT, this property is required. + Id *string + // Not valid when type field is INDEPENDENT, mainly used to identify traffic from different ports in container use case. format: int64 + TrafficTag *int64 + // Possible values are: + // + // * PortAttachment#PortAttachment_TYPE_PARENT + // * PortAttachment#PortAttachment_TYPE_CHILD + // * PortAttachment#PortAttachment_TYPE_INDEPENDENT + // * PortAttachment#PortAttachment_TYPE_STATIC + // + // Type of port attachment. STATIC is added to replace INDEPENDENT. INDEPENDENT type and PARENT type are deprecated. + Type_ *string +} +const PortAttachment_ALLOCATE_ADDRESSES_IP_POOL = "IP_POOL" +const PortAttachment_ALLOCATE_ADDRESSES_MAC_POOL = "MAC_POOL" +const PortAttachment_ALLOCATE_ADDRESSES_BOTH = "BOTH" +const PortAttachment_ALLOCATE_ADDRESSES_NONE = "NONE" +const PortAttachment_CONTEXT_TYPE_PARENT = "PARENT" +const PortAttachment_HYPERBUS_MODE_ENABLE = "ENABLE" +const PortAttachment_HYPERBUS_MODE_DISABLE = "DISABLE" +const PortAttachment_TYPE_PARENT = "PARENT" +const PortAttachment_TYPE_CHILD = "CHILD" +const PortAttachment_TYPE_INDEPENDENT = "INDEPENDENT" +const PortAttachment_TYPE_STATIC = "STATIC" + +func (s PortAttachment) GetType__() bindings.BindingType { + return PortAttachmentBindingType() +} + +func (s PortAttachment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortAttachment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between discovery profile and Port. Using this entity, user can specify intent for applying discovery profile to particular Port. Port here is Logical Port. +type PortDiscoveryProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated IP Discovery Profile + IpDiscoveryProfilePath *string + // PolicyPath of associated Mac Discovery Profile + MacDiscoveryProfilePath *string +} + +func (s PortDiscoveryProfileBindingMap) GetType__() bindings.BindingType { + return PortDiscoveryProfileBindingMapBindingType() +} + +func (s PortDiscoveryProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortDiscoveryProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Port Discovery Profile Binding Maps +type PortDiscoveryProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Port Discovery Profile Binding Map list results + Results []PortDiscoveryProfileBindingMap +} + +func (s PortDiscoveryProfileBindingMapListResult) GetType__() bindings.BindingType { + return PortDiscoveryProfileBindingMapListResultBindingType() +} + +func (s PortDiscoveryProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortDiscoveryProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Mirrors Data from source to destination +type PortMirroringProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Data from source group will be copied to members of destination group. Only IPSET group and group with membership criteria VM is supported. IPSET group allows only three ip's. + DestinationGroup *string + // Possible values are: + // + // * PortMirroringProfile#PortMirroringProfile_DIRECTION_INGRESS + // * PortMirroringProfile#PortMirroringProfile_DIRECTION_EGRESS + // * PortMirroringProfile#PortMirroringProfile_DIRECTION_BIDIRECTIONAL + // + // Port mirroring profile direction + Direction *string + // Possible values are: + // + // * PortMirroringProfile#PortMirroringProfile_ENCAPSULATION_TYPE_GRE + // * PortMirroringProfile#PortMirroringProfile_ENCAPSULATION_TYPE_ERSPAN_TWO + // * PortMirroringProfile#PortMirroringProfile_ENCAPSULATION_TYPE_ERSPAN_THREE + // + // User can provide Mirror Destination type e.g GRE, ERSPAN_TWO or ERSPAN_THREE.If profile type is REMOTE_L3_SPAN, encapsulation type is used else ignored. + EncapsulationType *string + // Used by physical switch for the mirror traffic forwarding. Must be provided and only effective when encapsulation type is ERSPAN type II or type III. format: int32 + ErspanId *int64 + // User-configurable 32-bit key only for GRE format: int32 + GreKey *int64 + // Possible values are: + // + // * PortMirroringProfile#PortMirroringProfile_PROFILE_TYPE_REMOTE_L3_SPAN + // * PortMirroringProfile#PortMirroringProfile_PROFILE_TYPE_LOGICAL_SPAN + // + // Allows user to select type of port mirroring session. + ProfileType *string + // If this property is set, the packet will be truncated to the provided length. If this property is unset, entire packet will be mirrored. format: int32 + SnapLength *int64 +} +const PortMirroringProfile_DIRECTION_INGRESS = "INGRESS" +const PortMirroringProfile_DIRECTION_EGRESS = "EGRESS" +const PortMirroringProfile_DIRECTION_BIDIRECTIONAL = "BIDIRECTIONAL" +const PortMirroringProfile_ENCAPSULATION_TYPE_GRE = "GRE" +const PortMirroringProfile_ENCAPSULATION_TYPE_ERSPAN_TWO = "ERSPAN_TWO" +const PortMirroringProfile_ENCAPSULATION_TYPE_ERSPAN_THREE = "ERSPAN_THREE" +const PortMirroringProfile_PROFILE_TYPE_REMOTE_L3_SPAN = "REMOTE_L3_SPAN" +const PortMirroringProfile_PROFILE_TYPE_LOGICAL_SPAN = "LOGICAL_SPAN" + +func (s PortMirroringProfile) GetType__() bindings.BindingType { + return PortMirroringProfileBindingType() +} + +func (s PortMirroringProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortMirroringProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of port mirroring profiles +type PortMirroringProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Port Mirroring Profiles list results + Results []PortMirroringProfile +} + +func (s PortMirroringProfileListResult) GetType__() bindings.BindingType { + return PortMirroringProfileListResultBindingType() +} + +func (s PortMirroringProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortMirroringProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between monitoring profile and Port. Using this entity, user can specify intent for applying monitoring profile to particular Port. Port here is Segment Port. +type PortMonitoringProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated IPFIX L2 Profile + IpfixL2ProfilePath *string + // PolicyPath of associated Port Mirroring Profile + PortMirroringProfilePath *string +} + +func (s PortMonitoringProfileBindingMap) GetType__() bindings.BindingType { + return PortMonitoringProfileBindingMapBindingType() +} + +func (s PortMonitoringProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortMonitoringProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Port Monitoring Profile Binding Maps +type PortMonitoringProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Port Monitoring Profile Binding Map list results + Results []PortMonitoringProfileBindingMap +} + +func (s PortMonitoringProfileBindingMapListResult) GetType__() bindings.BindingType { + return PortMonitoringProfileBindingMapListResultBindingType() +} + +func (s PortMonitoringProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortMonitoringProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between qos profile and Port. Using this entity, you can specify intent for applying qos profile to particular Port. Port here is Segment Port. +type PortQosProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated QoS Profile + QosProfilePath *string +} + +func (s PortQosProfileBindingMap) GetType__() bindings.BindingType { + return PortQosProfileBindingMapBindingType() +} + +func (s PortQosProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortQosProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Port QoS Profile Binding Maps +type PortQosProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Port QoS Profile Binding Map list results + Results []PortQosProfileBindingMap +} + +func (s PortQosProfileBindingMapListResult) GetType__() bindings.BindingType { + return PortQosProfileBindingMapListResultBindingType() +} + +func (s PortQosProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortQosProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains the binding relationship between port and security profile. +type PortSecurityProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // The policy path of the asscociated Segment Security profile + SegmentSecurityProfilePath *string + // The policy path of the asscociated SpoofGuard profile + SpoofguardProfilePath *string +} + +func (s PortSecurityProfileBindingMap) GetType__() bindings.BindingType { + return PortSecurityProfileBindingMapBindingType() +} + +func (s PortSecurityProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortSecurityProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of port security profile binding maps +type PortSecurityProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Port security profile binding map list results + Results []PortSecurityProfileBindingMap +} + +func (s PortSecurityProfileBindingMapListResult) GetType__() bindings.BindingType { + return PortSecurityProfileBindingMapListResultBindingType() +} + +func (s PortSecurityProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortSecurityProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Network prefix entry +type PrefixEntry struct { + // Possible values are: + // + // * PrefixEntry#PrefixEntry_ACTION_PERMIT + // * PrefixEntry#PrefixEntry_ACTION_DENY + // + // Action for the prefix list. + Action *string + // Prefix length greater than or equal to. format: int32 + Ge *int64 + // Prefix length less than or equal to. format: int32 + Le *int64 + // Network prefix in CIDR format. \"ANY\" matches all networks. + Network *string +} +const PrefixEntry_ACTION_PERMIT = "PERMIT" +const PrefixEntry_ACTION_DENY = "DENY" + +func (s PrefixEntry) GetType__() bindings.BindingType { + return PrefixEntryBindingType() +} + +func (s PrefixEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PrefixEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A named list of prefixes for routing purposes. +type PrefixList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Specify ordered list of network prefixes. + Prefixes []PrefixEntry +} + +func (s PrefixList) GetType__() bindings.BindingType { + return PrefixListBindingType() +} + +func (s PrefixList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PrefixList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of PrefixLists +type PrefixListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // PrefixList results + Results []PrefixList +} + +func (s PrefixListResult) GetType__() bindings.BindingType { + return PrefixListResultBindingType() +} + +func (s PrefixListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PrefixListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between profile and policy entities. +type ProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated Profile + ProfilePath *string +} + +func (s ProfileBindingMap) GetType__() bindings.BindingType { + return ProfileBindingMapBindingType() +} + +func (s ProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a label-value pair. +type PropertyItem struct { + // If the condition is met then the property will be displayed. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // Represents field value of the property. + Field *string + // Set to true if the field is a heading. Default is false. + Heading *bool + // If a field represents a heading, then label is not needed + Label *Label + // Hyperlink of the specified UI page that provides details. This will be linked with value of the property. + Navigation *string + // Render configuration to be applied, if any. + RenderConfiguration []RenderConfiguration + // If true, separates this property in a widget. + Separator *bool + // Possible values are: + // + // * PropertyItem#PropertyItem_TYPE_STRING + // * PropertyItem#PropertyItem_TYPE_NUMBER + // * PropertyItem#PropertyItem_TYPE_DATE + // * PropertyItem#PropertyItem_TYPE_URL + // + // Data type of the field. + Type_ *string +} +const PropertyItem_TYPE_STRING = "String" +const PropertyItem_TYPE_NUMBER = "Number" +const PropertyItem_TYPE_DATE = "Date" +const PropertyItem_TYPE_URL = "Url" + +func (s PropertyItem) GetType__() bindings.BindingType { + return PropertyItemBindingType() +} + +func (s PropertyItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PropertyItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A Limiter configuration entry that specifies type and metrics +type QosBaseRateLimiter struct { + Enabled *bool + // Possible values are: + // + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_INGRESSRATELIMITER + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_INGRESSBROADCASTRATELIMITER + // * QosBaseRateLimiter#QosBaseRateLimiter_RESOURCE_TYPE_EGRESSRATELIMITER + // + // Type rate limiter + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const QosBaseRateLimiter__TYPE_IDENTIFIER = "QoSBaseRateLimiter" +const QosBaseRateLimiter_RESOURCE_TYPE_INGRESSRATELIMITER = "IngressRateLimiter" +const QosBaseRateLimiter_RESOURCE_TYPE_INGRESSBROADCASTRATELIMITER = "IngressBroadcastRateLimiter" +const QosBaseRateLimiter_RESOURCE_TYPE_EGRESSRATELIMITER = "EgressRateLimiter" + +func (s QosBaseRateLimiter) GetType__() bindings.BindingType { + return QosBaseRateLimiterBindingType() +} + +func (s QosBaseRateLimiter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for QosBaseRateLimiter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Dscp value is ignored in case of 'TRUSTED' DscpTrustMode. +type QosDscp struct { + // Possible values are: + // + // * QosDscp#QosDscp_MODE_TRUSTED + // * QosDscp#QosDscp_MODE_UNTRUSTED + // + // When you select the Trusted mode the inner header DSCP value is applied to the outer IP header for IP/IPv6 traffic. For non IP/IPv6 traffic, the outer IP header takes the default value.Untrusted mode is supported on overlay-based and VLAN-based logical port. + Mode *string + // Internal Forwarding Priority format: int32 + Priority *int64 +} +const QosDscp_MODE_TRUSTED = "TRUSTED" +const QosDscp_MODE_UNTRUSTED = "UNTRUSTED" + +func (s QosDscp) GetType__() bindings.BindingType { + return QosDscpBindingType() +} + +func (s QosDscp) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for QosDscp._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type QosProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Class of service groups similar types of traffic in the network and each type of traffic is treated as a class with its own level of service priority. The lower priority traffic is slowed down or in some cases dropped to provide better throughput for higher priority traffic. format: int32 + ClassOfService *int64 + Dscp *QosDscp + // Array of Rate limiter configurations to applied on Segment or Port. + ShaperConfigurations []*data.StructValue +} + +func (s QosProfile) GetType__() bindings.BindingType { + return QosProfileBindingType() +} + +func (s QosProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for QosProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base QoS Profile Binding Map +type QosProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s QosProfileBindingMap) GetType__() bindings.BindingType { + return QosProfileBindingMapBindingType() +} + +func (s QosProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for QosProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of QoS profiles +type QosProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // QoS profiles list results + Results []QosProfile +} + +func (s QosProfileListResult) GetType__() bindings.BindingType { + return QosProfileListResultBindingType() +} + +func (s QosProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for QosProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type RAConfig struct { + // The maximum number of hops through which packets can pass before being discarded. format: int64 + HopLimit *int64 + // The time interval in seconds, in which the prefix is advertised as valid. format: int64 + PrefixLifetime *int64 + // The time interval in seconds, in which the prefix is advertised as preferred. format: int64 + PrefixPreferredTime *int64 + // Interval between 2 Router advertisement in seconds. format: int64 + RaInterval *int64 + // Router lifetime value in seconds. A value of 0 indicates the router is not a default router for the receiving end. Any other value in this field specifies the lifetime, in seconds, associated with this router as a default router. format: int64 + RouterLifetime *int64 +} + +func (s RAConfig) GetType__() bindings.BindingType { + return RAConfigBindingType() +} + +func (s RAConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RAConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type RaDNSConfig struct { + // DNS server. format: ipv6 + DnsServer []string + // Lifetime of DNS server in milliseconds format: int64 + DnsServerLifetime *int64 + // Domain name in RA message. + DomainName []string + // Lifetime of Domain names in milliseconds format: int64 + DomainNameLifetime *int64 +} + +func (s RaDNSConfig) GetType__() bindings.BindingType { + return RaDNSConfigBindingType() +} + +func (s RaDNSConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RaDNSConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Reaction represents a programmable entity which encapsulates the events and the actions in response to the events, or simply \"If This Then That\". +type Reaction struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Actions that need to be taken when the events occur. These actions must appear in the order that they need to be taken in. This field can be interpreted as the HOW of the Reaction, or simply as \"Then That\". + Actions []*data.StructValue + // Events that provide contextual variables about what the reaction should react to. This field can be interpreted as the WHAT of the Reaction, or simply as \"If This\" Clause. + Events []Event +} + +func (s Reaction) GetType__() bindings.BindingType { + return ReactionBindingType() +} + +func (s Reaction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Reaction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Realized Virtual Machine +type RealizedVirtualMachine struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // Alarm info detail + Alarms []PolicyAlarmResource + // Desire state paths of this object + IntentReference []string + // Realization API of this object on enforcement point + RealizationApi *string + // Realization id of this object + RealizationSpecificIdentifier *string + // It define the root cause for runtime error. + RuntimeError *string + // Possible values could be UP, DOWN, UNKNOWN, DEGRADED This list is not exhaustive. + RuntimeStatus *string + // Possible values are: + // + // * RealizedVirtualMachine#RealizedVirtualMachine_STATE_UNAVAILABLE + // * RealizedVirtualMachine#RealizedVirtualMachine_STATE_UNREALIZED + // * RealizedVirtualMachine#RealizedVirtualMachine_STATE_REALIZED + // * RealizedVirtualMachine#RealizedVirtualMachine_STATE_ERROR + // + // Realization state of this object + State *string + // List of external compute ids of the virtual machine in the format 'id-type-key:value' , list of external compute ids ['uuid:xxxx-xxxx-xxxx-xxxx', 'moIdOnHost:moref-11', 'instanceUuid:xxxx-xxxx-xxxx-xxxx'] + ComputeIds []string + // Id of the host on which the vm exists. + HostId *string + // Id of the vm unique within the host. + LocalIdOnHost *string + // Possible values are: + // + // * RealizedVirtualMachine#RealizedVirtualMachine_POWER_STATE_VM_RUNNING + // * RealizedVirtualMachine#RealizedVirtualMachine_POWER_STATE_VM_STOPPED + // * RealizedVirtualMachine#RealizedVirtualMachine_POWER_STATE_VM_SUSPENDED + // * RealizedVirtualMachine#RealizedVirtualMachine_POWER_STATE_UNKNOWN + // + // Current power state of this virtual machine in the system. + PowerState *string +} +const RealizedVirtualMachine_STATE_UNAVAILABLE = "UNAVAILABLE" +const RealizedVirtualMachine_STATE_UNREALIZED = "UNREALIZED" +const RealizedVirtualMachine_STATE_REALIZED = "REALIZED" +const RealizedVirtualMachine_STATE_ERROR = "ERROR" +const RealizedVirtualMachine_POWER_STATE_VM_RUNNING = "VM_RUNNING" +const RealizedVirtualMachine_POWER_STATE_VM_STOPPED = "VM_STOPPED" +const RealizedVirtualMachine_POWER_STATE_VM_SUSPENDED = "VM_SUSPENDED" +const RealizedVirtualMachine_POWER_STATE_UNKNOWN = "UNKNOWN" + +func (s RealizedVirtualMachine) GetType__() bindings.BindingType { + return RealizedVirtualMachineBindingType() +} + +func (s RealizedVirtualMachine) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RealizedVirtualMachine._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type RealizedVirtualMachineListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of VMs + Results []RealizedVirtualMachine +} + +func (s RealizedVirtualMachineListResult) GetType__() bindings.BindingType { + return RealizedVirtualMachineListResultBindingType() +} + +func (s RealizedVirtualMachineListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RealizedVirtualMachineListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Ordered list of rules long with the path of PolicyServiceInstance to which the traffic needs to be redirected. | Please note that the scope property must be provided for NS redirection | policy if redirect to is a service chain. For NS, when redirect to is not | to the service chain, and scope is specified on RedirectionPolicy, it | will be ignored. The scope will be determined from redirect to path | instead. For EW policy, scope must not be supplied in the request. | Path to either Tier0 or Tier1 is allowed as the scope. Only 1 path | can be specified as a scope. | Also, note that, if stateful flag is not sent, it will be treated as true. If statelessness is intended, false must be sent explicitly as the value | for stateful field. +type RedirectionPolicy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // - Distributed Firewall - Policy framework provides five pre-defined categories for classifying a security policy. They are \"Ethernet\",\"Emergency\", \"Infrastructure\" \"Environment\" and \"Application\". There is a pre-determined order in which the policy framework manages the priority of these security policies. Ethernet category is for supporting layer 2 firewall rules. The other four categories are applicable for layer 3 rules. Amongst them, the Emergency category has the highest priority followed by Infrastructure, Environment and then Application rules. Administrator can choose to categorize a security policy into the above categories or can choose to leave it empty. If empty it will have the least precedence w.r.t the above four categories. - Edge Firewall - Policy Framework for Edge Firewall provides six pre-defined categories \"Emergency\", \"SystemRules\", \"SharedPreRules\", \"LocalGatewayRules\", \"AutoServiceRules\" and \"Default\", in order of priority of rules. All categories are allowed for Gatetway Policies that belong to 'default' Domain. However, for user created domains, category is restricted to \"SharedPreRules\" or \"LocalGatewayRules\" only. Also, the users can add/modify/delete rules from only the \"SharedPreRules\" and \"LocalGatewayRules\" categories. If user doesn't specify the category then defaulted to \"Rules\". System generated category is used by NSX created rules, for example BFD rules. Autoplumbed category used by NSX verticals to autoplumb data path rules. Finally, \"Default\" category is the placeholder default rules with lowest in the order of priority. + Category *string + // Comments for security policy lock/unlock. + Comments *string + // This field is to indicate the internal sequence number of a policy with respect to the policies across categories. format: int32 + InternalSequenceNumber *int64 + // A flag to indicate whether policy is a default policy. + IsDefault *bool + // ID of the user who last modified the lock for the secruity policy. + LockModifiedBy *string + // SecurityPolicy locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Indicates whether a security policy should be locked. If the security policy is locked by a user, then no other user would be able to modify this security policy. Once the user releases the lock, other users can update this security policy. + Locked *bool + // The count of rules in the policy. format: int32 + RuleCount *int64 + // Provides a mechanism to apply the rules in this policy for a specified time duration. + SchedulerPath *string + // The list of group paths where the rules in this policy will get applied. This scope will take precedence over rule level scope. Supported only for security and redirection policies. In case of RedirectionPolicy, it is expected only when the policy is NS and redirecting to service chain. + Scope []string + // This field is used to resolve conflicts between security policies across domains. In order to change the sequence number of a policy one can fire a POST request on the policy entity with a query parameter action=revise The sequence number field will reflect the value of the computed sequence number upon execution of the above mentioned POST request. For scenarios where the administrator is using a template to update several security policies, the only way to set the sequence number is to explicitly specify the sequence number for each security policy. If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple policies with the same sequence number then their order is not deterministic. If a specific order of policies is desired, then one has to specify unique sequence numbers or use the POST request on the policy entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // Stateful or Stateless nature of security policy is enforced on all rules in this security policy. When it is stateful, the state of the network connects are tracked and a stateful packet inspection is performed. Layer3 security policies can be stateful or stateless. By default, they are stateful. Layer2 security policies can only be stateless. + Stateful *bool + // Ensures that a 3 way TCP handshake is done before the data packets are sent. tcp_strict=true is supported only for stateful security policies. + TcpStrict *bool + // This is the read only flag which will state the direction of this | redirection policy. True denotes that it is NORTH-SOUTH and false | value means it is an EAST-WEST redirection policy. + NorthSouth *bool + // Paths to which traffic will be redirected to. As of now, only 1 is | supported. Paths allowed are | 1. Policy Service Instance | 2. Service Instance Endpoint | 3. Virtual Endpoint | 4. Policy Service Chain + RedirectTo []string + // Redirection rules that are a part of this RedirectionPolicy. At max, there can be 1000 rules in a given RedirectPolicy. + Rules []RedirectionRule +} + +func (s RedirectionPolicy) GetType__() bindings.BindingType { + return RedirectionPolicyBindingType() +} + +func (s RedirectionPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RedirectionPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// It define redirection rule for service insertion +type RedirectionRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + DestinationGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the destination groups. If false, the rule applies to the destination groups + DestinationsExcluded *bool + // Possible values are: + // + // * RedirectionRule#RedirectionRule_DIRECTION_IN + // * RedirectionRule#RedirectionRule_DIRECTION_OUT + // * RedirectionRule#RedirectionRule_DIRECTION_IN_OUT + // + // Define direction of traffic. + Direction *string + // Flag to disable the rule. Default is enabled. + Disabled *bool + // Possible values are: + // + // * RedirectionRule#RedirectionRule_IP_PROTOCOL_IPV4 + // * RedirectionRule#RedirectionRule_IP_PROTOCOL_IPV6 + // * RedirectionRule#RedirectionRule_IP_PROTOCOL_IPV4_IPV6 + // + // Type of IP packet that should be matched while enforcing the rule. The value is set to IPV4_IPV6 for Layer3 rule if not specified. For Layer2/Ether rule the value must be null. + IpProtocol *string + // A flag to indicate whether rule is a default rule. + IsDefault *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // Text for additional notes on changes. + Notes *string + // Holds the list of layer 7 service profile paths. These profiles accept attributes and sub-attributes of various network services (e.g. L4 AppId, encryption algorithm, domain name, etc) as key value pairs. + Profiles []string + // This is a unique 4 byte positive number that is assigned by the system. This rule id is passed all the way down to the data path. The first 1GB (1000 to 2^30) will be shared by GM and LM with zebra style striped number space. For E.g 1000 to (1Million -1) by LM, (1M - 2M-1) by GM and so on. format: int64 + RuleId *int64 + // The list of policy paths where the rule is applied LR/Edge/T0/T1/LRP etc. Note that a given rule can be applied on multiple LRs/LRPs. + Scope []string + // This field is used to resolve conflicts between multiple Rules under Security or Gateway Policy for a Domain If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple rules with the same sequence number then their order is not deterministic. If a specific order of rules is desired, then one has to specify unique sequence numbers or use the POST request on the rule entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // In order to specify raw services this can be used, along with services which contains path to services. This can be empty or null. + ServiceEntries []*data.StructValue + // In order to specify all services, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the services array. Error will be thrown if ANY is used in conjunction with other values. + Services []string + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + SourceGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the source groups. If false, the rule applies to the source groups + SourcesExcluded *bool + // User level field which will be printed in CLI and packet logs. + Tag *string + // Possible values are: + // + // * RedirectionRule#RedirectionRule_ACTION_REDIRECT + // * RedirectionRule#RedirectionRule_ACTION_DO_NOT_REDIRECT + // + // The action to be applied to all the services + Action *string +} +const RedirectionRule_DIRECTION_IN = "IN" +const RedirectionRule_DIRECTION_OUT = "OUT" +const RedirectionRule_DIRECTION_IN_OUT = "IN_OUT" +const RedirectionRule_IP_PROTOCOL_IPV4 = "IPV4" +const RedirectionRule_IP_PROTOCOL_IPV6 = "IPV6" +const RedirectionRule_IP_PROTOCOL_IPV4_IPV6 = "IPV4_IPV6" +const RedirectionRule_ACTION_REDIRECT = "REDIRECT" +const RedirectionRule_ACTION_DO_NOT_REDIRECT = "DO_NOT_REDIRECT" + +func (s RedirectionRule) GetType__() bindings.BindingType { + return RedirectionRuleBindingType() +} + +func (s RedirectionRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RedirectionRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Appliance registration access token +type RegistrationToken struct { + // List results + Roles []string + // Access token + Token *string + // User delegated by token + User *string +} + +func (s RegistrationToken) GetType__() bindings.BindingType { + return RegistrationTokenBindingType() +} + +func (s RegistrationToken) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RegistrationToken._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed information about a related API error +type RelatedApiError struct { + // Further details about the error + Details *string + // A numeric error code format: int64 + ErrorCode *int64 + // Additional data about the error + ErrorData *data.StructValue + // A description of the error + ErrorMessage *string + // The module name where the error occurred + ModuleName *string +} + +func (s RelatedApiError) GetType__() bindings.BindingType { + return RelatedApiErrorBindingType() +} + +func (s RelatedApiError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RelatedApiError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Related attribute on the target resource for conditional constraints based on related attribute value. Example - destinationGroups/service/action is related attribute of sourceGroups in communcation entry. +type RelatedAttribute struct { + // Related attribute name on the target entity. + Attribute *string +} + +func (s RelatedAttribute) GetType__() bindings.BindingType { + return RelatedAttributeBindingType() +} + +func (s RelatedAttribute) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RelatedAttribute._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the leaf level type expression to express constraint as value of realted attribute to the target. Example - Constraint traget attribute 'X' (example in Constraint), if destinationGroups contains 'vCeneter' then allow only values \"HTTPS\", \"HTTP\" for attribute X. { \"target\":{ \"target_resource_type\":\"CommunicationEntry\", \"attribute\":\"services\", \"path_prefix\": \"/infra/domains/{{DOMAIN}}/edge-communication-maps/default/communication-entries/\" }, \"constraint_expression\": { \"resource_type\": \"RelatedAttributeConditionalExpression\", \"related_attribute\":{ \"attribute\":\"destinationGroups\" }, \"condition\" : { \"operator\":\"INCLUDES\", \"rhs_value\": [\"/infra/domains/mgw/groups/VCENTER\"], \"value_constraint\": { \"resource_type\": \"ValueConstraintExpression\", \"operator\":\"INCLUDES\", \"values\":[\"/infra/services/HTTP\", \"/infra/services/HTTPS\"] } } } } +type RelatedAttributeConditionalExpression struct { + // Conditional value expression for target based on realted attribute value. + Condition *ConditionalValueConstraintExpression + // Related attribute. + RelatedAttribute *RelatedAttribute + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_VALUECONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_RELATEDATTRIBUTECONDITIONALEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_ENTITYINSTANCECOUNTCONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_FIELDSANITYCONSTRAINTEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const RelatedAttributeConditionalExpression__TYPE_IDENTIFIER = "RelatedAttributeConditionalExpression" + +func (s RelatedAttributeConditionalExpression) GetType__() bindings.BindingType { + return RelatedAttributeConditionalExpressionBindingType() +} + +func (s RelatedAttributeConditionalExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RelatedAttributeConditionalExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Remote file server +type RemoteFileServer struct { + // Remote server directory to copy bundle files to + DirectoryPath *string + // Server port format: int64 + Port *int64 + // Protocol to use to copy file + Protocol *FileTransferProtocol + // Remote server hostname or IP address format: hostname-or-ip + Server *string +} + +func (s RemoteFileServer) GetType__() bindings.BindingType { + return RemoteFileServerBindingType() +} + +func (s RemoteFileServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteFileServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Remote server +type RemoteServerFingerprint struct { + // Server port format: int64 + Port *int64 + // Remote server hostname or IP address format: hostname-or-ip + Server *string + // SSH fingerprint of server + SshFingerprint *string +} + +func (s RemoteServerFingerprint) GetType__() bindings.BindingType { + return RemoteServerFingerprintBindingType() +} + +func (s RemoteServerFingerprint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteServerFingerprint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Remote server +type RemoteServerFingerprintRequest struct { + // Server port format: int64 + Port *int64 + // Remote server hostname or IP address format: hostname-or-ip + Server *string +} + +func (s RemoteServerFingerprintRequest) GetType__() bindings.BindingType { + return RemoteServerFingerprintRequestBindingType() +} + +func (s RemoteServerFingerprintRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteServerFingerprintRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Render configuration to be applied to the widget. +type RenderConfiguration struct { + // Possible values are: + // + // * RenderConfiguration#RenderConfiguration_COLOR_GREY + // * RenderConfiguration#RenderConfiguration_COLOR_DARK_GREY + // * RenderConfiguration#RenderConfiguration_COLOR_LIGHT_GREY + // * RenderConfiguration#RenderConfiguration_COLOR_SKY_BLUE + // * RenderConfiguration#RenderConfiguration_COLOR_BLUE + // * RenderConfiguration#RenderConfiguration_COLOR_GREEN + // * RenderConfiguration#RenderConfiguration_COLOR_YELLOW + // * RenderConfiguration#RenderConfiguration_COLOR_RED + // * RenderConfiguration#RenderConfiguration_COLOR_DARK_RED + // + // The color to use when rendering an entity. For example, set color as 'RED' to render a portion of donut in red. + Color *string + // If the condition is met then the rendering specified for the condition will be applied. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // If specified, overrides the field value. This can be used to display a meaningful value in situations where field value is not available or not configured. + DisplayValue *string + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Multi-line text to be shown on tooltip while hovering over the UI element if the condition is met. + Tooltip []Tooltip +} +const RenderConfiguration_COLOR_GREY = "GREY" +const RenderConfiguration_COLOR_DARK_GREY = "DARK_GREY" +const RenderConfiguration_COLOR_LIGHT_GREY = "LIGHT_GREY" +const RenderConfiguration_COLOR_SKY_BLUE = "SKY_BLUE" +const RenderConfiguration_COLOR_BLUE = "BLUE" +const RenderConfiguration_COLOR_GREEN = "GREEN" +const RenderConfiguration_COLOR_YELLOW = "YELLOW" +const RenderConfiguration_COLOR_RED = "RED" +const RenderConfiguration_COLOR_DARK_RED = "DARK_RED" + +func (s RenderConfiguration) GetType__() bindings.BindingType { + return RenderConfigurationBindingType() +} + +func (s RenderConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RenderConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base class for resources +type Resource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink +} + +func (s Resource) GetType__() bindings.BindingType { + return ResourceBindingType() +} + +func (s Resource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Resource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Resource Field Pointer representing the exact value within a policy object. +type ResourceFieldPointer struct { + // Field Pointer referencing the exact field within the policy object. + FieldPointer *string + // Policy Path referencing a policy object. If not supplied, the field pointer will be applied to the event source. + Path *string +} + +func (s ResourceFieldPointer) GetType__() bindings.BindingType { + return ResourceFieldPointerBindingType() +} + +func (s ResourceFieldPointer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceFieldPointer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// It represents the resource information which could identify resource. +type ResourceInfo struct { + // It will represent resource identifiers. For example, policy objects will be represented with paths and virtual machine will be represented with external ids. + ResourceIds []string + // It will represent resource type on which tag bulk operation to be performed. Supported resource type is VirtualMachine. + ResourceType *string +} + +func (s ResourceInfo) GetType__() bindings.BindingType { + return ResourceInfoBindingType() +} + +func (s ResourceInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Collection of resource info objects +type ResourceInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Resource info list results + Results []PolicyFineTuningResourceInfo +} + +func (s ResourceInfoListResult) GetType__() bindings.BindingType { + return ResourceInfoListResultBindingType() +} + +func (s ResourceInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A link to a related resource +type ResourceLink struct { + // Optional action + Action *string + // Link to resource + Href *string + // Custom relation type (follows RFC 5988 where appropriate definitions exist) + Rel *string +} + +func (s ResourceLink) GetType__() bindings.BindingType { + return ResourceLinkBindingType() +} + +func (s ResourceLink) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceLink._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Resource Operation is an Event Source that represents a resource that is being changed at very specific points of time, with regard to its interaction with dao layer. +type ResourceOperation struct { + // Possible values are: + // + // * ResourceOperation#ResourceOperation_OPERATION_TYPES_POST_CREATE + // * ResourceOperation#ResourceOperation_OPERATION_TYPES_POST_UPDATE + // * ResourceOperation#ResourceOperation_OPERATION_TYPES_PRE_DELETE + // + // Operation types. + OperationTypes []string + // Regex path representing a regex expression on resources. This regex is used to identify the object(s) that is/are the source of the Event. For instance: specifying \"Lb\* | /infra/tier-0s/vmc/ipsec-vpn-services/default\" as a source means that ANY resource starting with Lb or ANY resource with \"/infra/tier-0s/vmc/ipsec-vpn-services/default\" as path would be the source of the event in question. + ResourcePointer *string + // Possible values are: + // + // * Source#Source_RESOURCE_TYPE_RESOURCEOPERATION + // * Source#Source_RESOURCE_TYPE_APIREQUESTBODY + // + // Event Source resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ResourceOperation__TYPE_IDENTIFIER = "ResourceOperation" +const ResourceOperation_OPERATION_TYPES_POST_CREATE = "POST_CREATE" +const ResourceOperation_OPERATION_TYPES_POST_UPDATE = "POST_UPDATE" +const ResourceOperation_OPERATION_TYPES_PRE_DELETE = "PRE_DELETE" + +func (s ResourceOperation) GetType__() bindings.BindingType { + return ResourceOperationBindingType() +} + +func (s ResourceOperation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceOperation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A weak reference to an NSX resource. +type ResourceReference struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string +} + +func (s ResourceReference) GetType__() bindings.BindingType { + return ResourceReferenceBindingType() +} + +func (s ResourceReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// It represents tag operation status for a resource and details of the failure if any. +type ResourceTagStatus struct { + // Details about the error if any + Details *string + // Resource display name + ResourceDisplayName *string + // Resource id + ResourceId *string + // Possible values are: + // + // * ResourceTagStatus#ResourceTagStatus_TAG_STATUS_SUCCESS + // * ResourceTagStatus#ResourceTagStatus_TAG_STATUS_ERROR + // + // Status of tag apply or remove operation + TagStatus *string +} +const ResourceTagStatus_TAG_STATUS_SUCCESS = "Success" +const ResourceTagStatus_TAG_STATUS_ERROR = "Error" + +func (s ResourceTagStatus) GetType__() bindings.BindingType { + return ResourceTagStatusBindingType() +} + +func (s ResourceTagStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceTagStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tag operation status for particular resource type and resource ids. +type ResourceTypeTagStatus struct { + // List of resources on which tag needs to be applied + ResourceTagStatus []ResourceTagStatus + // Resource type + ResourceType *string +} + +func (s ResourceTypeTagStatus) GetType__() bindings.BindingType { + return ResourceTypeTagStatusBindingType() +} + +func (s ResourceTypeTagStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceTypeTagStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Configuration where backup files are stored for restore +type RestoreConfiguration struct { + // Passphrase used to encrypt backup files. + Passphrase *string + // The server from which backup files will be retrieved for restore. + RemoteFileServer *RemoteFileServer +} + +func (s RestoreConfiguration) GetType__() bindings.BindingType { + return RestoreConfigurationBindingType() +} + +func (s RestoreConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RestoreConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Restore step info +type RestoreStep struct { + // Restore step description + Description *string + Status *PerStepRestoreStatus + // Restore step number format: int64 + StepNumber *int64 + // Restore step value + Value *string +} + +func (s RestoreStep) GetType__() bindings.BindingType { + return RestoreStepBindingType() +} + +func (s RestoreStep) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RestoreStep._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A base class for types that track revisions +type RevisionedResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 +} + +func (s RevisionedResource) GetType__() bindings.BindingType { + return RevisionedResourceBindingType() +} + +func (s RevisionedResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RevisionedResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Role +type Role struct { + // Short identifier for the role. Must be all lower case with no spaces. + Role *string + // A short, human-friendly display name of the role. + RoleDisplayName *string +} + +func (s Role) GetType__() bindings.BindingType { + return RoleBindingType() +} + +func (s Role) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Role._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// User/Group's role binding +type RoleBinding struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The ID of the external identity source that holds the referenced external entity. Currently, only external LDAP servers are allowed. + IdentitySourceId *string + // Possible values are: + // + // * RoleBinding#RoleBinding_IDENTITY_SOURCE_TYPE_VIDM + // * RoleBinding#RoleBinding_IDENTITY_SOURCE_TYPE_LDAP + // + // Identity source type + IdentitySourceType *string + // User/Group's name + Name *string + // Roles + Roles []Role + // Possible values are: + // + // * RoleBinding#RoleBinding_STALE_TRUE + // * RoleBinding#RoleBinding_STALE_FALSE + // * RoleBinding#RoleBinding_STALE_UNKNOWN + // + // Property 'stale' can be considered to have these values - absent - This type of rolebinding does not support stale property TRUE - Rolebinding is stale in vIDM meaning the user is no longer present in vIDM FALSE - Rolebinding is available in vIDM UNKNOWN - Rolebinding's state of staleness in unknown Once rolebindings become stale, they can be deleted using the API POST /aaa/role-bindings?action=delete_stale_bindings + Stale *string + // Possible values are: + // + // * RoleBinding#RoleBinding_TYPE_REMOTE_USER + // * RoleBinding#RoleBinding_TYPE_REMOTE_GROUP + // * RoleBinding#RoleBinding_TYPE_LOCAL_USER + // * RoleBinding#RoleBinding_TYPE_PRINCIPAL_IDENTITY + // + // Type + Type_ *string +} +const RoleBinding_IDENTITY_SOURCE_TYPE_VIDM = "VIDM" +const RoleBinding_IDENTITY_SOURCE_TYPE_LDAP = "LDAP" +const RoleBinding_STALE_TRUE = "TRUE" +const RoleBinding_STALE_FALSE = "FALSE" +const RoleBinding_STALE_UNKNOWN = "UNKNOWN" +const RoleBinding_TYPE_REMOTE_USER = "remote_user" +const RoleBinding_TYPE_REMOTE_GROUP = "remote_group" +const RoleBinding_TYPE_LOCAL_USER = "local_user" +const RoleBinding_TYPE_PRINCIPAL_IDENTITY = "principal_identity" + +func (s RoleBinding) GetType__() bindings.BindingType { + return RoleBindingBindingType() +} + +func (s RoleBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type RoleBindingListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []RoleBinding +} + +func (s RoleBindingListResult) GetType__() bindings.BindingType { + return RoleBindingListResultBindingType() +} + +func (s RoleBindingListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleBindingListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type RoleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []Role +} + +func (s RoleListResult) GetType__() bindings.BindingType { + return RoleListResultBindingType() +} + +func (s RoleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Role +type RoleWithFeatures struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Features + Features []FeaturePermission + // Short identifier for the role. Must be all lower case with no spaces. + Role *string +} + +func (s RoleWithFeatures) GetType__() bindings.BindingType { + return RoleWithFeaturesBindingType() +} + +func (s RoleWithFeatures) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleWithFeatures._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type RoleWithFeaturesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []RoleWithFeatures +} + +func (s RoleWithFeaturesListResult) GetType__() bindings.BindingType { + return RoleWithFeaturesListResultBindingType() +} + +func (s RoleWithFeaturesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleWithFeaturesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Route advertisement rules and filtering +type RouteAdvertisementRule struct { + // Possible values are: + // + // * RouteAdvertisementRule#RouteAdvertisementRule_ACTION_PERMIT + // * RouteAdvertisementRule#RouteAdvertisementRule_ACTION_DENY + // + // Action to advertise filtered routes to the connected Tier0 gateway. PERMIT: Enables the advertisment DENY: Disables the advertisement + Action *string + // Display name should be unique. + Name *string + // Possible values are: + // + // * RouteAdvertisementRule#RouteAdvertisementRule_PREFIX_OPERATOR_GE + // * RouteAdvertisementRule#RouteAdvertisementRule_PREFIX_OPERATOR_EQ + // + // Prefix operator to filter subnets. GE prefix operator filters all the routes with prefix length greater than or equal to the subnets configured. EQ prefix operator filter all the routes with prefix length equal to the subnets configured. + PrefixOperator *string + // Possible values are: + // + // * RouteAdvertisementRule#RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_STATIC_ROUTES + // * RouteAdvertisementRule#RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_CONNECTED + // * RouteAdvertisementRule#RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_NAT + // * RouteAdvertisementRule#RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_LB_VIP + // * RouteAdvertisementRule#RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_LB_SNAT + // * RouteAdvertisementRule#RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_DNS_FORWARDER_IP + // * RouteAdvertisementRule#RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_IPSEC_LOCAL_ENDPOINT + // + // Enable different types of route advertisements. When not specified, routes to IPSec VPN local-endpoint subnets (TIER1_IPSEC_LOCAL_ENDPOINT) are automatically advertised. + RouteAdvertisementTypes []string + // Network CIDRs to be routed. format: ip-cidr-block + Subnets []string +} +const RouteAdvertisementRule_ACTION_PERMIT = "PERMIT" +const RouteAdvertisementRule_ACTION_DENY = "DENY" +const RouteAdvertisementRule_PREFIX_OPERATOR_GE = "GE" +const RouteAdvertisementRule_PREFIX_OPERATOR_EQ = "EQ" +const RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_STATIC_ROUTES = "TIER1_STATIC_ROUTES" +const RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_CONNECTED = "TIER1_CONNECTED" +const RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_NAT = "TIER1_NAT" +const RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_LB_VIP = "TIER1_LB_VIP" +const RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_LB_SNAT = "TIER1_LB_SNAT" +const RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_DNS_FORWARDER_IP = "TIER1_DNS_FORWARDER_IP" +const RouteAdvertisementRule_ROUTE_ADVERTISEMENT_TYPES_IPSEC_LOCAL_ENDPOINT = "TIER1_IPSEC_LOCAL_ENDPOINT" + +func (s RouteAdvertisementRule) GetType__() bindings.BindingType { + return RouteAdvertisementRuleBindingType() +} + +func (s RouteAdvertisementRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteAdvertisementRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// List of routes to be aggregated +type RouteAggregationEntry struct { + // CIDR of aggregate address format: ip-cidr-block + Prefix *string + // Send only summarized route. Summarization reduces number of routes advertised by representing multiple related routes with prefix property. + SummaryOnly *bool +} + +func (s RouteAggregationEntry) GetType__() bindings.BindingType { + return RouteAggregationEntryBindingType() +} + +func (s RouteAggregationEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteAggregationEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A Route Based VPN is more flexible, more powerful and recommended over policy based VPN. IP Tunnel port is created and all traffic routed via tunnel port is protected. Routes can be configured statically or can be learned through BGP. A route based VPN is must for establishing redundant VPN session to remote site. +type RouteBasedIPSecVpnSession struct { + // If true the default firewall rule Action is set to DROP, otherwise set to ALLOW. This filed is deprecated and recommended to change Rule action filed. Note that this filed is not synchornied with default rule field. + ForceWhitelisting *bool + // IP Tunnel interfaces. + TunnelInterfaces []IPSecVpnTunnelInterface + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_RESOURCE_TYPE_POLICYBASEDIPSECVPNSESSION + // * IPSecVpnSession#IPSecVpnSession_RESOURCE_TYPE_ROUTEBASEDIPSECVPNSESSION + // + // A Policy Based VPN requires to define protect rules that match local and peer subnets. IPSec security associations is negotiated for each pair of local and peer subnet. A Route Based VPN is more flexible, more powerful and recommended over policy based VPN. IP Tunnel port is created and all traffic routed via tunnel port is protected. Routes can be configured statically or can be learned through BGP. A route based VPN is must for establishing redundant VPN session to remote site. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_AUTHENTICATION_MODE_PSK + // * IPSecVpnSession#IPSecVpnSession_AUTHENTICATION_MODE_CERTIFICATE + // + // Peer authentication mode. PSK - In this mode a secret key shared between local and peer sites is to be used for authentication. The secret key can be a string with a maximum length of 128 characters. CERTIFICATE - In this mode a certificate defined at the global level is to be used for authentication. + AuthenticationMode *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_CNSA + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_SUITE_B_GCM_128 + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_SUITE_B_GCM_256 + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_PRIME + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_FOUNDATION + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_FIPS + // * IPSecVpnSession#IPSecVpnSession_COMPLIANCE_SUITE_NONE + // + // Compliance suite. + ComplianceSuite *string + // Possible values are: + // + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_INITIATOR + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_RESPOND_ONLY + // * IPSecVpnSession#IPSecVpnSession_CONNECTION_INITIATION_MODE_ON_DEMAND + // + // Connection initiation mode used by local endpoint to establish ike connection with peer site. INITIATOR - In this mode local endpoint initiates tunnel setup and will also respond to incoming tunnel setup requests from peer gateway. RESPOND_ONLY - In this mode, local endpoint shall only respond to incoming tunnel setup requests. It shall not initiate the tunnel setup. ON_DEMAND - In this mode local endpoint will initiate tunnel creation once first packet matching the policy rule is received and will also respond to incoming initiation request. + ConnectionInitiationMode *string + // Policy path referencing Dead Peer Detection (DPD) profile. Default is set to system default profile. + DpdProfilePath *string + // Enable/Disable IPSec VPN session. + Enabled *bool + // Policy path referencing IKE profile to be used. Default is set according to system default profile. + IkeProfilePath *string + // Policy path referencing Local endpoint. + LocalEndpointPath *string + // Public IPV4 address of the remote device terminating the VPN connection. + PeerAddress *string + // Peer ID to uniquely identify the peer site. The peer ID is the public IP address of the remote device terminating the VPN tunnel. When NAT is configured for the peer, enter the private IP address of the peer. + PeerId *string + // IPSec Pre-shared key. Maximum length of this field is 128 characters. + Psk *string + // TCP Maximum Segment Size Clamping Direction and Value. + TcpMssClamping *TcpMaximumSegmentSizeClamping + // Policy path referencing Tunnel profile to be used. Default is set to system default profile. + TunnelProfilePath *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const RouteBasedIPSecVpnSession__TYPE_IDENTIFIER = "RouteBasedIPSecVpnSession" + +func (s RouteBasedIPSecVpnSession) GetType__() bindings.BindingType { + return RouteBasedIPSecVpnSessionBindingType() +} + +func (s RouteBasedIPSecVpnSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteBasedIPSecVpnSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A Route Based L3Vpn is more flexible, more powerful and recommended over policy based. IP Tunnel subnet is created and all traffic routed through tunnel subnet is sent over tunnel. Routes can be learned through BGP. A route based L3Vpn is required when using redundant L3Vpn. +type RouteBasedL3VpnSession struct { + // Indicates if logging should be enabled for the default whitelisting rule for the VTI interface. + DefaultRuleLogging *bool + // The default firewall rule Action is set to DROP if true otherwise set to ALLOW. + ForceWhitelisting *bool + // This is a deprecated field. Any specified value is not saved and will be ignored. + RoutingConfigPath *string + // Virtual tunnel interface (VTI) port IP subnets to be used to configure route-based L3Vpn session. A max of one tunnel subnet is allowed. + TunnelSubnets []TunnelSubnet + // Possible values are: + // + // * L3VpnSession#L3VpnSession_RESOURCE_TYPE_POLICYBASEDL3VPNSESSION + // * L3VpnSession#L3VpnSession_RESOURCE_TYPE_ROUTEBASEDL3VPNSESSION + // + // - A Policy Based L3Vpn is a configuration in which protect rules to match local and remote subnet needs to be defined. Tunnel is established for each pair of local and remote subnet defined in protect rules. - A Route Based L3Vpn is more flexible, more powerful and recommended over policy based. IP Tunnel subnet is created and all traffic routed through tunnel subnet (commonly known as VTI) is sent over tunnel. Routes can be learned through BGP. A route based L3Vpn is required when using redundant L3Vpn. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const RouteBasedL3VpnSession__TYPE_IDENTIFIER = "RouteBasedL3VpnSession" + +func (s RouteBasedL3VpnSession) GetType__() bindings.BindingType { + return RouteBasedL3VpnSessionBindingType() +} + +func (s RouteBasedL3VpnSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteBasedL3VpnSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// BGP route details. +type RouteDetails struct { + // BGP AS path attribute. + AsPath *string + // BGP Local Preference attribute. format: int64 + LocalPref *int64 + // BGP Multi Exit Discriminator attribute. format: int64 + Med *int64 + // CIDR network address. format: ip-cidr-block + Network *string + // Next hop IP address. format: ip + NextHop *string + // BGP Weight attribute. format: int64 + Weight *int64 +} + +func (s RouteDetails) GetType__() bindings.BindingType { + return RouteDetailsBindingType() +} + +func (s RouteDetails) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteDetails._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Route map entry +type RouteMapEntry struct { + // Possible values are: + // + // * RouteMapEntry#RouteMapEntry_ACTION_PERMIT + // * RouteMapEntry#RouteMapEntry_ACTION_DENY + // + // Action for the route map entry + Action *string + // Community list match criteria for route map. Properties community_list_matches and prefix_list_matches are mutually exclusive and cannot be used in the same route map entry. + CommunityListMatches []CommunityMatchCriteria + // Prefix list match criteria for route map. Properties community_list_matches and prefix_list_matches are mutually exclusive and cannot be used in the same route map entry. + PrefixListMatches []string + // Set criteria for route map entry + Set *RouteMapEntrySet +} +const RouteMapEntry_ACTION_PERMIT = "PERMIT" +const RouteMapEntry_ACTION_DENY = "DENY" + +func (s RouteMapEntry) GetType__() bindings.BindingType { + return RouteMapEntryBindingType() +} + +func (s RouteMapEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteMapEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Set criteria for route map entry +type RouteMapEntrySet struct { + // AS path prepend to influence route selection. + AsPathPrepend *string + // Set BGP regular or large community for matching routes. A maximum of one value for each community type separated by space. Well-known community name, community value in aa:nn (2byte:2byte) format for regular community and community value in aa:bb:nn (4byte:4byte:4byte) format for large community are supported. + Community *string + // Local preference indicates the degree of preference for one BGP route over other BGP routes. The path with highest local preference is preferred. format: int64 + LocalPreference *int64 + // Multi exit descriminator (MED) is a hint to BGP neighbors about the preferred path into an autonomous system (AS) that has multiple entry points. A lower MED value is preferred over a higher value. format: int32 + Med *int64 + // For incoming and import route_maps on receiving both v6 global and v6 link-local address for the route, prefer to use the global address as the next hop. By default, it prefers the link-local next hop. + PreferGlobalV6NextHop *bool + // Weight is used to select a route when multiple routes are available to the same network. Route with the highest weight is preferred. format: int32 + Weight *int64 +} + +func (s RouteMapEntrySet) GetType__() bindings.BindingType { + return RouteMapEntrySetBindingType() +} + +func (s RouteMapEntrySet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteMapEntrySet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Next hop configuration for network +type RouterNexthop struct { + // Cost associated with next hop route format: int32 + AdminDistance *int64 + // Next hop gateway IP address format: ip + IpAddress *string + // Interface path associated with current route. For example: specify a policy path referencing the IPSec VPN Session. + Scope []string +} + +func (s RouterNexthop) GetType__() bindings.BindingType { + return RouterNexthopBindingType() +} + +func (s RouterNexthop) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouterNexthop._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// BGP routes per transport node. +type RoutesPerTransportNode struct { + // Array of BGP neighbor route details for this transport node. + Routes []RouteDetails + // BGP neighbor source address. format: ip + SourceAddress *string + // Transport node id + TransportNodeId *string +} + +func (s RoutesPerTransportNode) GetType__() bindings.BindingType { + return RoutesPerTransportNodeBindingType() +} + +func (s RoutesPerTransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoutesPerTransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Routing table entry. +type RoutingEntry struct { + // Admin distance. format: int32 + AdminDistance *int64 + // The policy path of the interface which is used as the next hop + _Interface *string + // Logical router component(Service Router/Distributed Router) id + LrComponentId *string + // Logical router component(Service Router/Distributed Router) type + LrComponentType *string + // Network CIDR. + Network *string + // Next hop address. format: ip + NextHop *string + // Network address CIDR. + RouteType *string +} + +func (s RoutingEntry) GetType__() bindings.BindingType { + return RoutingEntryBindingType() +} + +func (s RoutingEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoutingEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Routing table. +type RoutingTable struct { + // Entry count. format: int32 + Count *int64 + // Transport node ID. + EdgeNode *string + // Route entries. + RouteEntries []RoutingEntry +} + +func (s RoutingTable) GetType__() bindings.BindingType { + return RoutingTableBindingType() +} + +func (s RoutingTable) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoutingTable._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type RoutingTableListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of Routes per transport node ID. + Results []RoutingTable +} + +func (s RoutingTableListResult) GetType__() bindings.BindingType { + return RoutingTableListResultBindingType() +} + +func (s RoutingTableListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoutingTableListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Root of the api result set for forming rows. +type RowListField struct { + // + Alias *string + // JSON path to the root of the api result set for forming rows. + Path *string +} + +func (s RowListField) GetType__() bindings.BindingType { + return RowListFieldBindingType() +} + +func (s RowListField) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RowListField._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A rule indicates the action to be performed for various types of traffic flowing between workload groups. +type Rule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + DestinationGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the destination groups. If false, the rule applies to the destination groups + DestinationsExcluded *bool + // Possible values are: + // + // * Rule#Rule_DIRECTION_IN + // * Rule#Rule_DIRECTION_OUT + // * Rule#Rule_DIRECTION_IN_OUT + // + // Define direction of traffic. + Direction *string + // Flag to disable the rule. Default is enabled. + Disabled *bool + // Possible values are: + // + // * Rule#Rule_IP_PROTOCOL_IPV4 + // * Rule#Rule_IP_PROTOCOL_IPV6 + // * Rule#Rule_IP_PROTOCOL_IPV4_IPV6 + // + // Type of IP packet that should be matched while enforcing the rule. The value is set to IPV4_IPV6 for Layer3 rule if not specified. For Layer2/Ether rule the value must be null. + IpProtocol *string + // A flag to indicate whether rule is a default rule. + IsDefault *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // Text for additional notes on changes. + Notes *string + // Holds the list of layer 7 service profile paths. These profiles accept attributes and sub-attributes of various network services (e.g. L4 AppId, encryption algorithm, domain name, etc) as key value pairs. + Profiles []string + // This is a unique 4 byte positive number that is assigned by the system. This rule id is passed all the way down to the data path. The first 1GB (1000 to 2^30) will be shared by GM and LM with zebra style striped number space. For E.g 1000 to (1Million -1) by LM, (1M - 2M-1) by GM and so on. format: int64 + RuleId *int64 + // The list of policy paths where the rule is applied LR/Edge/T0/T1/LRP etc. Note that a given rule can be applied on multiple LRs/LRPs. + Scope []string + // This field is used to resolve conflicts between multiple Rules under Security or Gateway Policy for a Domain If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple rules with the same sequence number then their order is not deterministic. If a specific order of rules is desired, then one has to specify unique sequence numbers or use the POST request on the rule entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // In order to specify raw services this can be used, along with services which contains path to services. This can be empty or null. + ServiceEntries []*data.StructValue + // In order to specify all services, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the services array. Error will be thrown if ANY is used in conjunction with other values. + Services []string + // We need paths as duplicate names may exist for groups under different domains. Along with paths we support IP Address of type IPv4 and IPv6. IP Address can be in one of the format(CIDR, IP Address, Range of IP Address). In order to specify all groups, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the group array. Error will be thrown if ANY is used in conjunction with other values. + SourceGroups []string + // If set to true, the rule gets applied on all the groups that are NOT part of the source groups. If false, the rule applies to the source groups + SourcesExcluded *bool + // User level field which will be printed in CLI and packet logs. + Tag *string + // Possible values are: + // + // * Rule#Rule_ACTION_ALLOW + // * Rule#Rule_ACTION_DROP + // * Rule#Rule_ACTION_REJECT + // + // The action to be applied to all the services + Action *string +} +const Rule_DIRECTION_IN = "IN" +const Rule_DIRECTION_OUT = "OUT" +const Rule_DIRECTION_IN_OUT = "IN_OUT" +const Rule_IP_PROTOCOL_IPV4 = "IPV4" +const Rule_IP_PROTOCOL_IPV6 = "IPV6" +const Rule_IP_PROTOCOL_IPV4_IPV6 = "IPV4_IPV6" +const Rule_ACTION_ALLOW = "ALLOW" +const Rule_ACTION_DROP = "DROP" +const Rule_ACTION_REJECT = "REJECT" + +func (s Rule) GetType__() bindings.BindingType { + return RuleBindingType() +} + +func (s Rule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Rule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Rules +type RuleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Rule list results + Results []Rule +} + +func (s RuleListResult) GetType__() bindings.BindingType { + return RuleListResultBindingType() +} + +func (s RuleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RuleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type RuleStatistics struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Aggregated number of bytes processed by the rule. format: int64 + ByteCount *int64 + // Aggregated number of hits received by the rule. format: int64 + HitCount *int64 + // Realized id of the rule on NSX MP. Policy Manager can create more than one rule per policy rule, in which case this identifier helps to distinguish between the multple rules created. + InternalRuleId *string + // Path of the LR on which the section is applied in case of Edge FW. + LrPath *string + // Maximum value of popularity index of all rules of the type. This is aggregated statistic which are computed with lower frequency compared to individual generic rule statistics. It may have a computation delay up to 15 minutes in response to this API. format: int64 + MaxPopularityIndex *int64 + // Maximum value of sessions count of all rules of the type. This is aggregated statistic which are computed with lower frequency compared to generic rule statistics. It may have a computation delay up to 15 minutes in response to this API. format: int64 + MaxSessionCount *int64 + // Aggregated number of packets processed by the rule. format: int64 + PacketCount *int64 + // This is calculated by sessions count divided by age of the rule. format: int64 + PopularityIndex *int64 + // Path of the rule. + Rule *string + // Aggregated number of sessions processed by the rule. format: int64 + SessionCount *int64 + // Aggregated number of sessions processed by all the rules This is aggregated statistic which are computed with lower frequency compared to individual generic rule statistics. It may have a computation delay up to 15 minutes in response to this API. format: int64 + TotalSessionCount *int64 +} + +func (s RuleStatistics) GetType__() bindings.BindingType { + return RuleStatisticsBindingType() +} + +func (s RuleStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RuleStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Rule statistics for a specfic enforcement point. +type RuleStatisticsForEnforcementPoint struct { + // Rule statistics for a single enforcement point + EnforcementPoint *string + // Statistics for the specified enforcement point + Statistics *RuleStatistics +} + +func (s RuleStatisticsForEnforcementPoint) GetType__() bindings.BindingType { + return RuleStatisticsForEnforcementPointBindingType() +} + +func (s RuleStatisticsForEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RuleStatisticsForEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of rule statistics +type RuleStatisticsListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // RuleStatistics list results + Results []RuleStatisticsForEnforcementPoint +} + +func (s RuleStatisticsListResult) GetType__() bindings.BindingType { + return RuleStatisticsListResultBindingType() +} + +func (s RuleStatisticsListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RuleStatisticsListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Search response +type SearchResponse struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of records matching the search query. + Results []*data.StructValue +} + +func (s SearchResponse) GetType__() bindings.BindingType { + return SearchResponseBindingType() +} + +func (s SearchResponse) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SearchResponse._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Ordered list of Rules. +type SecurityPolicy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // - Distributed Firewall - Policy framework provides five pre-defined categories for classifying a security policy. They are \"Ethernet\",\"Emergency\", \"Infrastructure\" \"Environment\" and \"Application\". There is a pre-determined order in which the policy framework manages the priority of these security policies. Ethernet category is for supporting layer 2 firewall rules. The other four categories are applicable for layer 3 rules. Amongst them, the Emergency category has the highest priority followed by Infrastructure, Environment and then Application rules. Administrator can choose to categorize a security policy into the above categories or can choose to leave it empty. If empty it will have the least precedence w.r.t the above four categories. - Edge Firewall - Policy Framework for Edge Firewall provides six pre-defined categories \"Emergency\", \"SystemRules\", \"SharedPreRules\", \"LocalGatewayRules\", \"AutoServiceRules\" and \"Default\", in order of priority of rules. All categories are allowed for Gatetway Policies that belong to 'default' Domain. However, for user created domains, category is restricted to \"SharedPreRules\" or \"LocalGatewayRules\" only. Also, the users can add/modify/delete rules from only the \"SharedPreRules\" and \"LocalGatewayRules\" categories. If user doesn't specify the category then defaulted to \"Rules\". System generated category is used by NSX created rules, for example BFD rules. Autoplumbed category used by NSX verticals to autoplumb data path rules. Finally, \"Default\" category is the placeholder default rules with lowest in the order of priority. + Category *string + // Comments for security policy lock/unlock. + Comments *string + // This field is to indicate the internal sequence number of a policy with respect to the policies across categories. format: int32 + InternalSequenceNumber *int64 + // A flag to indicate whether policy is a default policy. + IsDefault *bool + // ID of the user who last modified the lock for the secruity policy. + LockModifiedBy *string + // SecurityPolicy locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Indicates whether a security policy should be locked. If the security policy is locked by a user, then no other user would be able to modify this security policy. Once the user releases the lock, other users can update this security policy. + Locked *bool + // The count of rules in the policy. format: int32 + RuleCount *int64 + // Provides a mechanism to apply the rules in this policy for a specified time duration. + SchedulerPath *string + // The list of group paths where the rules in this policy will get applied. This scope will take precedence over rule level scope. Supported only for security and redirection policies. In case of RedirectionPolicy, it is expected only when the policy is NS and redirecting to service chain. + Scope []string + // This field is used to resolve conflicts between security policies across domains. In order to change the sequence number of a policy one can fire a POST request on the policy entity with a query parameter action=revise The sequence number field will reflect the value of the computed sequence number upon execution of the above mentioned POST request. For scenarios where the administrator is using a template to update several security policies, the only way to set the sequence number is to explicitly specify the sequence number for each security policy. If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple policies with the same sequence number then their order is not deterministic. If a specific order of policies is desired, then one has to specify unique sequence numbers or use the POST request on the policy entity with a query parameter action=revise to let the framework assign a sequence number format: int32 + SequenceNumber *int64 + // Stateful or Stateless nature of security policy is enforced on all rules in this security policy. When it is stateful, the state of the network connects are tracked and a stateful packet inspection is performed. Layer3 security policies can be stateful or stateless. By default, they are stateful. Layer2 security policies can only be stateless. + Stateful *bool + // Ensures that a 3 way TCP handshake is done before the data packets are sent. tcp_strict=true is supported only for stateful security policies. + TcpStrict *bool + // Possible values are: + // + // * SecurityPolicy#SecurityPolicy_CONNECTIVITY_STRATEGY_WHITELIST + // * SecurityPolicy#SecurityPolicy_CONNECTIVITY_STRATEGY_BLACKLIST + // * SecurityPolicy#SecurityPolicy_CONNECTIVITY_STRATEGY_WHITELIST_ENABLE_LOGGING + // * SecurityPolicy#SecurityPolicy_CONNECTIVITY_STRATEGY_BLACKLIST_ENABLE_LOGGING + // * SecurityPolicy#SecurityPolicy_CONNECTIVITY_STRATEGY_NONE + // + // This field indicates the default connectivity policy for the security policy. Based on the connectivitiy strategy, a default rule for this security policy will be created. An appropriate action will be set on the rule based on the value of the connectivity strategy. If NONE is selected or no connectivity strategy is specified, then no default rule for the security policy gets created. The default rule that gets created will be a any-any rule and applied to entities specified in the scope of the security policy. Specifying the connectivity_strategy without specifying the scope is not allowed. The scope has to be a Group and one cannot specify IPAddress directly in the group that is used as scope. This default rule is only applicable for the Layer3 security policies. WHITELIST - Adds a default drop rule. Administrator can then use \"allow\" rules (aka whitelist) to allow traffic between groups BLACKLIST - Adds a default allow rule. Admin can then use \"drop\" rules (aka blacklist) to block traffic between groups WHITELIST_ENABLE_LOGGING - Whitelising with logging enabled BLACKLIST_ENABLE_LOGGING - Blacklisting with logging enabled NONE - No default rule is created. + ConnectivityStrategy *string + // Based on the value of the connectivity strategy, a default rule is created for the security policy. The rule id is internally assigned by the system for this default rule. format: int64 + DefaultRuleId *int64 + // Rules that are a part of this SecurityPolicy + Rules []Rule +} +const SecurityPolicy_CONNECTIVITY_STRATEGY_WHITELIST = "WHITELIST" +const SecurityPolicy_CONNECTIVITY_STRATEGY_BLACKLIST = "BLACKLIST" +const SecurityPolicy_CONNECTIVITY_STRATEGY_WHITELIST_ENABLE_LOGGING = "WHITELIST_ENABLE_LOGGING" +const SecurityPolicy_CONNECTIVITY_STRATEGY_BLACKLIST_ENABLE_LOGGING = "BLACKLIST_ENABLE_LOGGING" +const SecurityPolicy_CONNECTIVITY_STRATEGY_NONE = "NONE" + +func (s SecurityPolicy) GetType__() bindings.BindingType { + return SecurityPolicyBindingType() +} + +func (s SecurityPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SecurityPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of security policies +type SecurityPolicyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // SecurityPolicy list results + Results []SecurityPolicy +} + +func (s SecurityPolicyListResult) GetType__() bindings.BindingType { + return SecurityPolicyListResultBindingType() +} + +func (s SecurityPolicyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SecurityPolicyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Aggregate statistics of all the rules in a security policy. +type SecurityPolicyStatistics struct { + // Realized id of the section on NSX MP. Policy Manager can create more than one section per SecurityPolicy, in which case this identifier helps to distinguish between the multiple sections created. + InternalSectionId *string + // Path of the LR on which the section is applied in case of Gateway Firewall. + LrPath *string + // Total count for rule statistics format: int64 + ResultCount *int64 + // List of rule statistics. + Results []RuleStatistics +} + +func (s SecurityPolicyStatistics) GetType__() bindings.BindingType { + return SecurityPolicyStatisticsBindingType() +} + +func (s SecurityPolicyStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SecurityPolicyStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Aggregate statistics of all the rules in a security policy for a specific enforcement point. +type SecurityPolicyStatisticsForEnforcementPoint struct { + // Enforcement point to fetch the statistics from. + EnforcementPoint *string + // Statistics for the specified enforcement point + Statistics *SecurityPolicyStatistics +} + +func (s SecurityPolicyStatisticsForEnforcementPoint) GetType__() bindings.BindingType { + return SecurityPolicyStatisticsForEnforcementPointBindingType() +} + +func (s SecurityPolicyStatisticsForEnforcementPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SecurityPolicyStatisticsForEnforcementPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Security Policy statistics +type SecurityPolicyStatisticsListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Security Policy statistics list results + Results []SecurityPolicyStatisticsForEnforcementPoint +} + +func (s SecurityPolicyStatisticsListResult) GetType__() bindings.BindingType { + return SecurityPolicyStatisticsListResultBindingType() +} + +func (s SecurityPolicyStatisticsListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SecurityPolicyStatisticsListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Base security profile binding map +type SecurityProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} + +func (s SecurityProfileBindingMap) GetType__() bindings.BindingType { + return SecurityProfileBindingMapBindingType() +} + +func (s SecurityProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SecurityProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Segment configuration to attach workloads. +type Segment struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Static address binding used for the Segment. + AddressBindings []PortAddressBindingEntry + // Possible values are: + // + // * Segment#Segment_ADMIN_STATE_UP + // * Segment#Segment_ADMIN_STATE_DOWN + // + // Represents Desired state of the Segment + AdminState *string + // Advanced configuration for Segment. + AdvancedConfig *SegmentAdvancedConfig + // Multiple distinct L2 bridge profiles can be configured. + BridgeProfiles []BridgeProfileConfig + // Policy path to the connecting Tier-0 or Tier-1. Valid only for segments created under Infra. + ConnectivityPath *string + // Policy path to DHCP server or relay configuration to use for all IPv4 & IPv6 subnets configured on this segment. + DhcpConfigPath *string + // DNS domain name + DomainName *string + // This property could be used for vendor specific configuration in key value string pairs, the setting in extra_configs will be automatically inheritted by segment ports in the Segment. + ExtraConfigs []SegmentExtraConfig + // Additional config for federation. + FederationConfig *FederationConnectivityConfig + // Configuration for extending Segment through L2 VPN + L2Extension *L2Extension + // This property is deprecated. The property will continue to work as expected for existing segments. The segments that are newly created with ls_id will be ignored. Sepcify pre-creted logical switch id for Segment. + LsId *string + // Mac pool id that associated with a Segment. + MacPoolId *string + // Policy path to metadata proxy configuration. Multiple distinct MD proxies can be configured. + MetadataProxyPaths []string + // Used for overlay connectivity of segments. The overlay_id should be allocated from the pool as definied by enforcement-point. If not provided, it is auto-allocated from the default pool on the enforcement-point. format: int32 + OverlayId *int64 + // Possible values are: + // + // * Segment#Segment_REPLICATION_MODE_MTEP + // * Segment#Segment_REPLICATION_MODE_SOURCE + // + // If this field is not set for overlay segment, then the default of MTEP will be used. + ReplicationMode *string + // Subnet configuration. Max 1 subnet + Subnets []SegmentSubnet + // Policy path to the transport zone. Supported for VLAN backed segments as well as Overlay Segments. This field is required for VLAN backed Segments. Auto assigned if only one transport zone exists in the enforcement point. Default transport zone is auto assigned for overlay segments if none specified. + TransportZonePath *string + // Possible values are: + // + // * Segment#Segment_TYPE_ROUTED + // * Segment#Segment_TYPE_EXTENDED + // * Segment#Segment_TYPE_ROUTED_AND_EXTENDED + // * Segment#Segment_TYPE_DISCONNECTED + // + // Segment type based on configuration. + Type_ *string + // VLAN ids for a VLAN backed Segment. Can be a VLAN id or a range of VLAN ids specified with '-' in between. + VlanIds []string +} +const Segment_ADMIN_STATE_UP = "UP" +const Segment_ADMIN_STATE_DOWN = "DOWN" +const Segment_REPLICATION_MODE_MTEP = "MTEP" +const Segment_REPLICATION_MODE_SOURCE = "SOURCE" +const Segment_TYPE_ROUTED = "ROUTED" +const Segment_TYPE_EXTENDED = "EXTENDED" +const Segment_TYPE_ROUTED_AND_EXTENDED = "ROUTED_AND_EXTENDED" +const Segment_TYPE_DISCONNECTED = "DISCONNECTED" + +func (s Segment) GetType__() bindings.BindingType { + return SegmentBindingType() +} + +func (s Segment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Segment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Advanced configuration for Segment +type SegmentAdvancedConfig struct { + // Possible values are: + // + // * SegmentAdvancedConfig#SegmentAdvancedConfig_CONNECTIVITY_ON + // * SegmentAdvancedConfig#SegmentAdvancedConfig_CONNECTIVITY_OFF + // + // Connectivity configuration to manually connect (ON) or disconnect (OFF) a logical entity from network topology. Only valid for Tier1 Segment. + Connectivity *string + // Policy path to IP address pools. + AddressPoolPaths []string + // When set to true, all the ports created on this segment will behave in a hybrid fashion. The hybrid port indicates to NSX that the VM intends to operate in underlay mode, but retains the ability to forward egress traffic to the NSX overlay network. This property is only applicable for segment created with transport zone type OVERLAY_STANDARD. This property cannot be modified after segment is created. + Hybrid *bool + // This property is used to enable proximity routing with local egress. When set to true, logical router interface (downlink) connecting Segment to Tier0/Tier1 gateway is configured with prefix-length 32. + LocalEgress *bool + // An ordered list of routing policies to forward traffic to the next hop. + LocalEgressRoutingPolicies []LocalEgressRoutingEntry + // Enable multicast for a segment. Only applicable for segments connected to Tier0 gateway. + Multicast *bool + // The name of the switching uplink teaming policy for the Segment. This name corresponds to one of the switching uplink teaming policy names listed in TransportZone associated with the Segment. See transport_zone_path property above for more details. When this property is not specified, the segment will not have a teaming policy associated with it and the host switch's default teaming policy will be used by MP. + UplinkTeamingPolicyName *string +} +const SegmentAdvancedConfig_CONNECTIVITY_ON = "ON" +const SegmentAdvancedConfig_CONNECTIVITY_OFF = "OFF" + +func (s SegmentAdvancedConfig) GetType__() bindings.BindingType { + return SegmentAdvancedConfigBindingType() +} + +func (s SegmentAdvancedConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentAdvancedConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Segment state on specific Enforcement Point. +type SegmentConfigurationState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * SegmentConfigurationState#SegmentConfigurationState_STATE_PENDING + // * SegmentConfigurationState#SegmentConfigurationState_STATE_IN_PROGRESS + // * SegmentConfigurationState#SegmentConfigurationState_STATE_SUCCESS + // * SegmentConfigurationState#SegmentConfigurationState_STATE_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_PARTIAL_SUCCESS + // * SegmentConfigurationState#SegmentConfigurationState_STATE_ORPHANED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_UNKNOWN + // * SegmentConfigurationState#SegmentConfigurationState_STATE_ERROR + // * SegmentConfigurationState#SegmentConfigurationState_STATE_IN_SYNC + // * SegmentConfigurationState#SegmentConfigurationState_STATE_NOT_AVAILABLE + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_DEPLOYMENT_QUEUED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_DEPLOYMENT_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_POWER_ON_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_REGISTRATION_PENDING + // * SegmentConfigurationState#SegmentConfigurationState_STATE_NODE_NOT_READY + // * SegmentConfigurationState#SegmentConfigurationState_STATE_NODE_READY + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_POWER_OFF_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_UNDEPLOY_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * SegmentConfigurationState#SegmentConfigurationState_STATE_EDGE_CONFIG_ERROR + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_REGISTRATION_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * SegmentConfigurationState#SegmentConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * SegmentConfigurationState#SegmentConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * SegmentConfigurationState#SegmentConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * SegmentConfigurationState#SegmentConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * SegmentConfigurationState#SegmentConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * SegmentConfigurationState#SegmentConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * SegmentConfigurationState#SegmentConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * SegmentConfigurationState#SegmentConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * SegmentConfigurationState#SegmentConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * SegmentConfigurationState#SegmentConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * SegmentConfigurationState#SegmentConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * SegmentConfigurationState#SegmentConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * SegmentConfigurationState#SegmentConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME + // * SegmentConfigurationState#SegmentConfigurationState_STATE_TRANSPORT_NODE_READY + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_NETWORK_EDIT_PENDING + // * SegmentConfigurationState#SegmentConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * SegmentConfigurationState#SegmentConfigurationState_STATE_MPA_DISCONNECTED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_RENAME_PENDING + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_CONFIG_EDIT_PENDING + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_NETWORK_EDIT_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_RENAME_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_CONFIG_EDIT_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_CONFIG_DISCREPANCY + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_NODE_REFRESH_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * SegmentConfigurationState#SegmentConfigurationState_STATE_REGISTRATION_TIMEDOUT + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Segment path + SegmentPath *string +} +const SegmentConfigurationState_STATE_PENDING = "pending" +const SegmentConfigurationState_STATE_IN_PROGRESS = "in_progress" +const SegmentConfigurationState_STATE_SUCCESS = "success" +const SegmentConfigurationState_STATE_FAILED = "failed" +const SegmentConfigurationState_STATE_PARTIAL_SUCCESS = "partial_success" +const SegmentConfigurationState_STATE_ORPHANED = "orphaned" +const SegmentConfigurationState_STATE_UNKNOWN = "unknown" +const SegmentConfigurationState_STATE_ERROR = "error" +const SegmentConfigurationState_STATE_IN_SYNC = "in_sync" +const SegmentConfigurationState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const SegmentConfigurationState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const SegmentConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const SegmentConfigurationState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const SegmentConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const SegmentConfigurationState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const SegmentConfigurationState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const SegmentConfigurationState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const SegmentConfigurationState_STATE_NODE_READY = "NODE_READY" +const SegmentConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const SegmentConfigurationState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const SegmentConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const SegmentConfigurationState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const SegmentConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const SegmentConfigurationState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const SegmentConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const SegmentConfigurationState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const SegmentConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const SegmentConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const SegmentConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const SegmentConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const SegmentConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const SegmentConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const SegmentConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const SegmentConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const SegmentConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const SegmentConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const SegmentConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const SegmentConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const SegmentConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const SegmentConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const SegmentConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const SegmentConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const SegmentConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const SegmentConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const SegmentConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const SegmentConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const SegmentConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const SegmentConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const SegmentConfigurationState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const SegmentConfigurationState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const SegmentConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const SegmentConfigurationState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const SegmentConfigurationState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const SegmentConfigurationState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const SegmentConfigurationState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const SegmentConfigurationState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const SegmentConfigurationState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const SegmentConfigurationState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const SegmentConfigurationState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const SegmentConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const SegmentConfigurationState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" + +func (s SegmentConfigurationState) GetType__() bindings.BindingType { + return SegmentConfigurationStateBindingType() +} + +func (s SegmentConfigurationState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentConfigurationState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP IPv4 and IPv6 configurations are extended from this abstract class. +type SegmentDhcpConfig struct { + // IP address of DNS servers for subnet. DNS server IP address must belong to the same address family as segment gateway_address property. format: ip + DnsServers []string + // DHCP lease time in seconds. When specified, this property overwrites lease time configured DHCP server config. format: int64 + LeaseTime *int64 + // Possible values are: + // + // * SegmentDhcpConfig#SegmentDhcpConfig_RESOURCE_TYPE_SEGMENTDHCPV4CONFIG + // * SegmentDhcpConfig#SegmentDhcpConfig_RESOURCE_TYPE_SEGMENTDHCPV6CONFIG + ResourceType string + // IP address of the DHCP server in CIDR format. The server_address is mandatory in case this segment has provided a dhcp_config_path and it represents a DHCP server config. If this SegmentDhcpConfig is a SegmentDhcpV4Config, the address must be an IPv4 address. If this is a SegmentDhcpV6Config, the address must be an IPv6 address. This address must not overlap the ip-ranges of the subnet, or the gateway address of the subnet, or the DHCP static-binding addresses of this segment. format: ip-cidr-block + ServerAddress *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SegmentDhcpConfig__TYPE_IDENTIFIER = "SegmentDhcpConfig" +const SegmentDhcpConfig_RESOURCE_TYPE_SEGMENTDHCPV4CONFIG = "SegmentDhcpV4Config" +const SegmentDhcpConfig_RESOURCE_TYPE_SEGMENTDHCPV6CONFIG = "SegmentDhcpV6Config" + +func (s SegmentDhcpConfig) GetType__() bindings.BindingType { + return SegmentDhcpConfigBindingType() +} + +func (s SegmentDhcpConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentDhcpConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP configuration of IPv4 subnet in a segment +type SegmentDhcpV4Config struct { + // IPv4 DHCP options for segment subnet. + Options *DhcpV4Options + // IP address of DNS servers for subnet. DNS server IP address must belong to the same address family as segment gateway_address property. format: ip + DnsServers []string + // DHCP lease time in seconds. When specified, this property overwrites lease time configured DHCP server config. format: int64 + LeaseTime *int64 + // Possible values are: + // + // * SegmentDhcpConfig#SegmentDhcpConfig_RESOURCE_TYPE_SEGMENTDHCPV4CONFIG + // * SegmentDhcpConfig#SegmentDhcpConfig_RESOURCE_TYPE_SEGMENTDHCPV6CONFIG + ResourceType string + // IP address of the DHCP server in CIDR format. The server_address is mandatory in case this segment has provided a dhcp_config_path and it represents a DHCP server config. If this SegmentDhcpConfig is a SegmentDhcpV4Config, the address must be an IPv4 address. If this is a SegmentDhcpV6Config, the address must be an IPv6 address. This address must not overlap the ip-ranges of the subnet, or the gateway address of the subnet, or the DHCP static-binding addresses of this segment. format: ip-cidr-block + ServerAddress *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SegmentDhcpV4Config__TYPE_IDENTIFIER = "SegmentDhcpV4Config" + +func (s SegmentDhcpV4Config) GetType__() bindings.BindingType { + return SegmentDhcpV4ConfigBindingType() +} + +func (s SegmentDhcpV4Config) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentDhcpV4Config._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// DHCP configuration of IPv6 subnet in a segment +type SegmentDhcpV6Config struct { + // Domain names for subnet. + DomainNames []string + // Excluded addresses to define dynamic ip allocation ranges. format: address-or-block-or-range + ExcludedRanges []string + // IPv6 DHCP options based on the address family of the subnet. + Options *DhcpV6Options + // The length of time that a valid address is preferred. When the preferred lifetime expires, the address becomes deprecated. format: int64 + PreferredTime *int64 + // IPv6 address of SNTP servers for subnet. format: ipv6 + SntpServers []string + // IP address of DNS servers for subnet. DNS server IP address must belong to the same address family as segment gateway_address property. format: ip + DnsServers []string + // DHCP lease time in seconds. When specified, this property overwrites lease time configured DHCP server config. format: int64 + LeaseTime *int64 + // Possible values are: + // + // * SegmentDhcpConfig#SegmentDhcpConfig_RESOURCE_TYPE_SEGMENTDHCPV4CONFIG + // * SegmentDhcpConfig#SegmentDhcpConfig_RESOURCE_TYPE_SEGMENTDHCPV6CONFIG + ResourceType string + // IP address of the DHCP server in CIDR format. The server_address is mandatory in case this segment has provided a dhcp_config_path and it represents a DHCP server config. If this SegmentDhcpConfig is a SegmentDhcpV4Config, the address must be an IPv4 address. If this is a SegmentDhcpV6Config, the address must be an IPv6 address. This address must not overlap the ip-ranges of the subnet, or the gateway address of the subnet, or the DHCP static-binding addresses of this segment. format: ip-cidr-block + ServerAddress *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SegmentDhcpV6Config__TYPE_IDENTIFIER = "SegmentDhcpV6Config" + +func (s SegmentDhcpV6Config) GetType__() bindings.BindingType { + return SegmentDhcpV6ConfigBindingType() +} + +func (s SegmentDhcpV6Config) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentDhcpV6Config._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between discovery profile and Segment. Using this entity, user can specify intent for applying discovery profile to particular segments. +type SegmentDiscoveryProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated IP Discovery Profile + IpDiscoveryProfilePath *string + // PolicyPath of associated Mac Discovery Profile + MacDiscoveryProfilePath *string +} + +func (s SegmentDiscoveryProfileBindingMap) GetType__() bindings.BindingType { + return SegmentDiscoveryProfileBindingMapBindingType() +} + +func (s SegmentDiscoveryProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentDiscoveryProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Segment Discovery Profile Binding Maps +type SegmentDiscoveryProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Segment Discovery Profile Binding Map list results + Results []SegmentDiscoveryProfileBindingMap +} + +func (s SegmentDiscoveryProfileBindingMapListResult) GetType__() bindings.BindingType { + return SegmentDiscoveryProfileBindingMapListResultBindingType() +} + +func (s SegmentDiscoveryProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentDiscoveryProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Segment extra config is intended for supporting vendor specific configuration on the data path, it can be set as key value string pairs on either segment or segment port. +type SegmentExtraConfig struct { + // Key value pair in string for the configuration + ConfigPair *KeyValuePair +} + +func (s SegmentExtraConfig) GetType__() bindings.BindingType { + return SegmentExtraConfigBindingType() +} + +func (s SegmentExtraConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentExtraConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Segments +type SegmentListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Segment list results + Results []Segment +} + +func (s SegmentListResult) GetType__() bindings.BindingType { + return SegmentListResultBindingType() +} + +func (s SegmentListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between monitoring profile and Segment. Using this entity, you can specify intent for applying monitoring profile to particular segment. +type SegmentMonitoringProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated IPFIX L2 Profile + IpfixL2ProfilePath *string + // PolicyPath of associated Port Mirroring Profile + PortMirroringProfilePath *string +} + +func (s SegmentMonitoringProfileBindingMap) GetType__() bindings.BindingType { + return SegmentMonitoringProfileBindingMapBindingType() +} + +func (s SegmentMonitoringProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentMonitoringProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Segment Monitoring Profile Binding Maps +type SegmentMonitoringProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Segment Monitoring Profile Binding Map list results + Results []SegmentMonitoringProfileBindingMap +} + +func (s SegmentMonitoringProfileBindingMapListResult) GetType__() bindings.BindingType { + return SegmentMonitoringProfileBindingMapListResultBindingType() +} + +func (s SegmentMonitoringProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentMonitoringProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Policy port will create LogicalPort on LogicalSwitch corresponding to the Segment. Address bindings cannot be removed after realization. +type SegmentPort struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Static address binding used for the port. + AddressBindings []PortAddressBindingEntry + // Possible values are: + // + // * SegmentPort#SegmentPort_ADMIN_STATE_UP + // * SegmentPort#SegmentPort_ADMIN_STATE_DOWN + // + // Represents desired state of the segment port + AdminState *string + // Only VIF attachment is supported + Attachment *PortAttachment + // This property could be used for vendor specific configuration in key value string pairs. Segment port setting will override segment setting if the same key was set on both segment and segment port. + ExtraConfigs []SegmentExtraConfig + // IP Discovery module uses various mechanisms to discover address bindings being used on each segment port. If a user would like to ignore any specific discovered address bindings or prevent the discovery of a particular set of discovered bindings, then those address bindings can be provided here. Currently IP range in CIDR format is not supported. + IgnoredAddressBindings []PortAddressBindingEntry + // Possible values are: + // + // * SegmentPort#SegmentPort_INIT_STATE_VLAN + // + // Set initial state when a new logical port is created. 'UNBLOCKED_VLAN' means new port will be unblocked on traffic in creation, also VLAN will be set with corresponding logical switch setting. This port setting can only be configured at port creation, and cannot be modified. + InitState *string + // This field will refer to the source site on which the segment port is discovered. This field is populated by GM, when it receives corresponding notification from LM. + SourceSiteId *string +} +const SegmentPort_ADMIN_STATE_UP = "UP" +const SegmentPort_ADMIN_STATE_DOWN = "DOWN" +const SegmentPort_INIT_STATE_VLAN = "UNBLOCKED_VLAN" + +func (s SegmentPort) GetType__() bindings.BindingType { + return SegmentPortBindingType() +} + +func (s SegmentPort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentPort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// List SegmentPort objects +type SegmentPortListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Place holder for the list result + Results []SegmentPort +} + +func (s SegmentPortListResult) GetType__() bindings.BindingType { + return SegmentPortListResultBindingType() +} + +func (s SegmentPortListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentPortListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Segment port statistics on specific Enforcement Point. +type SegmentPortStatistics struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + DroppedBySecurityPackets *PacketsDroppedBySecurity + MacLearning *MacLearningCounters + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical port + LogicalPortId *string +} + +func (s SegmentPortStatistics) GetType__() bindings.BindingType { + return SegmentPortStatisticsBindingType() +} + +func (s SegmentPortStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentPortStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between qos profile and Segment. Using this entity, you can specify intent for applying qos profile to particular segment. +type SegmentQosProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated QoS Profile + QosProfilePath *string +} + +func (s SegmentQosProfileBindingMap) GetType__() bindings.BindingType { + return SegmentQosProfileBindingMapBindingType() +} + +func (s SegmentQosProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentQosProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Segment QoS Profile Binding Maps +type SegmentQosProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Segment QoS Profile Binding Map list results + Results []SegmentQosProfileBindingMap +} + +func (s SegmentQosProfileBindingMapListResult) GetType__() bindings.BindingType { + return SegmentQosProfileBindingMapListResultBindingType() +} + +func (s SegmentQosProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentQosProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Security features extended by policy operations for securing logical segments. +type SegmentSecurityProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Pre-defined list of allowed MAC addresses to be excluded from BPDU filtering. List of allowed MACs - 01:80:c2:00:00:00, 01:80:c2:00:00:01, 01:80:c2:00:00:02, 01:80:c2:00:00:03, 01:80:c2:00:00:04, 01:80:c2:00:00:05, 01:80:c2:00:00:06, 01:80:c2:00:00:07, 01:80:c2:00:00:08, 01:80:c2:00:00:09, 01:80:c2:00:00:0a, 01:80:c2:00:00:0b, 01:80:c2:00:00:0c, 01:80:c2:00:00:0d, 01:80:c2:00:00:0e, 01:80:c2:00:00:0f, 00:e0:2b:00:00:00, 00:e0:2b:00:00:04, 00:e0:2b:00:00:06, 01:00:0c:00:00:00, 01:00:0c:cc:cc:cc, 01:00:0c:cc:cc:cd, 01:00:0c:cd:cd:cd, 01:00:0c:cc:cc:c0, 01:00:0c:cc:cc:c1, 01:00:0c:cc:cc:c2, 01:00:0c:cc:cc:c3, 01:00:0c:cc:cc:c4, 01:00:0c:cc:cc:c5, 01:00:0c:cc:cc:c6, 01:00:0c:cc:cc:c7 format: mac-address + BpduFilterAllow []string + // Indicates whether BPDU filter is enabled. BPDU filtering is enabled by default. + BpduFilterEnable *bool + // Filters DHCP server and/or client traffic. DHCP server blocking is enabled and client blocking is disabled by default. + DhcpClientBlockEnabled *bool + // Filters DHCP server and/or client IPv6 traffic. DHCP server blocking is enabled and client blocking is disabled by default. + DhcpClientBlockV6Enabled *bool + // Filters DHCP server and/or client traffic. DHCP server blocking is enabled and client blocking is disabled by default. + DhcpServerBlockEnabled *bool + // Filters DHCP server and/or client IPv6 traffic. DHCP server blocking is enabled and client blocking is disabled by default. + DhcpServerBlockV6Enabled *bool + // A flag to block all traffic except IP/(G)ARP/BPDU. + NonIpTrafficBlockEnabled *bool + // Enable or disable Router Advertisement Guard. + RaGuardEnabled *bool + // Allows configuration of rate limits for broadcast and multicast traffic. Rate limiting is disabled by default + RateLimits *TrafficRateLimits + // Enable or disable Rate Limits + RateLimitsEnabled *bool +} + +func (s SegmentSecurityProfile) GetType__() bindings.BindingType { + return SegmentSecurityProfileBindingType() +} + +func (s SegmentSecurityProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentSecurityProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains the binding relationship between segment and security profile. +type SegmentSecurityProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // The policy path of the asscociated Segment Security profile + SegmentSecurityProfilePath *string + // The policy path of the asscociated SpoofGuard profile + SpoofguardProfilePath *string +} + +func (s SegmentSecurityProfileBindingMap) GetType__() bindings.BindingType { + return SegmentSecurityProfileBindingMapBindingType() +} + +func (s SegmentSecurityProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentSecurityProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of segment security profile binding maps +type SegmentSecurityProfileBindingMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Segment security profile binding map list results + Results []SegmentSecurityProfileBindingMap +} + +func (s SegmentSecurityProfileBindingMapListResult) GetType__() bindings.BindingType { + return SegmentSecurityProfileBindingMapListResultBindingType() +} + +func (s SegmentSecurityProfileBindingMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentSecurityProfileBindingMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of segment security profiles +type SegmentSecurityProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Segment Security profile list results + Results []SegmentSecurityProfile +} + +func (s SegmentSecurityProfileListResult) GetType__() bindings.BindingType { + return SegmentSecurityProfileListResultBindingType() +} + +func (s SegmentSecurityProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentSecurityProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Segment statistics on specific Enforcement Point. +type SegmentStatistics struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + DroppedBySecurityPackets *PacketsDroppedBySecurity + MacLearning *MacLearningCounters + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical Switch + LogicalSwitchId *string +} + +func (s SegmentStatistics) GetType__() bindings.BindingType { + return SegmentStatisticsBindingType() +} + +func (s SegmentStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Subnet configuration for segment +type SegmentSubnet struct { + // Additional DHCP configuration for current subnet. + DhcpConfig *data.StructValue + // DHCP address ranges are used for dynamic IP allocation. Supports address range and CIDR formats. First valid host address from the first value is assigned to DHCP server IP address. Existing values cannot be deleted or modified, but additional DHCP ranges can be added. format: address-or-block-or-range + DhcpRanges []string + // Gateway IP address in CIDR format for both IPv4 and IPv6. format: ip-cidr-block + GatewayAddress *string + // Network CIDR for this subnet calculated from gateway_addresses and prefix_len. + Network *string +} + +func (s SegmentSubnet) GetType__() bindings.BindingType { + return SegmentSubnetBindingType() +} + +func (s SegmentSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SegmentSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Resources to take action on +type SelectableResourceReference struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string + // Set to true if this resource has been selected to be acted upon + Selected *bool +} + +func (s SelectableResourceReference) GetType__() bindings.BindingType { + return SelectableResourceReferenceBindingType() +} + +func (s SelectableResourceReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SelectableResourceReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// The server will populate this field when returing the resource. Ignored on PUT and POST. +type SelfResourceLink struct { + // Optional action + Action *string + // Link to resource + Href *string + // Custom relation type (follows RFC 5988 where appropriate definitions exist) + Rel *string +} + +func (s SelfResourceLink) GetType__() bindings.BindingType { + return SelfResourceLinkBindingType() +} + +func (s SelfResourceLink) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SelfResourceLink._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Used while defining a CommunicationEntry. A service may have multiple service entries. +type Service struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // The flag, if true, indicates that service is created in the system by default. Such default services can't be modified/deleted. + IsDefault *bool + // Service type + ServiceEntries []*data.StructValue + // Type of service, EITHER or NON_ETHER + ServiceType *string +} + +func (s Service) GetType__() bindings.BindingType { + return ServiceBindingType() +} + +func (s Service) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Service._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A Service entry that describes traffic +type ServiceEntry struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY + // * ServiceEntry#ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ServiceEntry__TYPE_IDENTIFIER = "ServiceEntry" +const ServiceEntry_RESOURCE_TYPE_IPPROTOCOLSERVICEENTRY = "IPProtocolServiceEntry" +const ServiceEntry_RESOURCE_TYPE_IGMPTYPESERVICEENTRY = "IGMPTypeServiceEntry" +const ServiceEntry_RESOURCE_TYPE_ICMPTYPESERVICEENTRY = "ICMPTypeServiceEntry" +const ServiceEntry_RESOURCE_TYPE_ALGTYPESERVICEENTRY = "ALGTypeServiceEntry" +const ServiceEntry_RESOURCE_TYPE_L4PORTSETSERVICEENTRY = "L4PortSetServiceEntry" +const ServiceEntry_RESOURCE_TYPE_ETHERTYPESERVICEENTRY = "EtherTypeServiceEntry" +const ServiceEntry_RESOURCE_TYPE_NESTEDSERVICESERVICEENTRY = "NestedServiceServiceEntry" + +func (s ServiceEntry) GetType__() bindings.BindingType { + return ServiceEntryBindingType() +} + +func (s ServiceEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Service entries +type ServiceEntryListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Service entry list results + Results []*data.StructValue +} + +func (s ServiceEntryListResult) GetType__() bindings.BindingType { + return ServiceEntryListResultBindingType() +} + +func (s ServiceEntryListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceEntryListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A ServiceInstanceEndpoint belongs to one ByodPolicyServiceInstance and is attached to one ServiceInterface. A ServiceInstanceEndpoint represents a redirection target for a RedirectionPolicy. +type ServiceInstanceEndpoint struct { + // Path of Service Interface to which this ServiceInstanceEndpoint is connected. + ServiceInterfacePath *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseEndpoint#BaseEndpoint_RESOURCE_TYPE_VIRTUALENDPOINT + // * BaseEndpoint#BaseEndpoint_RESOURCE_TYPE_SERVICEINSTANCEENDPOINT + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // IPs where either inbound or outbound traffic is to be redirected. + TargetIps []IPInfo +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ServiceInstanceEndpoint__TYPE_IDENTIFIER = "ServiceInstanceEndpoint" + +func (s ServiceInstanceEndpoint) GetType__() bindings.BindingType { + return ServiceInstanceEndpointBindingType() +} + +func (s ServiceInstanceEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInstanceEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Service interface configuration for internal connectivity. +type ServiceInterface struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Specify IP address and network prefix for interface. + Subnets []InterfaceSubnet +} + +func (s ServiceInterface) GetType__() bindings.BindingType { + return ServiceInterfaceBindingType() +} + +func (s ServiceInterface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInterface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Service Interfaces +type ServiceInterfaceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Service Interface list results + Results []ServiceInterface +} + +func (s ServiceInterfaceListResult) GetType__() bindings.BindingType { + return ServiceInterfaceListResultBindingType() +} + +func (s ServiceInterfaceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInterfaceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Services +type ServiceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Service list results + Results []Service +} + +func (s ServiceListResult) GetType__() bindings.BindingType { + return ServiceListResultBindingType() +} + +func (s ServiceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// An anchor object representing the intent to consume a given 3rd party service. +type ServiceReference struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // A Service's operational state can be enabled or disabled. Note that would work only for NetX type of services and would not work for Guest Introsp- ection type of Services. TRUE - The Service should be enabled FALSE - The Service should be disabled + Enabled *bool + // Unique name of Partner Service to be consumed for redirection. + PartnerServiceName *string +} + +func (s ServiceReference) GetType__() bindings.BindingType { + return ServiceReferenceBindingType() +} + +func (s ServiceReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Service Segment configuration to attach Service Insertion VM. +type ServiceSegment struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Policy paths of logical routers or ports | to which this Service Segment can be connected. + LrPaths []string + // Policy path to transport zone. Only overlay transport zone is supported. + TransportZonePath *string +} + +func (s ServiceSegment) GetType__() bindings.BindingType { + return ServiceSegmentBindingType() +} + +func (s ServiceSegment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceSegment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of session timer profile binding maps +type SessionTimerProfileBindingListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Session timer profile binding maps list results + Results []SessionTimerProfileBindingMap +} + +func (s SessionTimerProfileBindingListResult) GetType__() bindings.BindingType { + return SessionTimerProfileBindingListResultBindingType() +} + +func (s SessionTimerProfileBindingListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SessionTimerProfileBindingListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// This entity will be used to establish association between Session Timer profile and Logical Routers. +type SessionTimerProfileBindingMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // PolicyPath of associated Profile + ProfilePath *string +} + +func (s SessionTimerProfileBindingMap) GetType__() bindings.BindingType { + return SessionTimerProfileBindingMapBindingType() +} + +func (s SessionTimerProfileBindingMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SessionTimerProfileBindingMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Set Fields is an action to set fields of the source event. +type SetFields struct { + // Field Settings. + FieldSettings []FieldSetting + // Possible values are: + // + // * Action#Action_RESOURCE_TYPE_PATCHRESOURCES + // * Action#Action_RESOURCE_TYPE_SETFIELDS + // + // Reaction Action resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SetFields__TYPE_IDENTIFIER = "SetFields" + +func (s SetFields) GetType__() bindings.BindingType { + return SetFieldsBindingType() +} + +func (s SetFields) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SetFields._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Site represents an NSX deployment having its own set of NSX clusters and transport nodes. It may correspond to a Data Center, VMC deployment, or NSX-Cloud deployment managed via CSM. +type Site struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Both the local site and the remote site must have edge clusters correctly configured and remote tunnel endpoint (RTEP) interfaces must be defined, or onboarding will fail. + FailIfRtepMisconfigured *bool + // Fail onboarding if maximum RTT exceeded. + FailIfRttExceeded *bool + // System managed federation config. + FederationConfig *GmFederationSiteConfig + // If provided and fail_if_rtt_exceeded is true, onboarding of the site will fail if measured RTT is greater than this value. format: int64 + MaximumRtt *int64 + // To onboard a site, the connection information (username, password, and API thumbprint) for at least one NSX manager node in the remote site must be provided. Once the site has been successfully onboarded, the site_connection_info is discarded and authentication to the remote site occurs using an X.509 client certificate. + SiteConnectionInfo []SiteNodeConnectionInfo + // 12-bit system generated site number format: int64 + SiteNumber *int64 +} + +func (s Site) GetType__() bindings.BindingType { + return SiteBindingType() +} + +func (s Site) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Site._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Index for cross site allocation for edge cluster and its members referred by gateway. +type SiteAllocationIndexForEdge struct { + // Unqiue edge cluster node index across sites based on stretch of the Gateway. For example, if a Gateway is streched to sites S1 with one edge cluster of 3 nodes and site S2 with one edge cluster of 2 nodes, the in the Global Manager will allocate the index for 5 edge nodes and 2 cluster in the rage 0 to 7. format: int64 + Index *int64 + // Edge cluster or edge node path + TargetResourcePath *string +} + +func (s SiteAllocationIndexForEdge) GetType__() bindings.BindingType { + return SiteAllocationIndexForEdgeBindingType() +} + +func (s SiteAllocationIndexForEdge) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SiteAllocationIndexForEdge._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Site fedeation configuration. +type SiteFederationConfig struct { + // Remote tunnel endpoint IP addresses format: ip + RtepIps []string + // Site UUID + SiteId *string + // Unique site index allocated (from range 0-4095) format: int64 + SiteIndex *int64 + // Site path + SitePath *string +} + +func (s SiteFederationConfig) GetType__() bindings.BindingType { + return SiteFederationConfigBindingType() +} + +func (s SiteFederationConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SiteFederationConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Sites. +type SiteListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Site list result. + Results []Site +} + +func (s SiteListResult) GetType__() bindings.BindingType { + return SiteListResultBindingType() +} + +func (s SiteListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SiteListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Credential info to connect to a node in the federated remote site. +type SiteNodeConnectionInfo struct { + // Please specify the fqdn of the Management Node of your site. + Fqdn *string + // Password to connect to Site's Local Manager. + Password *string + // Thumbprint of Site's Local Manager in the form of a SHA-256 hash represented in lower case HEX. + Thumbprint *string + // Username to connect to Site's Local Manager. + Username *string +} + +func (s SiteNodeConnectionInfo) GetType__() bindings.BindingType { + return SiteNodeConnectionInfoBindingType() +} + +func (s SiteNodeConnectionInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SiteNodeConnectionInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Source that is logically deemed to be the \"object\" upon which the Event in question initially occurred upon. The Source is responsible for providing information of the occurred event. Some example sources include: - Resource. - API. +type Source struct { + // Possible values are: + // + // * Source#Source_RESOURCE_TYPE_RESOURCEOPERATION + // * Source#Source_RESOURCE_TYPE_APIREQUESTBODY + // + // Event Source resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const Source__TYPE_IDENTIFIER = "Source" +const Source_RESOURCE_TYPE_RESOURCEOPERATION = "ResourceOperation" +const Source_RESOURCE_TYPE_APIREQUESTBODY = "ApiRequestBody" + +func (s Source) GetType__() bindings.BindingType { + return SourceBindingType() +} + +func (s Source) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Source._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Source Field Evaluation represents an evaluation on resource fields. A source field evaluation will be evaluated against an Event Source which is of type Resource Operation. For instance, the attribute constraint could be related to the necessity that one of the source fields equals one of the specified values. +type SourceFieldEvaluation struct { + // Expected values necessary to apply the specified operation on the source field value. + Expected []string + // Field in the form of a pointer, describing the location of the attribute within the source of the event. + FieldPointer *string + // Possible values are: + // + // * SourceFieldEvaluation#SourceFieldEvaluation_OPERATOR_EQ + // * SourceFieldEvaluation#SourceFieldEvaluation_OPERATOR_NOT_EQ + // + // Logical operator. + Operator *string + // Possible values are: + // + // * Evaluation#Evaluation_RESOURCE_TYPE_SOURCEFIELDEVALUATION + // + // Criterion Evaluation resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SourceFieldEvaluation__TYPE_IDENTIFIER = "SourceFieldEvaluation" +const SourceFieldEvaluation_OPERATOR_EQ = "EQ" +const SourceFieldEvaluation_OPERATOR_NOT_EQ = "NOT_EQ" + +func (s SourceFieldEvaluation) GetType__() bindings.BindingType { + return SourceFieldEvaluationBindingType() +} + +func (s SourceFieldEvaluation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SourceFieldEvaluation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the strech information for a federated entity available only on local manager. +type Span struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // List of SpanSiteInfos representing the strech of the entity. + Sites []SpanSiteInfo + // Represents Policy resource type streached entity's span leader. + SpanLeader *string + // Represents Policy resource path of streached entity. + SpanResource *string + // Policy resource type of the streached entity. + SpanResourceType *string +} + +func (s Span) GetType__() bindings.BindingType { + return SpanBindingType() +} + +func (s Span) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Span._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the Site resource information for a Span entity including both the internal id as well as the site path. +type SpanSiteInfo struct { + // Site UUID representing the Site resource + SiteId *string + // Path of the Site resource + SitePath *string +} + +func (s SpanSiteInfo) GetType__() bindings.BindingType { + return SpanSiteInfoBindingType() +} + +func (s SpanSiteInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SpanSiteInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// SpoofGuard is a tool that is designed to prevent virtual machines in your environment from sending traffic with IP addresses which are not authorized to send traffic from. A SpoofGuard policy profile once enabled blocks the traffic determined to be spoofed. +type SpoofGuardProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If true, enable the SpoofGuard, which only allows VM sending traffic with the IPs in the whitelist. + AddressBindingWhitelist *bool +} + +func (s SpoofGuardProfile) GetType__() bindings.BindingType { + return SpoofGuardProfileBindingType() +} + +func (s SpoofGuardProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SpoofGuardProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of SpoofGuard profiles +type SpoofGuardProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // SpoofGuard profile list results + Results []SpoofGuardProfile +} + +func (s SpoofGuardProfileListResult) GetType__() bindings.BindingType { + return SpoofGuardProfileListResultBindingType() +} + +func (s SpoofGuardProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SpoofGuardProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type SslTrustObjectData struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Key algorithm contained in this certificate + KeyAlgo *string + // Password for private key encryption + Passphrase *string + // pem encoded certificate data + PemEncoded *string + // private key data + PrivateKey *string +} + +func (s SslTrustObjectData) GetType__() bindings.BindingType { + return SslTrustObjectDataBindingType() +} + +func (s SslTrustObjectData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SslTrustObjectData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Idfw configuration for enable/disable idfw on standalone hosts. +type StandaloneHostIdfwConfiguration struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If set to true, Idfw is enabled for standalone hosts + IdfwEnabled *bool +} + +func (s StandaloneHostIdfwConfiguration) GetType__() bindings.BindingType { + return StandaloneHostIdfwConfigurationBindingType() +} + +func (s StandaloneHostIdfwConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StandaloneHostIdfwConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Displayed as a single number. It can be used to show the characteristics of entities such as Logical Switches, Firewall Rules, and so on. For example, number of logical switches and their admin states. +type StatItem struct { + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. + DrilldownId *string + // Multi-line text to be shown on tooltip while hovering over the stat. + Tooltip []Tooltip + // If expression for total is specified, it evaluates it. Total can be omitted if not needed to be shown. + Total *string + // Expression for stat to be displayed. + Value *string +} + +func (s StatItem) GetType__() bindings.BindingType { + return StatItemBindingType() +} + +func (s StatItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StatItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Contains Static ARP configuration for Segment. +type StaticARPConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // IP Address format: ip + IpAddress *string + // MAC Address format: mac-address + MacAddress *string +} + +func (s StaticARPConfig) GetType__() bindings.BindingType { + return StaticARPConfigBindingType() +} + +func (s StaticARPConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticARPConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Static filters +type StaticFilter struct { + // display name to be shown in the drop down for static filter. + DisplayName *string + // Value of static filter inside dropdown filter. + Value *string +} + +func (s StaticFilter) GetType__() bindings.BindingType { + return StaticFilterBindingType() +} + +func (s StaticFilter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticFilter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Static Route Bidirectional Forwarding Detection Peer +type StaticRouteBfdPeer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Bfd Profile is not supported for IPv6 networks. + BfdProfilePath *string + // Flag to enable BFD peer. + Enabled *bool + // Only IPv4 addresses are supported. Only a single BFD config per peer address is allowed. + PeerAddress *string + // Represents the array of policy paths of locale services where this BFD peer should get relalized on. The locale service service and this BFD peer must belong to the same router. Default scope is empty. + Scope []string + // Array of Tier0 external interface IP addresses. BFD peering is established from all these source addresses to the neighbor specified in peer_address. Only IPv4 addresses are supported. + SourceAddresses []string +} + +func (s StaticRouteBfdPeer) GetType__() bindings.BindingType { + return StaticRouteBfdPeerBindingType() +} + +func (s StaticRouteBfdPeer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticRouteBfdPeer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of StaticRouteBfdPeer. +type StaticRouteBfdPeerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // StaticRouteBfdPeer list results. + Results []StaticRouteBfdPeer +} + +func (s StaticRouteBfdPeerListResult) GetType__() bindings.BindingType { + return StaticRouteBfdPeerListResultBindingType() +} + +func (s StaticRouteBfdPeerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticRouteBfdPeerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Static routes configuration on Tier-0 or Tier-1. +type StaticRoutes struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // When false or by default northbound routes are configure only on primary site and not on secondary. When true, static route will be pushed to secondary even if its locale operation mode is secondary. + EnabledOnSecondary *bool + // Specify network address in CIDR format. format: address-or-block-or-range + Network *string + // Specify next hop routes for network. + NextHops []RouterNexthop +} + +func (s StaticRoutes) GetType__() bindings.BindingType { + return StaticRoutesBindingType() +} + +func (s StaticRoutes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticRoutes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Static Routes +type StaticRoutesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Static Routes list results + Results []StaticRoutes +} + +func (s StaticRoutesListResult) GetType__() bindings.BindingType { + return StaticRoutesListResultBindingType() +} + +func (s StaticRoutesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticRoutesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents configuration of a statistic for an entity. Example, number of logical switches and their admin states. +type StatsConfiguration struct { + // Displayed at the sections, by default. It labels the entities of sections. If label is not provided, the sections are not labelled. + Label *Label + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Sections + Sections []DonutSection + // Expression that fetches statistic. It can be used to show the characteristics of entities such as Logical Switches, Firewall Rules, and so on. For example, number of logical switches and their admin states. If stat is not provided, then it will not be displayed. + Stat *StatItem + // Possible values are: + // + // * StatsConfiguration#StatsConfiguration_SUB_TYPE_COMPACT + // + // A sub-type of StatsConfiguration. If sub-type is not specified the parent type is rendered. The COMPACT sub_type, conserves the space for the widget. The statistic is placed on the right side on top of the status bar and the title of the widget is placed on the left side on the top of the status bar. The COMPACT style aligns itself horizontally as per the width of the container. If multiple widgets are placed insided the container then the widgets are placed one below the other to conserve the space. + SubType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const StatsConfiguration__TYPE_IDENTIFIER = "StatsConfiguration" +const StatsConfiguration_SUB_TYPE_COMPACT = "COMPACT" + +func (s StatsConfiguration) GetType__() bindings.BindingType { + return StatsConfigurationBindingType() +} + +func (s StatsConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StatsConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Arbitrary key-value pairs that may be attached to an entity +type Tag struct { + // Tag searches may optionally be restricted by scope + Scope *string + // Identifier meaningful to user with maximum length of 256 characters + Tag *string +} + +func (s Tag) GetType__() bindings.BindingType { + return TagBindingType() +} + +func (s Tag) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tag._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tag and resource information on which tag to be applied or removed. +type TagBulkOperation struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // List of resources on which tag needs to be applied + ApplyTo []ResourceInfo + // List of resources from which tag needs to be removed + RemoveFrom []ResourceInfo + // Tag + Tag *Tag +} + +func (s TagBulkOperation) GetType__() bindings.BindingType { + return TagBulkOperationBindingType() +} + +func (s TagBulkOperation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TagBulkOperation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Status of tag bulk operation +type TagBulkOperationStatus struct { + // Tag apply operation status per resource type. + ApplyTo []ResourceTypeTagStatus + // Intent path corresponding to tag operation + Path *string + // Tag remove operation status per resource type + RemoveFrom []ResourceTypeTagStatus + // Possible values are: + // + // * TagBulkOperationStatus#TagBulkOperationStatus_STATUS_SUCCESS + // * TagBulkOperationStatus#TagBulkOperationStatus_STATUS_RUNNING + // * TagBulkOperationStatus#TagBulkOperationStatus_STATUS_ERROR + // * TagBulkOperationStatus#TagBulkOperationStatus_STATUS_PENDING + // + // Overall status + Status *string + // Tag + Tag *Tag +} +const TagBulkOperationStatus_STATUS_SUCCESS = "Success" +const TagBulkOperationStatus_STATUS_RUNNING = "Running" +const TagBulkOperationStatus_STATUS_ERROR = "Error" +const TagBulkOperationStatus_STATUS_PENDING = "Pending" + +func (s TagBulkOperationStatus) GetType__() bindings.BindingType { + return TagBulkOperationStatusBindingType() +} + +func (s TagBulkOperationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TagBulkOperationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Information about arbitrary key-value pairs that may be attached to an entity +type TagInfo struct { + // Tag searches may optionally be restricted by scope + Scope *string + // Identifier meaningful to user with maximum length of 256 characters + Tag *string + // Number of objects with assigned with matching scope and tag values format: int32 + TaggedObjectsCount *int64 +} + +func (s TagInfo) GetType__() bindings.BindingType { + return TagInfoBindingType() +} + +func (s TagInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TagInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of Tags +type TagInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Tag info list results + Results []TagInfo +} + +func (s TagInfoListResult) GetType__() bindings.BindingType { + return TagInfoListResultBindingType() +} + +func (s TagInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TagInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type TcpHeader struct { + // Destination port of tcp header format: int64 + DstPort *int64 + // Source port of tcp header format: int64 + SrcPort *int64 + // TCP flags (9bits) format: int64 + TcpFlags *int64 +} + +func (s TcpHeader) GetType__() bindings.BindingType { + return TcpHeaderBindingType() +} + +func (s TcpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TcpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// TCP MSS Clamping Direction and Value. +type TcpMaximumSegmentSizeClamping struct { + // Possible values are: + // + // * TcpMaximumSegmentSizeClamping#TcpMaximumSegmentSizeClamping_DIRECTION_NONE + // * TcpMaximumSegmentSizeClamping#TcpMaximumSegmentSizeClamping_DIRECTION_INBOUND_CONNECTION + // * TcpMaximumSegmentSizeClamping#TcpMaximumSegmentSizeClamping_DIRECTION_OUTBOUND_CONNECTION + // * TcpMaximumSegmentSizeClamping#TcpMaximumSegmentSizeClamping_DIRECTION_BOTH + // + // Specifies the traffic direction for which to apply MSS Clamping. + Direction *string + // MSS defines the maximum amount of data that a host is willing to accept in a single TCP segment. This field is set in TCP header during connection establishment. To avoid packet fragmentation, you can set this field depending on uplink MTU and VPN overhead. This is an optional field and in case it is left unconfigured, best possible MSS value will be calculated based on effective mtu of uplink interface. Supported MSS range is 216 to 8960. format: int64 + MaxSegmentSize *int64 +} +const TcpMaximumSegmentSizeClamping_DIRECTION_NONE = "NONE" +const TcpMaximumSegmentSizeClamping_DIRECTION_INBOUND_CONNECTION = "INBOUND_CONNECTION" +const TcpMaximumSegmentSizeClamping_DIRECTION_OUTBOUND_CONNECTION = "OUTBOUND_CONNECTION" +const TcpMaximumSegmentSizeClamping_DIRECTION_BOTH = "BOTH" + +func (s TcpMaximumSegmentSizeClamping) GetType__() bindings.BindingType { + return TcpMaximumSegmentSizeClampingBindingType() +} + +func (s TcpMaximumSegmentSizeClamping) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TcpMaximumSegmentSizeClamping._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the PolicyLbRule object. This represents active health monitoring over TCP. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healthchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type TcpPolicyLbMonitorProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_TCPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_UDPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_ICMPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPSPOLICYLBMONITORPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TcpPolicyLbMonitorProfile__TYPE_IDENTIFIER = "TcpPolicyLbMonitorProfile" + +func (s TcpPolicyLbMonitorProfile) GetType__() bindings.BindingType { + return TcpPolicyLbMonitorProfileBindingType() +} + +func (s TcpPolicyLbMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TcpPolicyLbMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Virtual server acts as a facade to an application, receives all client connections over TCP and distributes them among the backend servers. +type TcpPolicyLbVirtualServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_TCPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_UDPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPSPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_CUSTOMPOLICYLBVIRTUALSERVER + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If access log is enabled, all HTTP requests sent to an L7 virtual server are logged to the access log file. Both successful requests (backend server returns 2xx) and unsuccessful requests (backend server returns 4xx or 5xx) are logged to access log, if enabled. + AccessLogEnabled *bool + // Configures the IP address of the PolicyLbVirtualServer where it receives all client connections and distributes them among the backend servers. format: ip + IpAddress *string + // Path to optional object that enables persistence on a virtual server allowing related client connections to be sent to the same backend server. Persistence is disabled by default. + LbPersistenceProfile *string + // Ports contains a list of at least one port or port range such as \"80\", \"1234-1236\". Each port element in the list should be a single port or a single port range. format: port-or-range + Ports []string + // Path to router type object that PolicyLbVirtualServer connects to. The only supported router object is Network. + RouterPath *string + TrafficSource *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TcpPolicyLbVirtualServer__TYPE_IDENTIFIER = "TcpPolicyLbVirtualServer" + +func (s TcpPolicyLbVirtualServer) GetType__() bindings.BindingType { + return TcpPolicyLbVirtualServerBindingType() +} + +func (s TcpPolicyLbVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TcpPolicyLbVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier-0 configuration for external connectivity. +type Tier0 struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Indicates if logging should be enabled for the default whitelisting rule. This filed is deprecated and recommended to change Rule logging filed. Note that this filed is not synchornied with default logging field. + DefaultRuleLogging *bool + // DHCP configuration for Segments connected to Tier-0. DHCP service is configured in relay mode. + DhcpConfigPaths []string + // Disable or enable gateway fiewall. + DisableFirewall *bool + // Possible values are: + // + // * Tier0#Tier0_FAILOVER_MODE_PREEMPTIVE + // * Tier0#Tier0_FAILOVER_MODE_NON_PREEMPTIVE + // + // Determines the behavior when a Tier-0 instance in ACTIVE-STANDBY high-availability mode restarts after a failure. If set to PREEMPTIVE, the preferred node will take over, even if it causes another failure. If set to NON_PREEMPTIVE, then the instance that restarted will remain secondary. This property is not used when the ha_mode property is set to ACTIVE_ACTIVE. Only applicable when edge cluster is configured in Tier0 locale-service. + FailoverMode *string + // Additional config for federation. + FederationConfig *FederationGatewayConfig + // This filed is deprecated and recommended to change Rule action filed. Note that this filed is not synchornied with default rule field. + ForceWhitelisting *bool + // Possible values are: + // + // * Tier0#Tier0_HA_MODE_ACTIVE + // * Tier0#Tier0_HA_MODE_STANDBY + // + // Specify high-availability mode for Tier-0. Default is ACTIVE_ACTIVE. When ha_mode is changed from ACTIVE_ACTIVE to ACTIVE_STANDBY, inter SR iBGP (in BGP) is disabled. Changing ha_mode from ACTIVE_STANDBY to ACTIVE_ACTIVE will enable inter SR iBGP (in BGP) and previously configured preferred edge nodes (in Tier0 locale-service) are removed. + HaMode *string + // Specify subnets that are used to assign addresses to logical links connecting service routers and distributed routers. Only IPv4 addresses are supported. When not specified, subnet 169.254.0.0/24 is assigned by default in ACTIVE_ACTIVE HA mode or 169.254.0.0/28 in ACTIVE_STANDBY mode. format: ip-cidr-block + InternalTransitSubnets []string + // Inter site routing configuration when the gateway is streched. + IntersiteConfig *IntersiteGatewayConfig + // IPv6 NDRA and DAD profiles configuration on Tier0. Either or both NDRA and/or DAD profiles can be configured. + Ipv6ProfilePaths []string + // If you are using EVPN service, then route distinguisher administrator address should be defined if you need auto generation of route distinguisher on your VRF configuration. format: ip + RdAdminField *string + // Specify transit subnets that are used to assign addresses to logical links connecting tier-0 and tier-1s. Both IPv4 and IPv6 addresses are supported. When not specified, subnet 100.64.0.0/16 is configured by default. format: ip-cidr-block + TransitSubnets []string + // VRF config, required for VRF Tier0. + VrfConfig *Tier0VrfConfig +} +const Tier0_FAILOVER_MODE_PREEMPTIVE = "PREEMPTIVE" +const Tier0_FAILOVER_MODE_NON_PREEMPTIVE = "NON_PREEMPTIVE" +const Tier0_HA_MODE_ACTIVE = "ACTIVE_ACTIVE" +const Tier0_HA_MODE_STANDBY = "ACTIVE_STANDBY" + +func (s Tier0) GetType__() bindings.BindingType { + return Tier0BindingType() +} + +func (s Tier0) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Binding of Tier-0 to the enforcement point. +type Tier0DeploymentMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Path of enforcement point on which Tier-0 shall be deployed. + EnforcementPoint *string +} + +func (s Tier0DeploymentMap) GetType__() bindings.BindingType { + return Tier0DeploymentMapBindingType() +} + +func (s Tier0DeploymentMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0DeploymentMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Tier-0 Deployment Map. +type Tier0DeploymentMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Tier-0 Deployment Maps. + Results []Tier0DeploymentMap +} + +func (s Tier0DeploymentMapListResult) GetType__() bindings.BindingType { + return Tier0DeploymentMapListResultBindingType() +} + +func (s Tier0DeploymentMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0DeploymentMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier0 gateway state +type Tier0GatewayState struct { + // String Path of the enforcement point. When not specified, routes from all enforcement-points are returned. + EnforcementPointPath *string + // IPv6 DAD status for interfaces configured on Tier0 + Ipv6Status []IPv6Status + // Detailed realized state information for Tier0 + Tier0State *LogicalRouterState + // Detailed realized status information for Tier0 + Tier0Status *LogicalRouterStatus +} + +func (s Tier0GatewayState) GetType__() bindings.BindingType { + return Tier0GatewayStateBindingType() +} + +func (s Tier0GatewayState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0GatewayState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier0 HA VIP Config +type Tier0HaVipConfig struct { + // Flag to enable this HA VIP config. + Enabled *bool + // Policy paths to Tier0 external interfaces which are to be paired to provide redundancy. Floating IP will be owned by one of these interfaces depending upon which edge node is Active. + ExternalInterfacePaths []string + // Array of IP address subnets which will be used as floating IP addresses. + VipSubnets []InterfaceSubnet +} + +func (s Tier0HaVipConfig) GetType__() bindings.BindingType { + return Tier0HaVipConfigBindingType() +} + +func (s Tier0HaVipConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0HaVipConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier-0 interface configuration for external connectivity. +type Tier0Interface struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Specify IP address and network prefix for interface. + Subnets []InterfaceSubnet + // Vlan id. format: int64 + AccessVlanId *int64 + // Specify association of interface with edge cluster member. This property is deprecated, use edge_path instead. When both properties are specifed, only edge_path property is used. format: int32 + EdgeClusterMemberIndex *int64 + // Policy path to edge node to handle external connectivity. Required when interface type is EXTERNAL. + EdgePath *string + // Configuration IPv6 NDRA profile. Only one NDRA profile can be configured. + Ipv6ProfilePaths []string + // Specify logical switch to which tier-0 interface is connected for external access. This property is deprecated, use segment_path instead. Both properties cannot be used together. + LsId *string + // Maximum transmission unit (MTU) specifies the size of the largest packet that a network protocol can transmit. format: int32 + Mtu *int64 + // Multicast PIM configuration. + Multicast *Tier0InterfacePimConfig + // Specify Segment to which this interface is connected to. Either segment_path or ls_id property is required. + SegmentPath *string + // Possible values are: + // + // * Tier0Interface#Tier0Interface_TYPE_EXTERNAL + // * Tier0Interface#Tier0Interface_TYPE_SERVICE + // * Tier0Interface#Tier0Interface_TYPE_LOOPBACK + // + // Interface type + Type_ *string + // Possible values are: + // + // * Tier0Interface#Tier0Interface_URPF_MODE_NONE + // * Tier0Interface#Tier0Interface_URPF_MODE_STRICT + // + // Unicast Reverse Path Forwarding mode + UrpfMode *string +} +const Tier0Interface_TYPE_EXTERNAL = "EXTERNAL" +const Tier0Interface_TYPE_SERVICE = "SERVICE" +const Tier0Interface_TYPE_LOOPBACK = "LOOPBACK" +const Tier0Interface_URPF_MODE_NONE = "NONE" +const Tier0Interface_URPF_MODE_STRICT = "STRICT" + +func (s Tier0Interface) GetType__() bindings.BindingType { + return Tier0InterfaceBindingType() +} + +func (s Tier0Interface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0Interface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Tier-0 Interfaces +type Tier0InterfaceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Tier-0 Interface list results + Results []Tier0Interface +} + +func (s Tier0InterfaceListResult) GetType__() bindings.BindingType { + return Tier0InterfaceListResultBindingType() +} + +func (s Tier0InterfaceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0InterfaceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Multicast PIM configuration. +type Tier0InterfacePimConfig struct { + // enable/disable PIM configuration. + Enabled *bool +} + +func (s Tier0InterfacePimConfig) GetType__() bindings.BindingType { + return Tier0InterfacePimConfigBindingType() +} + +func (s Tier0InterfacePimConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0InterfacePimConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Tier-0s +type Tier0ListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Tier-0 list results + Results []Tier0 +} + +func (s Tier0ListResult) GetType__() bindings.BindingType { + return Tier0ListResultBindingType() +} + +func (s Tier0ListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0ListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// RouteMap for redistributing routes to BGP and other routing protocols +type Tier0RouteMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Ordered list of route map entries. + Entries []RouteMapEntry +} + +func (s Tier0RouteMap) GetType__() bindings.BindingType { + return Tier0RouteMapBindingType() +} + +func (s Tier0RouteMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0RouteMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of RouteMaps +type Tier0RouteMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Tier0RouteMap results + Results []Tier0RouteMap +} + +func (s Tier0RouteMapListResult) GetType__() bindings.BindingType { + return Tier0RouteMapListResultBindingType() +} + +func (s Tier0RouteMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0RouteMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Route Redistribution config +type Tier0RouteRedistributionConfig struct { + // Flag to enable route redistribution for BGP. + BgpEnabled *bool + // List of redistribution rules. + RedistributionRules []Tier0RouteRedistributionRule +} + +func (s Tier0RouteRedistributionConfig) GetType__() bindings.BindingType { + return Tier0RouteRedistributionConfigBindingType() +} + +func (s Tier0RouteRedistributionConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0RouteRedistributionConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Single route redistribution rule +type Tier0RouteRedistributionRule struct { + // Rule name + Name *string + // Route map to be associated with the redistribution rule + RouteMapPath *string + // Possible values are: + // + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_STATIC + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_CONNECTED + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_EXTERNAL_INTERFACE + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_SEGMENT + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_ROUTER_LINK + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_SERVICE_INTERFACE + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_LOOPBACK_INTERFACE + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_DNS_FORWARDER_IP + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_IPSEC_LOCAL_IP + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_NAT + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_EVPN_TEP_IP + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_NAT + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_STATIC + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_LB_VIP + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_LB_SNAT + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_DNS_FORWARDER_IP + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_CONNECTED + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_SERVICE_INTERFACE + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_SEGMENT + // * Tier0RouteRedistributionRule#Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_IPSEC_LOCAL_ENDPOINT + // + // List of redistribution types + RouteRedistributionTypes []string +} +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_STATIC = "TIER0_STATIC" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_CONNECTED = "TIER0_CONNECTED" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_EXTERNAL_INTERFACE = "TIER0_EXTERNAL_INTERFACE" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_SEGMENT = "TIER0_SEGMENT" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_ROUTER_LINK = "TIER0_ROUTER_LINK" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_SERVICE_INTERFACE = "TIER0_SERVICE_INTERFACE" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_LOOPBACK_INTERFACE = "TIER0_LOOPBACK_INTERFACE" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_DNS_FORWARDER_IP = "TIER0_DNS_FORWARDER_IP" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_IPSEC_LOCAL_IP = "TIER0_IPSEC_LOCAL_IP" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_NAT = "TIER0_NAT" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER0_EVPN_TEP_IP = "TIER0_EVPN_TEP_IP" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_NAT = "TIER1_NAT" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_STATIC = "TIER1_STATIC" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_LB_VIP = "TIER1_LB_VIP" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_LB_SNAT = "TIER1_LB_SNAT" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_DNS_FORWARDER_IP = "TIER1_DNS_FORWARDER_IP" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_CONNECTED = "TIER1_CONNECTED" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_SERVICE_INTERFACE = "TIER1_SERVICE_INTERFACE" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_SEGMENT = "TIER1_SEGMENT" +const Tier0RouteRedistributionRule_ROUTE_REDISTRIBUTION_TYPES_TIER1_IPSEC_LOCAL_ENDPOINT = "TIER1_IPSEC_LOCAL_ENDPOINT" + +func (s Tier0RouteRedistributionRule) GetType__() bindings.BindingType { + return Tier0RouteRedistributionRuleBindingType() +} + +func (s Tier0RouteRedistributionRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0RouteRedistributionRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier-0 vrf configuration. +type Tier0VrfConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // L3 VNI associated with the VRF for overlay traffic. VNI must be unique and belong to configured VNI pool. format: int32 + EvpnTransitVni *int64 + // + RouteDistinguisher *string + // Route targets. + RouteTargets []VrfRouteTargets + // Default tier0 path. Cannot be modified after realization. + Tier0Path *string +} + +func (s Tier0VrfConfig) GetType__() bindings.BindingType { + return Tier0VrfConfigBindingType() +} + +func (s Tier0VrfConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier0VrfConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier-1 instance configuration. +type Tier1 struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Indicates if logging should be enabled for the default whitelisting rule. This filed is deprecated and recommended to change Rule logging filed. Note that this filed is not synchornied with default logging field. + DefaultRuleLogging *bool + // DHCP configuration for Segments connected to Tier-1. DHCP service is enabled in relay mode. + DhcpConfigPaths []string + // Disable or enable gateway fiewall. + DisableFirewall *bool + // Flag to enable standby service router relocation. Standby relocation is not enabled until edge cluster is configured for Tier1. + EnableStandbyRelocation *bool + // Possible values are: + // + // * Tier1#Tier1_FAILOVER_MODE_PREEMPTIVE + // * Tier1#Tier1_FAILOVER_MODE_NON_PREEMPTIVE + // + // Determines the behavior when a Tier-1 instance restarts after a failure. If set to PREEMPTIVE, the preferred node will take over, even if it causes another failure. If set to NON_PREEMPTIVE, then the instance that restarted will remain secondary. Only applicable when edge cluster is configured in Tier1 locale-service. + FailoverMode *string + // Additional config for federation. + FederationConfig *FederationGatewayConfig + // This filed is deprecated and recommended to change Rule action filed. Note that this filed is not synchornied with default rule field. + ForceWhitelisting *bool + // Inter site routing configuration when the gateway is streched. + IntersiteConfig *IntersiteGatewayConfig + // Configuration IPv6 NDRA and DAD profiles. Either or both NDRA and/or DAD profiles can be configured. + Ipv6ProfilePaths []string + // Possible values are: + // + // * Tier1#Tier1_POOL_ALLOCATION_ROUTING + // * Tier1#Tier1_POOL_ALLOCATION_LB_SMALL + // * Tier1#Tier1_POOL_ALLOCATION_LB_MEDIUM + // * Tier1#Tier1_POOL_ALLOCATION_LB_LARGE + // * Tier1#Tier1_POOL_ALLOCATION_LB_XLARGE + // + // Supports edge node allocation at different sizes for routing and load balancer service to meet performance and scalability requirements. ROUTING: Allocate edge node to provide routing services. LB_SMALL, LB_MEDIUM, LB_LARGE, LB_XLARGE: Specify size of load balancer service that will be configured on TIER1 gateway. + PoolAllocation *string + // QoS Profile configuration for Tier1 router link connected to Tier0 gateway. + QosProfile *GatewayQosProfileConfig + // Route advertisement rules and filtering + RouteAdvertisementRules []RouteAdvertisementRule + // Possible values are: + // + // * Tier1#Tier1_ROUTE_ADVERTISEMENT_TYPES_STATIC_ROUTES + // * Tier1#Tier1_ROUTE_ADVERTISEMENT_TYPES_CONNECTED + // * Tier1#Tier1_ROUTE_ADVERTISEMENT_TYPES_NAT + // * Tier1#Tier1_ROUTE_ADVERTISEMENT_TYPES_LB_VIP + // * Tier1#Tier1_ROUTE_ADVERTISEMENT_TYPES_LB_SNAT + // * Tier1#Tier1_ROUTE_ADVERTISEMENT_TYPES_DNS_FORWARDER_IP + // * Tier1#Tier1_ROUTE_ADVERTISEMENT_TYPES_IPSEC_LOCAL_ENDPOINT + // + // Enable different types of route advertisements. When not specified, routes to IPSec VPN local-endpoint subnets (TIER1_IPSEC_LOCAL_ENDPOINT) are automatically advertised. + RouteAdvertisementTypes []string + // Specify Tier-1 connectivity to Tier-0 instance. + Tier0Path *string + // Possible values are: + // + // * Tier1#Tier1_TYPE_ROUTED + // * Tier1#Tier1_TYPE_ISOLATED + // * Tier1#Tier1_TYPE_NATTED + // + // Tier1 connectivity type for reference. Property value is not validated with Tier1 configuration. ROUTED: Tier1 is connected to Tier0 gateway and routing is enabled. ISOLATED: Tier1 is not connected to any Tier0 gateway. NATTED: Tier1 is in ROUTED type with NAT configured locally. + Type_ *string +} +const Tier1_FAILOVER_MODE_PREEMPTIVE = "PREEMPTIVE" +const Tier1_FAILOVER_MODE_NON_PREEMPTIVE = "NON_PREEMPTIVE" +const Tier1_POOL_ALLOCATION_ROUTING = "ROUTING" +const Tier1_POOL_ALLOCATION_LB_SMALL = "LB_SMALL" +const Tier1_POOL_ALLOCATION_LB_MEDIUM = "LB_MEDIUM" +const Tier1_POOL_ALLOCATION_LB_LARGE = "LB_LARGE" +const Tier1_POOL_ALLOCATION_LB_XLARGE = "LB_XLARGE" +const Tier1_ROUTE_ADVERTISEMENT_TYPES_STATIC_ROUTES = "TIER1_STATIC_ROUTES" +const Tier1_ROUTE_ADVERTISEMENT_TYPES_CONNECTED = "TIER1_CONNECTED" +const Tier1_ROUTE_ADVERTISEMENT_TYPES_NAT = "TIER1_NAT" +const Tier1_ROUTE_ADVERTISEMENT_TYPES_LB_VIP = "TIER1_LB_VIP" +const Tier1_ROUTE_ADVERTISEMENT_TYPES_LB_SNAT = "TIER1_LB_SNAT" +const Tier1_ROUTE_ADVERTISEMENT_TYPES_DNS_FORWARDER_IP = "TIER1_DNS_FORWARDER_IP" +const Tier1_ROUTE_ADVERTISEMENT_TYPES_IPSEC_LOCAL_ENDPOINT = "TIER1_IPSEC_LOCAL_ENDPOINT" +const Tier1_TYPE_ROUTED = "ROUTED" +const Tier1_TYPE_ISOLATED = "ISOLATED" +const Tier1_TYPE_NATTED = "NATTED" + +func (s Tier1) GetType__() bindings.BindingType { + return Tier1BindingType() +} + +func (s Tier1) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier1._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Binding of Tier-1 to the enforcement point. +type Tier1DeploymentMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Path of enforcement point on which Tier-1 shall be deployed. + EnforcementPoint *string +} + +func (s Tier1DeploymentMap) GetType__() bindings.BindingType { + return Tier1DeploymentMapBindingType() +} + +func (s Tier1DeploymentMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier1DeploymentMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier1 gateway state +type Tier1GatewayState struct { + // String Path of the enforcement point. When not specified, routes from all enforcement-points are returned. + EnforcementPointPath *string + // IPv6 DAD status for interfaces configured on Tier1 + Ipv6Status []IPv6Status + // Detailed realized state information for Tier1 + Tier1State *LogicalRouterState + // Detailed realized status information for Tier1 + Tier1Status *LogicalRouterStatus +} + +func (s Tier1GatewayState) GetType__() bindings.BindingType { + return Tier1GatewayStateBindingType() +} + +func (s Tier1GatewayState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier1GatewayState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tier-1 interface configuration for attaching services. +type Tier1Interface struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Specify IP address and network prefix for interface. + Subnets []InterfaceSubnet + // Configrue IPv6 NDRA profile. Only one NDRA profile can be configured. + Ipv6ProfilePaths []string + // Maximum transmission unit (MTU) specifies the size of the largest packet that a network protocol can transmit. format: int32 + Mtu *int64 + // Policy path of Segment to which interface is connected to. + SegmentPath *string + // Possible values are: + // + // * Tier1Interface#Tier1Interface_URPF_MODE_NONE + // * Tier1Interface#Tier1Interface_URPF_MODE_STRICT + // + // Unicast Reverse Path Forwarding mode + UrpfMode *string +} +const Tier1Interface_URPF_MODE_NONE = "NONE" +const Tier1Interface_URPF_MODE_STRICT = "STRICT" + +func (s Tier1Interface) GetType__() bindings.BindingType { + return Tier1InterfaceBindingType() +} + +func (s Tier1Interface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier1Interface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Tier-1 Interfaces +type Tier1InterfaceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Tier-1 Interface list results + Results []Tier1Interface +} + +func (s Tier1InterfaceListResult) GetType__() bindings.BindingType { + return Tier1InterfaceListResultBindingType() +} + +func (s Tier1InterfaceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier1InterfaceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged collection of Tier-1 instances +type Tier1ListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Tier-1 list results + Results []Tier1 +} + +func (s Tier1ListResult) GetType__() bindings.BindingType { + return Tier1ListResultBindingType() +} + +func (s Tier1ListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tier1ListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type TlsCertificate struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // list of X509Certificates. + Details []X509Certificate + // pem encoded certificate data. + PemEncoded *string +} + +func (s TlsCertificate) GetType__() bindings.BindingType { + return TlsCertificateBindingType() +} + +func (s TlsCertificate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TlsCertificate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Certificate queries result +type TlsCertificateList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // TlsCertificate list. + Results []TlsCertificate +} + +func (s TlsCertificateList) GetType__() bindings.BindingType { + return TlsCertificateListBindingType() +} + +func (s TlsCertificateList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TlsCertificateList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type TlsCrl struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Details of the X509Crl object. + Details *X509Crl + // Pem encoded crl data. + PemEncoded *string +} + +func (s TlsCrl) GetType__() bindings.BindingType { + return TlsCrlBindingType() +} + +func (s TlsCrl) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TlsCrl._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Paged Collection of TlsCrl +type TlsCrlListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // TlsCrl list results + Results []TlsCrl +} + +func (s TlsCrlListResult) GetType__() bindings.BindingType { + return TlsCrlListResultBindingType() +} + +func (s TlsCrlListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TlsCrlListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Returns the certificate and thumbprint of a remote TLS listener, if the listener is running and accepting requests. If the certificate cannot be retrieved, the result property describes the problem. +type TlsListenerCertificate struct { + // The certificate of the TLS listener. + Certificate *X509Certificate + // Possible values are: + // + // * TlsListenerCertificate#TlsListenerCertificate_RESULT_SUCCESS + // * TlsListenerCertificate#TlsListenerCertificate_RESULT_CONNECTION_TIMEOUT + // * TlsListenerCertificate#TlsListenerCertificate_RESULT_NO_ROUTE_TO_HOST + // * TlsListenerCertificate#TlsListenerCertificate_RESULT_CONNECTION_REFUSED + // + // Result of get certificate operation. + Result *string + // The SHA-256 thumbprint of the TLS listener. + Thumbprint *string +} +const TlsListenerCertificate_RESULT_SUCCESS = "SUCCESS" +const TlsListenerCertificate_RESULT_CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT" +const TlsListenerCertificate_RESULT_NO_ROUTE_TO_HOST = "NO_ROUTE_TO_HOST" +const TlsListenerCertificate_RESULT_CONNECTION_REFUSED = "CONNECTION_REFUSED" + +func (s TlsListenerCertificate) GetType__() bindings.BindingType { + return TlsListenerCertificateBindingType() +} + +func (s TlsListenerCertificate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TlsListenerCertificate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type TlsTrustData struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Key algorithm contained in this certificate. + KeyAlgo *string + // Password for private key encryption. + Passphrase *string + // pem encoded certificate data. + PemEncoded *string + // private key data + PrivateKey *string +} + +func (s TlsTrustData) GetType__() bindings.BindingType { + return TlsTrustDataBindingType() +} + +func (s TlsTrustData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TlsTrustData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Tooltip to be shown while hovering over the dashboard UI element. +type Tooltip struct { + // If the condition is met then the tooltip will be applied. If no condition is provided, then the tooltip will be applied unconditionally. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // If true, displays tooltip text in bold + Heading *bool + // Text to be shown on tooltip while hovering over UI element. The text would be wrapped if it exceeds 80 chars. + Text *string +} + +func (s Tooltip) GetType__() bindings.BindingType { + return TooltipBindingType() +} + +func (s Tooltip) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tooltip._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Traceflow configuration +type TraceflowConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // This field indicates if intent is transient and will be cleaned up by the system if set to true + IsTransient *bool + // Configuration of packet data + Packet *data.StructValue + // Segment Port Path or UUID + SegmentPortPath *string + // Maximum time in seconds the management plane will wait for observation result to be sent by opsAgent. format: int64 + Timeout *int64 +} + +func (s TraceflowConfig) GetType__() bindings.BindingType { + return TraceflowConfigBindingType() +} + +func (s TraceflowConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Enables traffic limit for incoming/outgoing broadcast and multicast packets. Use 0 to disable rate limiting for a specific traffic type +type TrafficRateLimits struct { + // Incoming broadcast traffic limit in packets per second format: int32 + RxBroadcast *int64 + // Incoming multicast traffic limit in packets per second format: int32 + RxMulticast *int64 + // Outgoing broadcast traffic limit in packets per second format: int32 + TxBroadcast *int64 + // Outgoing multicast traffic limit in packets per second format: int32 + TxMulticast *int64 +} + +func (s TrafficRateLimits) GetType__() bindings.BindingType { + return TrafficRateLimitsBindingType() +} + +func (s TrafficRateLimits) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TrafficRateLimits._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Detailed Realized Status of an Intent on a span of Transport Nodes. +type TransportNodeSpanEnforcedStatus struct { + // List of Detailed Realized Status per Transport Node. + EnforcedStatusPerTransportNode []EnforcedStatusPerTransportNode + // Possible values are: + // + // * EnforcedStatusPerScopeNsxt#EnforcedStatusPerScopeNsxt_RESOURCE_TYPE_TRANSPORTNODESPANENFORCEDSTATUS + // + // Enforced Realized Status Per Scope Resource Type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TransportNodeSpanEnforcedStatus__TYPE_IDENTIFIER = "TransportNodeSpanEnforcedStatus" + +func (s TransportNodeSpanEnforcedStatus) GetType__() bindings.BindingType { + return TransportNodeSpanEnforcedStatusBindingType() +} + +func (s TransportNodeSpanEnforcedStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeSpanEnforcedStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type TransportProtocolHeader struct { + // DHCP header + DhcpHeader *DhcpHeader + // DHCP v6 header + Dhcpv6Header *Dhcpv6Header + // DNS header + DnsHeader *DnsHeader + // ICMP echo request header + IcmpEchoRequestHeader *IcmpEchoRequestHeader + // Neighbor discovery protocol header + NdpHeader *NdpHeader + // TCP header + TcpHeader *TcpHeader + // UDP header + UdpHeader *UdpHeader +} + +func (s TransportProtocolHeader) GetType__() bindings.BindingType { + return TransportProtocolHeaderBindingType() +} + +func (s TransportProtocolHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportProtocolHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type TunnelInterfaceIPSubnet struct { + // IPv4 Addresses format: ipv4 + IpAddresses []string + // Subnet Prefix Length format: int64 + PrefixLength *int64 +} + +func (s TunnelInterfaceIPSubnet) GetType__() bindings.BindingType { + return TunnelInterfaceIPSubnetBindingType() +} + +func (s TunnelInterfaceIPSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TunnelInterfaceIPSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type TunnelSubnet struct { + // Subnet ip addresses format: ipv4 + IpAddresses []string + // Subnet Prefix Length format: int64 + PrefixLength *int64 +} + +func (s TunnelSubnet) GetType__() bindings.BindingType { + return TunnelSubnetBindingType() +} + +func (s TunnelSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TunnelSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type UdpHeader struct { + // Destination port of udp header format: int64 + DstPort *int64 + // Source port of udp header format: int64 + SrcPort *int64 +} + +func (s UdpHeader) GetType__() bindings.BindingType { + return UdpHeaderBindingType() +} + +func (s UdpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UdpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the Group through the PolicyLbRule object. This represents active health monitoring over UDP. Active healthchecks are initiated periodically, at a configurable interval, to each member of the Group. Only if a healthcheck fails consecutively for a specified number of times (fall_count) to a member will the member status be marked DOWN. Once a member is DOWN, a specified number of consecutive successful healthchecks (rise_count) will bring the member back to UP state. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. +type UdpPolicyLbMonitorProfile struct { + // Expected data, can be anywhere in the response and it has to be a string, regular expressions are not supported. UDP healthcheck is considered failed if there is no server response within the timeout period. + Receive *string + // The data to be sent to the monitored server. + Send *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_TCPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_UDPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_ICMPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPPOLICYLBMONITORPROFILE + // * PolicyLbMonitorProfile#PolicyLbMonitorProfile_RESOURCE_TYPE_HTTPSPOLICYLBMONITORPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Only if a healthcheck fails consecutively for a specified number of times, given with fall_count, to a member will the member status be marked DOWN. format: int64 + FallCount *int64 + // Active healthchecks are initiated periodically, at a configurable interval (in seconds), to each member of the Group. format: int64 + Interval *int64 + // Typically, monitors perform healthchecks to Group members using the member IP address and pool_port. However, in some cases, customers prefer to run healthchecks against a different port than the pool member port which handles actual application traffic. In such cases, the port to run healthchecks against can be specified in the monitor_port value. format: int32 + MonitorPort *int64 + // Once a member is DOWN, a specified number of consecutive successful healthchecks specified by rise_count will bring the member back to UP state. format: int64 + RiseCount *int64 + // Timeout specified in seconds. After a healthcheck is initiated, if it does not complete within a certain period, then also the healthcheck is considered to be unsuccessful. Completing a healthcheck within timeout means establishing a connection (TCP or SSL), if applicable, sending the request and receiving the response, all within the configured timeout. format: int64 + Timeout *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const UdpPolicyLbMonitorProfile__TYPE_IDENTIFIER = "UdpPolicyLbMonitorProfile" + +func (s UdpPolicyLbMonitorProfile) GetType__() bindings.BindingType { + return UdpPolicyLbMonitorProfileBindingType() +} + +func (s UdpPolicyLbMonitorProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UdpPolicyLbMonitorProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Virtual server acts as a facade to an application, receives all client connections over UDP and distributes them among the backend servers. +type UdpPolicyLbVirtualServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_TCPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_UDPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_HTTPSPOLICYLBVIRTUALSERVER + // * PolicyLbVirtualServer#PolicyLbVirtualServer_RESOURCE_TYPE_CUSTOMPOLICYLBVIRTUALSERVER + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // If access log is enabled, all HTTP requests sent to an L7 virtual server are logged to the access log file. Both successful requests (backend server returns 2xx) and unsuccessful requests (backend server returns 4xx or 5xx) are logged to access log, if enabled. + AccessLogEnabled *bool + // Configures the IP address of the PolicyLbVirtualServer where it receives all client connections and distributes them among the backend servers. format: ip + IpAddress *string + // Path to optional object that enables persistence on a virtual server allowing related client connections to be sent to the same backend server. Persistence is disabled by default. + LbPersistenceProfile *string + // Ports contains a list of at least one port or port range such as \"80\", \"1234-1236\". Each port element in the list should be a single port or a single port range. format: port-or-range + Ports []string + // Path to router type object that PolicyLbVirtualServer connects to. The only supported router object is Network. + RouterPath *string + TrafficSource *string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const UdpPolicyLbVirtualServer__TYPE_IDENTIFIER = "UdpPolicyLbVirtualServer" + +func (s UdpPolicyLbVirtualServer) GetType__() bindings.BindingType { + return UdpPolicyLbVirtualServerBindingType() +} + +func (s UdpPolicyLbVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UdpPolicyLbVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Unary Operation. +type UnaryOperation struct { + // Represents an argument of the operation pointing to a specific field value. + Operand *ResourceFieldPointer + // Possible values are: + // + // * UnaryOperation#UnaryOperation_OPERATOR_APPEND + // * UnaryOperation#UnaryOperation_OPERATOR_SUBTRACT + // + // Logical Operator describing the operation to apply to the operand. + Operator *string +} +const UnaryOperation_OPERATOR_APPEND = "APPEND" +const UnaryOperation_OPERATOR_SUBTRACT = "SUBTRACT" + +func (s UnaryOperation) GetType__() bindings.BindingType { + return UnaryOperationBindingType() +} + +func (s UnaryOperation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UnaryOperation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Operation based Injection Value. +type UnaryOperationBasedInjectionValue struct { + // Resource field pointer representing the initial value for the injection value. If an operation is supplied, the value is handed to the operation function to produce a final result. + InitialValue *ResourceFieldPointer + // Represents an optional operation to be done on the initial value. + Operation *UnaryOperation + // Possible values are: + // + // * InjectionValue#InjectionValue_RESOURCE_TYPE_UNARYOPERATIONBASEDINJECTIONVALUE + // + // Injection Value resource type. + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const UnaryOperationBasedInjectionValue__TYPE_IDENTIFIER = "UnaryOperationBasedInjectionValue" + +func (s UnaryOperationBasedInjectionValue) GetType__() bindings.BindingType { + return UnaryOperationBasedInjectionValueBindingType() +} + +func (s UnaryOperationBasedInjectionValue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UnaryOperationBasedInjectionValue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Short name or alias of a url. It is used to represent the url. +type UrlAlias struct { + // + Alias *string + // Search query to be applied, if any. If query string is not provided, it will be ignored. + Query *string + // Url to fetch data from. + Url *string +} + +func (s UrlAlias) GetType__() bindings.BindingType { + return UrlAliasBindingType() +} + +func (s UrlAlias) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UrlAlias._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Authenticated User Info +type UserInfo struct { + // Permissions + Roles []NsxRole + // User Name + UserName *string +} + +func (s UserInfo) GetType__() bindings.BindingType { + return UserInfoBindingType() +} + +func (s UserInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UserInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents the leaf level value constraint to constrain specified attribute value to the set of values to be allowed/not-allowed. Example - sourceGroups allowed to have only with list of groups. { \"operator\":\"INCLUDES\", \"values\":[\"/infra/services/HTTP\", \"/infra/services/HTTPS\"] } +type ValueConstraintExpression struct { + // Possible values are: + // + // * ValueConstraintExpression#ValueConstraintExpression_OPERATOR_INCLUDES + // * ValueConstraintExpression#ValueConstraintExpression_OPERATOR_EXCLUDES + // * ValueConstraintExpression#ValueConstraintExpression_OPERATOR_EQUALS + // + // Operation to check for value list for resource attribute of constraint. + Operator *string + // List of values. + Values []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_VALUECONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_RELATEDATTRIBUTECONDITIONALEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_ENTITYINSTANCECOUNTCONSTRAINTEXPRESSION + // * ConstraintExpression#ConstraintExpression_RESOURCE_TYPE_FIELDSANITYCONSTRAINTEXPRESSION + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ValueConstraintExpression__TYPE_IDENTIFIER = "ValueConstraintExpression" +const ValueConstraintExpression_OPERATOR_INCLUDES = "INCLUDES" +const ValueConstraintExpression_OPERATOR_EXCLUDES = "EXCLUDES" +const ValueConstraintExpression_OPERATOR_EQUALS = "EQUALS" + +func (s ValueConstraintExpression) GetType__() bindings.BindingType { + return ValueConstraintExpressionBindingType() +} + +func (s ValueConstraintExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ValueConstraintExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type VersionList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of component versions + AcceptableVersions []string +} + +func (s VersionList) GetType__() bindings.BindingType { + return VersionListBindingType() +} + +func (s VersionList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VersionList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Vidm Info +type VidmInfo struct { + // User's Full Name Or User Group's Display Name + DisplayName *string + // Username Or Groupname + Name *string + // Possible values are: + // + // * VidmInfo#VidmInfo_TYPE_USER + // * VidmInfo#VidmInfo_TYPE_GROUP + // + // Type + Type_ *string +} +const VidmInfo_TYPE_USER = "remote_user" +const VidmInfo_TYPE_GROUP = "remote_group" + +func (s VidmInfo) GetType__() bindings.BindingType { + return VidmInfoBindingType() +} + +func (s VidmInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VidmInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type VidmInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []VidmInfo +} + +func (s VidmInfoListResult) GetType__() bindings.BindingType { + return VidmInfoListResultBindingType() +} + +func (s VidmInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VidmInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Describes the configuration of a view to be displayed on the dashboard. +type View struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Comma separated list of roles to which the shared view is not visible. Allows user to prevent the visibility of a shared view to the specified roles. User defined roles can also be specified in the list. The roles can be obtained via GET /api/v1/aaa/roles. Please visit API documentation for details about roles. If include_roles is specified then exclude_roles cannot be specified. + ExcludeRoles *string + // Comma separated list of roles to which the shared view is visible. Allows user to specify the visibility of a shared view to the specified roles. User defined roles can also be specified in the list. The roles can be obtained via GET /api/v1/aaa/roles. Please visit API documentation for details about roles. + IncludeRoles *string + // Defaults to false. Set to true to publish the view to other users. The widgets of a shared view are visible to other users. + Shared *bool + // Determines placement of view relative to other views. The lower the weight, the higher it is in the placement order. format: int32 + Weight *int64 + // Array of widgets that are part of the view. + Widgets []WidgetItem +} + +func (s View) GetType__() bindings.BindingType { + return ViewBindingType() +} + +func (s View) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for View._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a list of views. +type ViewList struct { + // Array of views + Views []View +} + +func (s ViewList) GetType__() bindings.BindingType { + return ViewListBindingType() +} + +func (s ViewList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ViewList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A VirtualEndpoint represents an IP (or nexthop) which is outside SDDC. It represents a redirection target for RedirectionPolicy. +type VirtualEndpoint struct { + // One VirtualEndpoint will be created per service name. + ServiceNames []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseEndpoint#BaseEndpoint_RESOURCE_TYPE_VIRTUALENDPOINT + // * BaseEndpoint#BaseEndpoint_RESOURCE_TYPE_SERVICEINSTANCEENDPOINT + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // IPs where either inbound or outbound traffic is to be redirected. + TargetIps []IPInfo +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualEndpoint__TYPE_IDENTIFIER = "VirtualEndpoint" + +func (s VirtualEndpoint) GetType__() bindings.BindingType { + return VirtualEndpointBindingType() +} + +func (s VirtualEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type VirtualMachine struct { + // List of external compute ids of the virtual machine in the format 'id-type-key:value' , list of external compute ids ['uuid:xxxx-xxxx-xxxx-xxxx', 'moIdOnHost:moref-11', 'instanceUuid:xxxx-xxxx-xxxx-xxxx'] + ComputeIds []string + // Current external id of this virtual machine in the system. + ExternalId *string + // Guest virtual machine details include OS name, computer name of guest VM. Currently this is supported for guests on ESXi that have VMware Tools installed. + GuestInfo *GuestInfo + // Id of the host in which this virtual machine exists. + HostId *string + // Id of the vm unique within the host. + LocalIdOnHost *string + // Possible values are: + // + // * VirtualMachine#VirtualMachine_POWER_STATE_VM_RUNNING + // * VirtualMachine#VirtualMachine_POWER_STATE_VM_STOPPED + // * VirtualMachine#VirtualMachine_POWER_STATE_VM_SUSPENDED + // * VirtualMachine#VirtualMachine_POWER_STATE_UNKNOWN + // + // Current power state of this virtual machine in the system. + PowerState *string + // Reference of the Host or Public Cloud Gateway that reported the VM + Source *ResourceReference + // Possible values are: + // + // * VirtualMachine#VirtualMachine_TYPE_EDGE + // * VirtualMachine#VirtualMachine_TYPE_SERVICE + // * VirtualMachine#VirtualMachine_TYPE_REGULAR + // + // Virtual Machine type; Edge, Service VM or other. + Type_ *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualMachine__TYPE_IDENTIFIER = "VirtualMachine" +const VirtualMachine_POWER_STATE_VM_RUNNING = "VM_RUNNING" +const VirtualMachine_POWER_STATE_VM_STOPPED = "VM_STOPPED" +const VirtualMachine_POWER_STATE_VM_SUSPENDED = "VM_SUSPENDED" +const VirtualMachine_POWER_STATE_UNKNOWN = "UNKNOWN" +const VirtualMachine_TYPE_EDGE = "EDGE" +const VirtualMachine_TYPE_SERVICE = "SERVICE" +const VirtualMachine_TYPE_REGULAR = "REGULAR" + +func (s VirtualMachine) GetType__() bindings.BindingType { + return VirtualMachineBindingType() +} + +func (s VirtualMachine) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualMachine._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type VirtualNetworkInterface struct { + // Device key of the virtual network interface. + DeviceKey *string + // Device name of the virtual network interface. + DeviceName *string + // External Id of the virtual network inferface. + ExternalId *string + // Id of the host on which the vm exists. + HostId *string + // IP Addresses of the the virtual network interface, from various sources. + IpAddressInfo []IpAddressInfo + // LPort Attachment Id of the virtual network interface. + LportAttachmentId *string + // MAC address of the virtual network interface. + MacAddress *string + // Id of the vm to which this virtual network interface belongs. + OwnerVmId *string + // Possible values are: + // + // * VirtualNetworkInterface#VirtualNetworkInterface_OWNER_VM_TYPE_EDGE + // * VirtualNetworkInterface#VirtualNetworkInterface_OWNER_VM_TYPE_SERVICE + // * VirtualNetworkInterface#VirtualNetworkInterface_OWNER_VM_TYPE_REGULAR + // + // Owner virtual machine type; Edge, Service VM or other. + OwnerVmType *string + // Id of the vm unique within the host. + VmLocalIdOnHost *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualNetworkInterface__TYPE_IDENTIFIER = "VirtualNetworkInterface" +const VirtualNetworkInterface_OWNER_VM_TYPE_EDGE = "EDGE" +const VirtualNetworkInterface_OWNER_VM_TYPE_SERVICE = "SERVICE" +const VirtualNetworkInterface_OWNER_VM_TYPE_REGULAR = "REGULAR" + +func (s VirtualNetworkInterface) GetType__() bindings.BindingType { + return VirtualNetworkInterfaceBindingType() +} + +func (s VirtualNetworkInterface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualNetworkInterface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type VirtualNetworkInterfaceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // VirtualNetworkInterface list results + Results []VirtualNetworkInterface +} + +func (s VirtualNetworkInterfaceListResult) GetType__() bindings.BindingType { + return VirtualNetworkInterfaceListResultBindingType() +} + +func (s VirtualNetworkInterfaceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualNetworkInterfaceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Virtual portgroup on a virtual switch +type VirtualPortgroup struct { + // Id of the portgroup, eg. a mo-ref from VC. + CmLocalId *string + // External id of the virtual portgroup + ExternalId *string + // Portgroup type like DistributedVirtualPortgroup + OriginType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualPortgroup__TYPE_IDENTIFIER = "VirtualPortgroup" + +func (s VirtualPortgroup) GetType__() bindings.BindingType { + return VirtualPortgroupBindingType() +} + +func (s VirtualPortgroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualPortgroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Virtual switch on a compute manager +type VirtualSwitch struct { + // ID of the virtual switch in compute manager + CmLocalId *string + // External id of the virtual switch + ExternalId *string + // ID of the compute manager where this virtual switch is discovered. + OriginId *string + // Switch type like VmwareDistributedVirtualSwitch + OriginType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualSwitch__TYPE_IDENTIFIER = "VirtualSwitch" + +func (s VirtualSwitch) GetType__() bindings.BindingType { + return VirtualSwitchBindingType() +} + +func (s VirtualSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type VmToolsInfo struct { + // Current external id of this virtual machine in the system. + ExternalId *string + // Version of file agent on the VM of a third party partner solution. + FileAgentVersion *string + // Id of the VM which is assigned locally by the host. It is the VM-moref on ESXi hosts, in other environments it is VM UUID. + HostLocalId *string + // Version of network agent on the VM of a third party partner solution. + NetworkAgentVersion *string + // Reference of the Host or Public Cloud Gateway that reported the VM. + Source *ResourceReference + // Version of VMTools installed on the VM. + ToolsVersion *string + // Possible values are: + // + // * VmToolsInfo#VmToolsInfo_VM_TYPE_EDGE + // * VmToolsInfo#VmToolsInfo_VM_TYPE_SERVICE + // * VmToolsInfo#VmToolsInfo_VM_TYPE_REGULAR + // + // Type of VM - Edge, Service or other. + VmType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VmToolsInfo__TYPE_IDENTIFIER = "VmToolsInfo" +const VmToolsInfo_VM_TYPE_EDGE = "EDGE" +const VmToolsInfo_VM_TYPE_SERVICE = "SERVICE" +const VmToolsInfo_VM_TYPE_REGULAR = "REGULAR" + +func (s VmToolsInfo) GetType__() bindings.BindingType { + return VmToolsInfoBindingType() +} + +func (s VmToolsInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VmToolsInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Vni Pool Configuration. +type VniPoolConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // End value of VNI Pool range format: int32 + End *int64 + // Start value of VNI Pool range format: int32 + Start *int64 +} + +func (s VniPoolConfig) GetType__() bindings.BindingType { + return VniPoolConfigBindingType() +} + +func (s VniPoolConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VniPoolConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Vrf Route Targets for import/export. +type VrfRouteTargets struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Path of its parent + ParentPath *string + // Absolute path of this object + Path *string + // Path relative from its parent + RelativePath *string + // This is a UUID generated by the GM/LM to uniquely identify entites in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. + UniqueId *string + // subtree for this type within policy tree containing nested elements. + Children []*data.StructValue + // Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. + MarkedForDelete *bool + // Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. + Overridden *bool + // Possible values are: + // + // * VrfRouteTargets#VrfRouteTargets_ADDRESS_FAMILY_EVPN + // + // Address family. + AddressFamily *string + // + ExportRouteTargets []string + // + ImportRouteTargets []string +} +const VrfRouteTargets_ADDRESS_FAMILY_EVPN = "L2VPN_EVPN" + +func (s VrfRouteTargets) GetType__() bindings.BindingType { + return VrfRouteTargetsBindingType() +} + +func (s VrfRouteTargets) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VrfRouteTargets._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Schedule to specify day of the week and time to take automated backup +type WeeklyBackupSchedule struct { + // Days of week when backup is taken. 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday ... format: int64 + DaysOfWeek []int64 + // Time of day when backup is taken format: int64 + HourOfDay *int64 + // Time of day when backup is taken format: int64 + MinuteOfDay *int64 + // Possible values are: + // + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_WEEKLYBACKUPSCHEDULE + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_INTERVALBACKUPSCHEDULE + // + // Schedule type + ResourceType string +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const WeeklyBackupSchedule__TYPE_IDENTIFIER = "WeeklyBackupSchedule" + +func (s WeeklyBackupSchedule) GetType__() bindings.BindingType { + return WeeklyBackupScheduleBindingType() +} + +func (s WeeklyBackupSchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WeeklyBackupSchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Describes the configuration of a widget to be displayed on the dashboard. WidgetConfiguration is a base type that provides attributes of a widget in-general. +type WidgetConfiguration struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + // Link to this resource + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + // Legend to be displayed. If legend is not needed, do not include it. + Legend *Legend + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const WidgetConfiguration__TYPE_IDENTIFIER = "WidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION = "LabelValueConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION = "DonutConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION = "MultiWidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION = "ContainerConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION = "StatsConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION = "GridConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION = "GraphConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION = "CustomWidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION = "DropdownFilterWidgetConfiguration" + +func (s WidgetConfiguration) GetType__() bindings.BindingType { + return WidgetConfigurationBindingType() +} + +func (s WidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a list of widget configurations. +type WidgetConfigurationList struct { + // Array of widget configurations + Widgetconfigurations []*data.StructValue +} + +func (s WidgetConfigurationList) GetType__() bindings.BindingType { + return WidgetConfigurationListBindingType() +} + +func (s WidgetConfigurationList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WidgetConfigurationList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Represents a reference to a widget that is held by a container or a multi-widget or a View. +type WidgetItem struct { + // Possible values are: + // + // * WidgetItem#WidgetItem_ALIGNMENT_LEFT + // * WidgetItem#WidgetItem_ALIGNMENT_RIGHT + // + // Aligns widget either left or right. + Alignment *string + // Applicable for 'DonutConfiguration' and 'StatsConfiguration' reports only. If label is not specified, then it defaults to the label of the donut or stats report. + Label *Label + // If true, separates this widget in a container. + Separator *bool + // Determines placement of widget or container relative to other widgets and containers. The lower the weight, the higher it is in the placement order. format: int32 + Weight *int64 + // Id of the widget configuration that is held by a multi-widget or a container or a view. + WidgetId *string +} +const WidgetItem_ALIGNMENT_LEFT = "LEFT" +const WidgetItem_ALIGNMENT_RIGHT = "RIGHT" + +func (s WidgetItem) GetType__() bindings.BindingType { + return WidgetItemBindingType() +} + +func (s WidgetItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WidgetItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +type X509Certificate struct { + // One of the DSA cryptogaphic algorithm's strength parameters, base. + DsaPublicKeyg *string + // One of the DSA cryptogaphic algorithm's strength parameters, prime. + DsaPublicKeyp *string + // One of the DSA cryptogaphic algorithm's strength parameters, sub-prime. + DsaPublicKeyq *string + // One of the DSA cryptogaphic algorithm's strength parameters. + DsaPublicKeyy *string + // The Curve name for the ECDSA certificate. + EcdsaCurveName *string + // Possible values are: + // + // * X509Certificate#X509Certificate_ECDSA_EC_FIELD_F2M + // * X509Certificate#X509Certificate_ECDSA_EC_FIELD_FP + // + // Represents an elliptic curve (EC) finite field in ECDSA. + EcdsaEcField *string + // The order of the middle term(s) of the reduction polynomial in elliptic curve (EC) | characteristic 2 finite field.| Contents of this array are copied to protect against subsequent modification in ECDSA. format: int64 + EcdsaEcFieldF2mks []int64 + // The first coefficient of this elliptic curve in elliptic curve (EC) | characteristic 2 finite field for ECDSA. format: int64 + EcdsaEcFieldF2mm *int64 + // The value whose i-th bit corresponds to the i-th coefficient of the reduction polynomial | in elliptic curve (EC) characteristic 2 finite field for ECDSA. + EcdsaEcFieldF2mrp *string + // The specified prime for the elliptic curve prime finite field in ECDSA. + EcdsaEcFieldF2pp *string + // The first coefficient of this elliptic curve in ECDSA. + EcdsaPublicKeya *string + // The second coefficient of this elliptic curve in ECDSA. + EcdsaPublicKeyb *string + // The co-factor in ECDSA. format: int64 + EcdsaPublicKeyCofactor *int64 + // X co-ordinate of G (the generator which is also known as the base point) in ECDSA. + EcdsaPublicKeyGeneratorx *string + // Y co-ordinate of G (the generator which is also known as the base point) in ECDSA. + EcdsaPublicKeyGeneratory *string + // The order of generator G in ECDSA. + EcdsaPublicKeyOrder *string + // The bytes used during curve generation for later validation in ECDSA.| Contents of this array are copied to protect against subsequent modification. + EcdsaPublicKeySeed []string + // True if this is a CA certificate. + IsCa *bool + // True if this certificate is valid. + IsValid *bool + // The certificate issuers complete distinguished name. + Issuer *string + // The certificate issuer's common name. + IssuerCn *string + // The time in epoch milliseconds at which the certificate becomes invalid. format: int64 + NotAfter *int64 + // The time in epoch milliseconds at which the certificate becomes valid. format: int64 + NotBefore *int64 + // Possible values are: + // + // * X509Certificate#X509Certificate_PUBLIC_KEY_ALGO_RSA + // * X509Certificate#X509Certificate_PUBLIC_KEY_ALGO_DSA + // * X509Certificate#X509Certificate_PUBLIC_KEY_ALGO_ECDSA + // + // Cryptographic algorithm used by the public key for data encryption. + PublicKeyAlgo *string + // Size measured in bits of the public/private keys used in a cryptographic algorithm. format: int64 + PublicKeyLength *int64 + // An RSA public key is made up of the modulus and the public exponent. Exponent is a power number. + RsaPublicKeyExponent *string + // An RSA public key is made up of the modulus and the public exponent. Modulus is wrap around number. + RsaPublicKeyModulus *string + // Certificate's serial number. + SerialNumber *string + // The signature value(the raw signature bits) used for signing and validate the cert. + Signature *string + // The algorithm used by the Certificate Authority to sign the certificate. + SignatureAlgorithm *string + // The certificate owners complete distinguished name. + Subject *string + // The certificate owner's common name. + SubjectCn *string + // Certificate version (default v1). + Version *string +} +const X509Certificate_ECDSA_EC_FIELD_F2M = "F2M" +const X509Certificate_ECDSA_EC_FIELD_FP = "FP" +const X509Certificate_PUBLIC_KEY_ALGO_RSA = "RSA" +const X509Certificate_PUBLIC_KEY_ALGO_DSA = "DSA" +const X509Certificate_PUBLIC_KEY_ALGO_ECDSA = "ECDSA" + +func (s X509Certificate) GetType__() bindings.BindingType { + return X509CertificateBindingType() +} + +func (s X509Certificate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for X509Certificate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// A CRL is a time-stamped list identifying revoked certificates. +type X509Crl struct { + // List of X509CrlEntry. + CrlEntries []X509CrlEntry + // Issuer's distinguished name. (DN) + Issuer *string + // Next update time for the CRL. + NextUpdate *string + // CRL's version number either 1 or 2. + Version *string +} + +func (s X509Crl) GetType__() bindings.BindingType { + return X509CrlBindingType() +} + +func (s X509Crl) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for X509Crl._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + +// Each revoked certificate is identified in a CRL by its certificate serial number. +type X509CrlEntry struct { + // Revocation date. + RevocationDate *string + // The revoked certificate's serial number. + SerialNumber *string +} + +func (s X509CrlEntry) GetType__() bindings.BindingType { + return X509CrlEntryBindingType() +} + +func (s X509CrlEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for X509CrlEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + + + + + +func ALGTypeServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alg"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alg"] = "Alg" + fields["destination_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_ports"] = "DestinationPorts" + fields["source_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_ports"] = "SourcePorts" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ALG_type_service_entry", fields, reflect.TypeOf(ALGTypeServiceEntry{}), fieldNameMap, validators) +} + +func AbstractSpaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["connectivity_strategy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity_strategy"] = "ConnectivityStrategy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.abstract_space", fields, reflect.TypeOf(AbstractSpace{}), fieldNameMap, validators) +} + +func AcceptableComponentVersionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["acceptable_versions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["acceptable_versions"] = "AcceptableVersions" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.acceptable_component_version", fields, reflect.TypeOf(AcceptableComponentVersion{}), fieldNameMap, validators) +} + +func AcceptableComponentVersionListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AcceptableComponentVersionBindingType), reflect.TypeOf([]AcceptableComponentVersion{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.acceptable_component_version_list", fields, reflect.TypeOf(AcceptableComponentVersionList{}), fieldNameMap, validators) +} + +func ActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.action", fields, reflect.TypeOf(Action{}), fieldNameMap, validators) +} + +func ActionableResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.actionable_resource", fields, reflect.TypeOf(ActionableResource{}), fieldNameMap, validators) +} + +func ActionableResourceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ActionableResourceBindingType), reflect.TypeOf([]ActionableResource{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.actionable_resource_list_result", fields, reflect.TypeOf(ActionableResourceListResult{}), fieldNameMap, validators) +} + +func ActiveDirectoryIdentitySourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["base_dn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["base_dn"] = "BaseDn" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["ldap_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdentitySourceLdapServerBindingType), reflect.TypeOf([]IdentitySourceLdapServer{}))) + fieldNameMap["ldap_servers"] = "LdapServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.active_directory_identity_source", fields, reflect.TypeOf(ActiveDirectoryIdentitySource{}), fieldNameMap, validators) +} + +func AdvanceClusterRestoreInputBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SelectableResourceReferenceBindingType), reflect.TypeOf([]SelectableResourceReference{}))) + fieldNameMap["resources"] = "Resources" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.advance_cluster_restore_input", fields, reflect.TypeOf(AdvanceClusterRestoreInput{}), fieldNameMap, validators) +} + +func AdvanceClusterRestoreRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["data"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AdvanceClusterRestoreInputBindingType), reflect.TypeOf([]AdvanceClusterRestoreInput{}))) + fieldNameMap["data"] = "Data" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.advance_cluster_restore_request", fields, reflect.TypeOf(AdvanceClusterRestoreRequest{}), fieldNameMap, validators) +} + +func AggregateDNSForwarderStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fields["statistics_per_enforcement_point"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(DNSForwarderStatisticsPerEnforcementPointBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["statistics_per_enforcement_point"] = "StatisticsPerEnforcementPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.aggregate_DNS_forwarder_statistics", fields, reflect.TypeOf(AggregateDNSForwarderStatistics{}), fieldNameMap, validators) +} + +func AggregateDNSForwarderStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fields["status_per_enforcement_point"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(DNSForwarderStatusPerEnforcementPointBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["status_per_enforcement_point"] = "StatusPerEnforcementPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.aggregate_DNS_forwarder_status", fields, reflect.TypeOf(AggregateDNSForwarderStatus{}), fieldNameMap, validators) +} + +func AggregatePolicyDnsAnswerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_answer_per_enforcement_point"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(PolicyDnsAnswerPerEnforcementPointBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["dns_answer_per_enforcement_point"] = "DnsAnswerPerEnforcementPoint" + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.aggregate_policy_dns_answer", fields, reflect.TypeOf(AggregatePolicyDnsAnswer{}), fieldNameMap, validators) +} + +func AggregatePolicyRuntimeInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.aggregate_policy_runtime_info", fields, reflect.TypeOf(AggregatePolicyRuntimeInfo{}), fieldNameMap, validators) +} + +func AggregatedDataCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.aggregated_data_counter", fields, reflect.TypeOf(AggregatedDataCounter{}), fieldNameMap, validators) +} + +func AggregatedDataCounterExBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.aggregated_data_counter_ex", fields, reflect.TypeOf(AggregatedDataCounterEx{}), fieldNameMap, validators) +} + +func AggregatedLogicalRouterPortCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.aggregated_logical_router_port_counters", fields, reflect.TypeOf(AggregatedLogicalRouterPortCounters{}), fieldNameMap, validators) +} + +func ApiErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["error_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_data"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["error_data"] = "ErrorData" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["module_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["module_name"] = "ModuleName" + fields["related_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RelatedApiErrorBindingType), reflect.TypeOf([]RelatedApiError{}))) + fieldNameMap["related_errors"] = "RelatedErrors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.api_error", fields, reflect.TypeOf(ApiError{}), fieldNameMap, validators) +} + +func ApiRequestBodyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_pointer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_pointer"] = "ResourcePointer" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.api_request_body", fields, reflect.TypeOf(ApiRequestBody{}), fieldNameMap, validators) +} + +func ArpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["op_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["op_code"] = "OpCode" + fields["src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_ip"] = "SrcIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.arp_header", fields, reflect.TypeOf(ArpHeader{}), fieldNameMap, validators) +} + +func ArpSnoopingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["arp_binding_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["arp_binding_limit"] = "ArpBindingLimit" + fields["arp_snooping_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["arp_snooping_enabled"] = "ArpSnoopingEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.arp_snooping_config", fields, reflect.TypeOf(ArpSnoopingConfig{}), fieldNameMap, validators) +} + +func AttributeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attribute_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute_type"] = "AttributeType" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["read_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["read_only"] = "ReadOnly" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.attribute", fields, reflect.TypeOf(Attribute{}), fieldNameMap, validators) +} + +func AttributeValBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["data_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["data_type"] = "DataType" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["multivalue"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["multivalue"] = "Multivalue" + fields["values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["values"] = "Values" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.attribute_val", fields, reflect.TypeOf(AttributeVal{}), fieldNameMap, validators) +} + +func AxesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["x_label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["x_label"] = "XLabel" + fields["y_label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["y_label"] = "YLabel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.axes", fields, reflect.TypeOf(Axes{}), fieldNameMap, validators) +} + +func BackupConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["after_inventory_update_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["after_inventory_update_interval"] = "AfterInventoryUpdateInterval" + fields["backup_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["backup_enabled"] = "BackupEnabled" + fields["backup_schedule"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(BackupScheduleBindingType),}, bindings.REST)) + fieldNameMap["backup_schedule"] = "BackupSchedule" + fields["inventory_summary_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["inventory_summary_interval"] = "InventorySummaryInterval" + fields["passphrase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passphrase"] = "Passphrase" + fields["remote_file_server"] = bindings.NewOptionalType(bindings.NewReferenceType(RemoteFileServerBindingType)) + fieldNameMap["remote_file_server"] = "RemoteFileServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.backup_configuration", fields, reflect.TypeOf(BackupConfiguration{}), fieldNameMap, validators) +} + +func BackupOperationHistoryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_backup_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BackupOperationStatusBindingType), reflect.TypeOf([]BackupOperationStatus{}))) + fieldNameMap["cluster_backup_statuses"] = "ClusterBackupStatuses" + fields["inventory_backup_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BackupOperationStatusBindingType), reflect.TypeOf([]BackupOperationStatus{}))) + fieldNameMap["inventory_backup_statuses"] = "InventoryBackupStatuses" + fields["node_backup_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BackupOperationStatusBindingType), reflect.TypeOf([]BackupOperationStatus{}))) + fieldNameMap["node_backup_statuses"] = "NodeBackupStatuses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.backup_operation_history", fields, reflect.TypeOf(BackupOperationHistory{}), fieldNameMap, validators) +} + +func BackupOperationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backup_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["backup_id"] = "BackupId" + fields["end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end_time"] = "EndTime" + fields["error_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + fields["success"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["success"] = "Success" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.backup_operation_status", fields, reflect.TypeOf(BackupOperationStatus{}), fieldNameMap, validators) +} + +func BackupOverviewBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterBackupInfoBindingType), reflect.TypeOf([]ClusterBackupInfo{}))) + fieldNameMap["results"] = "Results" + fields["backup_config"] = bindings.NewOptionalType(bindings.NewReferenceType(BackupConfigurationBindingType)) + fieldNameMap["backup_config"] = "BackupConfig" + fields["backup_operation_history"] = bindings.NewOptionalType(bindings.NewReferenceType(BackupOperationHistoryBindingType)) + fieldNameMap["backup_operation_history"] = "BackupOperationHistory" + fields["current_backup_operation_status"] = bindings.NewOptionalType(bindings.NewReferenceType(CurrentBackupOperationStatusBindingType)) + fieldNameMap["current_backup_operation_status"] = "CurrentBackupOperationStatus" + fields["restore_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ClusterRestoreStatusBindingType)) + fieldNameMap["restore_status"] = "RestoreStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.backup_overview", fields, reflect.TypeOf(BackupOverview{}), fieldNameMap, validators) +} + +func BackupScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.backup_schedule", fields, reflect.TypeOf(BackupSchedule{}), fieldNameMap, validators) +} + +func BaseConsolidatedStatusPerEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alarm"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyRuntimeAlarmBindingType)) + fieldNameMap["alarm"] = "Alarm" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["consolidated_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ConsolidatedStatusBindingType)) + fieldNameMap["consolidated_status"] = "ConsolidatedStatus" + fields["enforcement_point_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_id"] = "EnforcementPointId" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.base_consolidated_status_per_enforcement_point", fields, reflect.TypeOf(BaseConsolidatedStatusPerEnforcementPoint{}), fieldNameMap, validators) +} + +func BaseEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["target_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPInfoBindingType), reflect.TypeOf([]IPInfo{}))) + fieldNameMap["target_ips"] = "TargetIps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.base_endpoint", fields, reflect.TypeOf(BaseEndpoint{}), fieldNameMap, validators) +} + +func BasePolicyServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["deployment_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_mode"] = "DeploymentMode" + fields["partner_service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["partner_service_name"] = "PartnerServiceName" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.base_policy_service_instance", fields, reflect.TypeOf(BasePolicyServiceInstance{}), fieldNameMap, validators) +} + +func BaseRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["destination_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_groups"] = "DestinationGroups" + fields["destinations_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destinations_excluded"] = "DestinationsExcluded" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["profiles"] = "Profiles" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_id"] = "RuleId" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["service_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["service_entries"] = "ServiceEntries" + fields["services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["services"] = "Services" + fields["source_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_groups"] = "SourceGroups" + fields["sources_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sources_excluded"] = "SourcesExcluded" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.base_rule", fields, reflect.TypeOf(BaseRule{}), fieldNameMap, validators) +} + +func BaseRuleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.base_rule_list_result", fields, reflect.TypeOf(BaseRuleListResult{}), fieldNameMap, validators) +} + +func BaseTier0InterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceSubnetBindingType), reflect.TypeOf([]InterfaceSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.base_tier0_interface", fields, reflect.TypeOf(BaseTier0Interface{}), fieldNameMap, validators) +} + +func BatchRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["continue_on_error"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["continue_on_error"] = "ContinueOnError" + fields["requests"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BatchRequestItemBindingType), reflect.TypeOf([]BatchRequestItem{}))) + fieldNameMap["requests"] = "Requests" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.batch_request", fields, reflect.TypeOf(BatchRequest{}), fieldNameMap, validators) +} + +func BatchRequestItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["body"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["body"] = "Body" + fields["method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["method"] = "Method" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.batch_request_item", fields, reflect.TypeOf(BatchRequestItem{}), fieldNameMap, validators) +} + +func BatchResponseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["has_errors"] = "HasErrors" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BatchResponseItemBindingType), reflect.TypeOf([]BatchResponseItem{}))) + fieldNameMap["results"] = "Results" + fields["rolled_back"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rolled_back"] = "RolledBack" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.batch_response", fields, reflect.TypeOf(BatchResponse{}), fieldNameMap, validators) +} + +func BatchResponseItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["body"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["body"] = "Body" + fields["code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["code"] = "Code" + fields["headers"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["headers"] = "Headers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.batch_response_item", fields, reflect.TypeOf(BatchResponseItem{}), fieldNameMap, validators) +} + +func BfdProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["multiple"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["multiple"] = "Multiple" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bfd_profile", fields, reflect.TypeOf(BfdProfile{}), fieldNameMap, validators) +} + +func BfdProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BfdProfileBindingType), reflect.TypeOf([]BfdProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bfd_profile_list_result", fields, reflect.TypeOf(BfdProfileListResult{}), fieldNameMap, validators) +} + +func BgpAddressFamilyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["in_prefix_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["in_prefix_count"] = "InPrefixCount" + fields["out_prefix_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["out_prefix_count"] = "OutPrefixCount" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_address_family", fields, reflect.TypeOf(BgpAddressFamily{}), fieldNameMap, validators) +} + +func BgpBfdConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["multiple"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["multiple"] = "Multiple" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_bfd_config", fields, reflect.TypeOf(BgpBfdConfig{}), fieldNameMap, validators) +} + +func BgpGracefulRestartConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + fields["timer"] = bindings.NewOptionalType(bindings.NewReferenceType(BgpGracefulRestartTimerBindingType)) + fieldNameMap["timer"] = "Timer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_graceful_restart_config", fields, reflect.TypeOf(BgpGracefulRestartConfig{}), fieldNameMap, validators) +} + +func BgpGracefulRestartTimerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["restart_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["restart_timer"] = "RestartTimer" + fields["stale_route_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["stale_route_timer"] = "StaleRouteTimer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_graceful_restart_timer", fields, reflect.TypeOf(BgpGracefulRestartTimer{}), fieldNameMap, validators) +} + +func BgpNeighborConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["allow_as_in"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_as_in"] = "AllowAsIn" + fields["bfd"] = bindings.NewOptionalType(bindings.NewReferenceType(BgpBfdConfigBindingType)) + fieldNameMap["bfd"] = "Bfd" + fields["graceful_restart_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["graceful_restart_mode"] = "GracefulRestartMode" + fields["hold_down_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hold_down_time"] = "HoldDownTime" + fields["in_route_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["in_route_filters"] = "InRouteFilters" + fields["keep_alive_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["keep_alive_time"] = "KeepAliveTime" + fields["maximum_hop_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["maximum_hop_limit"] = "MaximumHopLimit" + fields["neighbor_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_address"] = "NeighborAddress" + fields["out_route_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["out_route_filters"] = "OutRouteFilters" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["remote_as_num"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_as_num"] = "RemoteAsNum" + fields["route_filtering"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpRouteFilteringBindingType), reflect.TypeOf([]BgpRouteFiltering{}))) + fieldNameMap["route_filtering"] = "RouteFiltering" + fields["source_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_addresses"] = "SourceAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_neighbor_config", fields, reflect.TypeOf(BgpNeighborConfig{}), fieldNameMap, validators) +} + +func BgpNeighborConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborConfigBindingType), reflect.TypeOf([]BgpNeighborConfig{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_neighbor_config_list_result", fields, reflect.TypeOf(BgpNeighborConfigListResult{}), fieldNameMap, validators) +} + +func BgpNeighborRouteDetailsCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["as_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["as_path"] = "AsPath" + fields["local_pref"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["local_pref"] = "LocalPref" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["med"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["med"] = "Med" + fields["neighbor_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_address"] = "NeighborAddress" + fields["neighbor_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_id"] = "NeighborId" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_neighbor_route_details_csv_record", fields, reflect.TypeOf(BgpNeighborRouteDetailsCsvRecord{}), fieldNameMap, validators) +} + +func BgpNeighborRouteDetailsInCsvFormatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborRouteDetailsCsvRecordBindingType), reflect.TypeOf([]BgpNeighborRouteDetailsCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_neighbor_route_details_in_csv_format", fields, reflect.TypeOf(BgpNeighborRouteDetailsInCsvFormat{}), fieldNameMap, validators) +} + +func BgpNeighborRoutesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["egde_node_routes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoutesPerTransportNodeBindingType), reflect.TypeOf([]RoutesPerTransportNode{}))) + fieldNameMap["egde_node_routes"] = "EgdeNodeRoutes" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["neighbor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_path"] = "NeighborPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_neighbor_routes", fields, reflect.TypeOf(BgpNeighborRoutes{}), fieldNameMap, validators) +} + +func BgpNeighborRoutesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborRoutesBindingType), reflect.TypeOf([]BgpNeighborRoutes{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_neighbor_routes_list_result", fields, reflect.TypeOf(BgpNeighborRoutesListResult{}), fieldNameMap, validators) +} + +func BgpRouteFilteringBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address_family"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address_family"] = "AddressFamily" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["in_route_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["in_route_filters"] = "InRouteFilters" + fields["maximum_routes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["maximum_routes"] = "MaximumRoutes" + fields["out_route_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["out_route_filters"] = "OutRouteFilters" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_route_filtering", fields, reflect.TypeOf(BgpRouteFiltering{}), fieldNameMap, validators) +} + +func BgpRoutingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ecmp"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ecmp"] = "Ecmp" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["graceful_restart"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["graceful_restart"] = "GracefulRestart" + fields["graceful_restart_config"] = bindings.NewOptionalType(bindings.NewReferenceType(BgpGracefulRestartConfigBindingType)) + fieldNameMap["graceful_restart_config"] = "GracefulRestartConfig" + fields["inter_sr_ibgp"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inter_sr_ibgp"] = "InterSrIbgp" + fields["local_as_num"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_as_num"] = "LocalAsNum" + fields["multipath_relax"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["multipath_relax"] = "MultipathRelax" + fields["route_aggregations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RouteAggregationEntryBindingType), reflect.TypeOf([]RouteAggregationEntry{}))) + fieldNameMap["route_aggregations"] = "RouteAggregations" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bgp_routing_config", fields, reflect.TypeOf(BgpRoutingConfig{}), fieldNameMap, validators) +} + +func BinaryPacketDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["payload"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["payload"] = "Payload" + fields["frame_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["frame_size"] = "FrameSize" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["routed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["routed"] = "Routed" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.binary_packet_data", fields, reflect.TypeOf(BinaryPacketData{}), fieldNameMap, validators) +} + +func BridgeProfileConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridge_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bridge_profile_path"] = "BridgeProfilePath" + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + fields["vlan_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["vlan_ids"] = "VlanIds" + fields["vlan_transport_zone_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vlan_transport_zone_path"] = "VlanTransportZonePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.bridge_profile_config", fields, reflect.TypeOf(BridgeProfileConfig{}), fieldNameMap, validators) +} + +func ByodPolicyServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["deployment_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_mode"] = "DeploymentMode" + fields["partner_service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["partner_service_name"] = "PartnerServiceName" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.byod_policy_service_instance", fields, reflect.TypeOf(ByodPolicyServiceInstance{}), fieldNameMap, validators) +} + +func ChildBfdProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["BfdProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(BfdProfileBindingType)) + fieldNameMap["BfdProfile"] = "BfdProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_bfd_profile", fields, reflect.TypeOf(ChildBfdProfile{}), fieldNameMap, validators) +} + +func ChildBgpNeighborConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["BgpNeighborConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(BgpNeighborConfigBindingType)) + fieldNameMap["BgpNeighborConfig"] = "BgpNeighborConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_bgp_neighbor_config", fields, reflect.TypeOf(ChildBgpNeighborConfig{}), fieldNameMap, validators) +} + +func ChildBgpRoutingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["BgpRoutingConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(BgpRoutingConfigBindingType)) + fieldNameMap["BgpRoutingConfig"] = "BgpRoutingConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_bgp_routing_config", fields, reflect.TypeOf(ChildBgpRoutingConfig{}), fieldNameMap, validators) +} + +func ChildByodPolicyServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ByodPolicyServiceInstance"] = bindings.NewOptionalType(bindings.NewReferenceType(ByodPolicyServiceInstanceBindingType)) + fieldNameMap["ByodPolicyServiceInstance"] = "ByodPolicyServiceInstance" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_byod_policy_service_instance", fields, reflect.TypeOf(ChildByodPolicyServiceInstance{}), fieldNameMap, validators) +} + +func ChildCommunicationEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["CommunicationEntry"] = bindings.NewOptionalType(bindings.NewReferenceType(CommunicationEntryBindingType)) + fieldNameMap["CommunicationEntry"] = "CommunicationEntry" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_communication_entry", fields, reflect.TypeOf(ChildCommunicationEntry{}), fieldNameMap, validators) +} + +func ChildCommunicationMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["CommunicationMap"] = bindings.NewOptionalType(bindings.NewReferenceType(CommunicationMapBindingType)) + fieldNameMap["CommunicationMap"] = "CommunicationMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_communication_map", fields, reflect.TypeOf(ChildCommunicationMap{}), fieldNameMap, validators) +} + +func ChildCommunityListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["CommunityList"] = bindings.NewOptionalType(bindings.NewReferenceType(CommunityListBindingType)) + fieldNameMap["CommunityList"] = "CommunityList" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_community_list", fields, reflect.TypeOf(ChildCommunityList{}), fieldNameMap, validators) +} + +func ChildComputeClusterIdfwConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ComputeClusterIdfwConfiguration"] = bindings.NewOptionalType(bindings.NewReferenceType(ComputeClusterIdfwConfigurationBindingType)) + fieldNameMap["ComputeClusterIdfwConfiguration"] = "ComputeClusterIdfwConfiguration" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_compute_cluster_idfw_configuration", fields, reflect.TypeOf(ChildComputeClusterIdfwConfiguration{}), fieldNameMap, validators) +} + +func ChildConstraintBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Constraint"] = bindings.NewOptionalType(bindings.NewReferenceType(ConstraintBindingType)) + fieldNameMap["Constraint"] = "Constraint" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_constraint", fields, reflect.TypeOf(ChildConstraint{}), fieldNameMap, validators) +} + +func ChildDeploymentZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["DeploymentZone"] = bindings.NewOptionalType(bindings.NewReferenceType(DeploymentZoneBindingType)) + fieldNameMap["DeploymentZone"] = "DeploymentZone" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_deployment_zone", fields, reflect.TypeOf(ChildDeploymentZone{}), fieldNameMap, validators) +} + +func ChildDfwFirewallConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["DfwFirewallConfiguration"] = bindings.NewOptionalType(bindings.NewReferenceType(DfwFirewallConfigurationBindingType)) + fieldNameMap["DfwFirewallConfiguration"] = "DfwFirewallConfiguration" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_dfw_firewall_configuration", fields, reflect.TypeOf(ChildDfwFirewallConfiguration{}), fieldNameMap, validators) +} + +func ChildDhcpRelayConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["DhcpRelayConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpRelayConfigBindingType)) + fieldNameMap["DhcpRelayConfig"] = "DhcpRelayConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_dhcp_relay_config", fields, reflect.TypeOf(ChildDhcpRelayConfig{}), fieldNameMap, validators) +} + +func ChildDhcpServerConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["DhcpServerConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpServerConfigBindingType)) + fieldNameMap["DhcpServerConfig"] = "DhcpServerConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_dhcp_server_config", fields, reflect.TypeOf(ChildDhcpServerConfig{}), fieldNameMap, validators) +} + +func ChildDhcpStaticBindingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["DhcpStaticBindingConfig"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(DhcpStaticBindingConfigBindingType),}, bindings.REST)) + fieldNameMap["DhcpStaticBindingConfig"] = "DhcpStaticBindingConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_dhcp_static_binding_config", fields, reflect.TypeOf(ChildDhcpStaticBindingConfig{}), fieldNameMap, validators) +} + +func ChildDnsSecurityProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["DnsSecurityProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(DnsSecurityProfileBindingType)) + fieldNameMap["DnsSecurityProfile"] = "DnsSecurityProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_dns_security_profile", fields, reflect.TypeOf(ChildDnsSecurityProfile{}), fieldNameMap, validators) +} + +func ChildDnsSecurityProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["DnsSecurityProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(DnsSecurityProfileBindingMapBindingType)) + fieldNameMap["DnsSecurityProfileBindingMap"] = "DnsSecurityProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_dns_security_profile_binding_map", fields, reflect.TypeOf(ChildDnsSecurityProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildDomainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Domain"] = bindings.NewOptionalType(bindings.NewReferenceType(DomainBindingType)) + fieldNameMap["Domain"] = "Domain" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_domain", fields, reflect.TypeOf(ChildDomain{}), fieldNameMap, validators) +} + +func ChildDomainDeploymentMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["DomainDeploymentMap"] = bindings.NewOptionalType(bindings.NewReferenceType(DomainDeploymentMapBindingType)) + fieldNameMap["DomainDeploymentMap"] = "DomainDeploymentMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_domain_deployment_map", fields, reflect.TypeOf(ChildDomainDeploymentMap{}), fieldNameMap, validators) +} + +func ChildEndpointPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["EndpointPolicy"] = bindings.NewOptionalType(bindings.NewReferenceType(EndpointPolicyBindingType)) + fieldNameMap["EndpointPolicy"] = "EndpointPolicy" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_endpoint_policy", fields, reflect.TypeOf(ChildEndpointPolicy{}), fieldNameMap, validators) +} + +func ChildEndpointRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["EndpointRule"] = bindings.NewOptionalType(bindings.NewReferenceType(EndpointRuleBindingType)) + fieldNameMap["EndpointRule"] = "EndpointRule" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_endpoint_rule", fields, reflect.TypeOf(ChildEndpointRule{}), fieldNameMap, validators) +} + +func ChildEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["EnforcementPoint"] = bindings.NewOptionalType(bindings.NewReferenceType(EnforcementPointBindingType)) + fieldNameMap["EnforcementPoint"] = "EnforcementPoint" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_enforcement_point", fields, reflect.TypeOf(ChildEnforcementPoint{}), fieldNameMap, validators) +} + +func ChildEvpnConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["EvpnConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(EvpnConfigBindingType)) + fieldNameMap["EvpnConfig"] = "EvpnConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_evpn_config", fields, reflect.TypeOf(ChildEvpnConfig{}), fieldNameMap, validators) +} + +func ChildEvpnTunnelEndpointConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["EvpnTunnelEndpointConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(EvpnTunnelEndpointConfigBindingType)) + fieldNameMap["EvpnTunnelEndpointConfig"] = "EvpnTunnelEndpointConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_evpn_tunnel_endpoint_config", fields, reflect.TypeOf(ChildEvpnTunnelEndpointConfig{}), fieldNameMap, validators) +} + +func ChildFirewallIdentityStoreBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["FirewallIdentityStore"] = bindings.NewOptionalType(bindings.NewReferenceType(FirewallIdentityStoreBindingType)) + fieldNameMap["FirewallIdentityStore"] = "FirewallIdentityStore" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_firewall_identity_store", fields, reflect.TypeOf(ChildFirewallIdentityStore{}), fieldNameMap, validators) +} + +func ChildFloodProtectionProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["FloodProtectionProfile"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(FloodProtectionProfileBindingType),}, bindings.REST)) + fieldNameMap["FloodProtectionProfile"] = "FloodProtectionProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_flood_protection_profile", fields, reflect.TypeOf(ChildFloodProtectionProfile{}), fieldNameMap, validators) +} + +func ChildFloodProtectionProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["FloodProtectionProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(FloodProtectionProfileBindingMapBindingType)) + fieldNameMap["FloodProtectionProfileBindingMap"] = "FloodProtectionProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_flood_protection_profile_binding_map", fields, reflect.TypeOf(ChildFloodProtectionProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildForwardingPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ForwardingPolicy"] = bindings.NewOptionalType(bindings.NewReferenceType(ForwardingPolicyBindingType)) + fieldNameMap["ForwardingPolicy"] = "ForwardingPolicy" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_forwarding_policy", fields, reflect.TypeOf(ChildForwardingPolicy{}), fieldNameMap, validators) +} + +func ChildForwardingRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ForwardingRule"] = bindings.NewOptionalType(bindings.NewReferenceType(ForwardingRuleBindingType)) + fieldNameMap["ForwardingRule"] = "ForwardingRule" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_forwarding_rule", fields, reflect.TypeOf(ChildForwardingRule{}), fieldNameMap, validators) +} + +func ChildGatewayPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["GatewayPolicy"] = bindings.NewOptionalType(bindings.NewReferenceType(GatewayPolicyBindingType)) + fieldNameMap["GatewayPolicy"] = "GatewayPolicy" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_gateway_policy", fields, reflect.TypeOf(ChildGatewayPolicy{}), fieldNameMap, validators) +} + +func ChildGatewayQosProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["QosProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(GatewayQosProfileBindingType)) + fieldNameMap["QosProfile"] = "QosProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_gateway_qos_profile", fields, reflect.TypeOf(ChildGatewayQosProfile{}), fieldNameMap, validators) +} + +func ChildGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["GlobalConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(GlobalConfigBindingType)) + fieldNameMap["GlobalConfig"] = "GlobalConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_global_config", fields, reflect.TypeOf(ChildGlobalConfig{}), fieldNameMap, validators) +} + +func ChildGlobalManagerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["GlobalManager"] = bindings.NewOptionalType(bindings.NewReferenceType(GlobalManagerBindingType)) + fieldNameMap["GlobalManager"] = "GlobalManager" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_global_manager", fields, reflect.TypeOf(ChildGlobalManager{}), fieldNameMap, validators) +} + +func ChildGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Group"] = bindings.NewOptionalType(bindings.NewReferenceType(GroupBindingType)) + fieldNameMap["Group"] = "Group" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_group", fields, reflect.TypeOf(ChildGroup{}), fieldNameMap, validators) +} + +func ChildGroupDiscoveryProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["GroupDiscoveryProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(GroupDiscoveryProfileBindingMapBindingType)) + fieldNameMap["GroupDiscoveryProfileBindingMap"] = "GroupDiscoveryProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_group_discovery_profile_binding_map", fields, reflect.TypeOf(ChildGroupDiscoveryProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildGroupMonitoringProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["GroupMonitoringProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(GroupMonitoringProfileBindingMapBindingType)) + fieldNameMap["GroupMonitoringProfileBindingMap"] = "GroupMonitoringProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_group_monitoring_profile_binding_map", fields, reflect.TypeOf(ChildGroupMonitoringProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildIPDiscoveryProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPDiscoveryProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(IPDiscoveryProfileBindingType)) + fieldNameMap["IPDiscoveryProfile"] = "IpDiscoveryProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IP_discovery_profile", fields, reflect.TypeOf(ChildIPDiscoveryProfile{}), fieldNameMap, validators) +} + +func ChildIPFIXDFWCollectorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPFIXDFWCollectorProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(IPFIXDFWCollectorProfileBindingType)) + fieldNameMap["IPFIXDFWCollectorProfile"] = "IPFIXDFWCollectorProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IPFIXDFW_collector_profile", fields, reflect.TypeOf(ChildIPFIXDFWCollectorProfile{}), fieldNameMap, validators) +} + +func ChildIPFIXDFWProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPFIXDFWProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(IPFIXDFWProfileBindingType)) + fieldNameMap["IPFIXDFWProfile"] = "IPFIXDFWProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IPFIXDFW_profile", fields, reflect.TypeOf(ChildIPFIXDFWProfile{}), fieldNameMap, validators) +} + +func ChildIPFIXL2CollectorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPFIXL2CollectorProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(IPFIXL2CollectorProfileBindingType)) + fieldNameMap["IPFIXL2CollectorProfile"] = "IPFIXL2CollectorProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IPFIX_l2_collector_profile", fields, reflect.TypeOf(ChildIPFIXL2CollectorProfile{}), fieldNameMap, validators) +} + +func ChildIPFIXL2ProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPFIXL2Profile"] = bindings.NewOptionalType(bindings.NewReferenceType(IPFIXL2ProfileBindingType)) + fieldNameMap["IPFIXL2Profile"] = "IPFIXL2Profile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IPFIX_l2_profile", fields, reflect.TypeOf(ChildIPFIXL2Profile{}), fieldNameMap, validators) +} + +func ChildIPSecVpnDpdProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPSecVpnDpdProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVpnDpdProfileBindingType)) + fieldNameMap["IPSecVpnDpdProfile"] = "IpSecVpnDpdProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IP_sec_vpn_dpd_profile", fields, reflect.TypeOf(ChildIPSecVpnDpdProfile{}), fieldNameMap, validators) +} + +func ChildIPSecVpnIkeProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPSecVpnIkeProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVpnIkeProfileBindingType)) + fieldNameMap["IPSecVpnIkeProfile"] = "IpSecVpnIkeProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IP_sec_vpn_ike_profile", fields, reflect.TypeOf(ChildIPSecVpnIkeProfile{}), fieldNameMap, validators) +} + +func ChildIPSecVpnLocalEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPSecVpnLocalEndpoint"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVpnLocalEndpointBindingType)) + fieldNameMap["IPSecVpnLocalEndpoint"] = "IpSecVpnLocalEndpoint" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IP_sec_vpn_local_endpoint", fields, reflect.TypeOf(ChildIPSecVpnLocalEndpoint{}), fieldNameMap, validators) +} + +func ChildIPSecVpnServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPSecVpnService"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVpnServiceBindingType)) + fieldNameMap["IPSecVpnService"] = "IpSecVpnService" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IP_sec_vpn_service", fields, reflect.TypeOf(ChildIPSecVpnService{}), fieldNameMap, validators) +} + +func ChildIPSecVpnSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPSecVpnSession"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IPSecVpnSessionBindingType),}, bindings.REST)) + fieldNameMap["IPSecVpnSession"] = "IpSecVpnSession" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IP_sec_vpn_session", fields, reflect.TypeOf(ChildIPSecVpnSession{}), fieldNameMap, validators) +} + +func ChildIPSecVpnTunnelProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IPSecVpnTunnelProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVpnTunnelProfileBindingType)) + fieldNameMap["IPSecVpnTunnelProfile"] = "IpSecVpnTunnelProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_IP_sec_vpn_tunnel_profile", fields, reflect.TypeOf(ChildIPSecVpnTunnelProfile{}), fieldNameMap, validators) +} + +func ChildIdsClusterConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IdsClusterConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(IdsClusterConfigBindingType)) + fieldNameMap["IdsClusterConfig"] = "IdsClusterConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ids_cluster_config", fields, reflect.TypeOf(ChildIdsClusterConfig{}), fieldNameMap, validators) +} + +func ChildIdsProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IdsProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(IdsProfileBindingType)) + fieldNameMap["IdsProfile"] = "IdsProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ids_profile", fields, reflect.TypeOf(ChildIdsProfile{}), fieldNameMap, validators) +} + +func ChildIdsRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IdsRule"] = bindings.NewOptionalType(bindings.NewReferenceType(IdsRuleBindingType)) + fieldNameMap["IdsRule"] = "IdsRule" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ids_rule", fields, reflect.TypeOf(ChildIdsRule{}), fieldNameMap, validators) +} + +func ChildIdsSecurityPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IdsSecurityPolicy"] = bindings.NewOptionalType(bindings.NewReferenceType(IdsSecurityPolicyBindingType)) + fieldNameMap["IdsSecurityPolicy"] = "IdsSecurityPolicy" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ids_security_policy", fields, reflect.TypeOf(ChildIdsSecurityPolicy{}), fieldNameMap, validators) +} + +func ChildIdsSignatureBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IdsSignature"] = bindings.NewOptionalType(bindings.NewReferenceType(IdsSignatureBindingType)) + fieldNameMap["IdsSignature"] = "IdsSignature" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ids_signature", fields, reflect.TypeOf(ChildIdsSignature{}), fieldNameMap, validators) +} + +func ChildIdsStandaloneHostConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IdsStandaloneHostConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(IdsStandaloneHostConfigBindingType)) + fieldNameMap["IdsStandaloneHostConfig"] = "IdsStandaloneHostConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ids_standalone_host_config", fields, reflect.TypeOf(ChildIdsStandaloneHostConfig{}), fieldNameMap, validators) +} + +func ChildIpAddressAllocationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IpAddressAllocation"] = bindings.NewOptionalType(bindings.NewReferenceType(IpAddressAllocationBindingType)) + fieldNameMap["IpAddressAllocation"] = "IpAddressAllocation" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ip_address_allocation", fields, reflect.TypeOf(ChildIpAddressAllocation{}), fieldNameMap, validators) +} + +func ChildIpAddressBlockBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IpAddressBlock"] = bindings.NewOptionalType(bindings.NewReferenceType(IpAddressBlockBindingType)) + fieldNameMap["IpAddressBlock"] = "IpAddressBlock" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ip_address_block", fields, reflect.TypeOf(ChildIpAddressBlock{}), fieldNameMap, validators) +} + +func ChildIpAddressPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IpAddressPool"] = bindings.NewOptionalType(bindings.NewReferenceType(IpAddressPoolBindingType)) + fieldNameMap["IpAddressPool"] = "IpAddressPool" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ip_address_pool", fields, reflect.TypeOf(ChildIpAddressPool{}), fieldNameMap, validators) +} + +func ChildIpAddressPoolSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["IpAddressPoolSubnet"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IpAddressPoolSubnetBindingType),}, bindings.REST)) + fieldNameMap["IpAddressPoolSubnet"] = "IpAddressPoolSubnet" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ip_address_pool_subnet", fields, reflect.TypeOf(ChildIpAddressPoolSubnet{}), fieldNameMap, validators) +} + +func ChildIpv6DadProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Ipv6DadProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(Ipv6DadProfileBindingType)) + fieldNameMap["Ipv6DadProfile"] = "Ipv6DadProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ipv6_dad_profile", fields, reflect.TypeOf(ChildIpv6DadProfile{}), fieldNameMap, validators) +} + +func ChildIpv6NdraProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Ipv6NdraProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(Ipv6NdraProfileBindingType)) + fieldNameMap["Ipv6NdraProfile"] = "Ipv6NdraProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ipv6_ndra_profile", fields, reflect.TypeOf(ChildIpv6NdraProfile{}), fieldNameMap, validators) +} + +func ChildL2BridgeEndpointProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["L2BridgeEndpointProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(L2BridgeEndpointProfileBindingType)) + fieldNameMap["L2BridgeEndpointProfile"] = "L2BridgeEndpointProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_l2_bridge_endpoint_profile", fields, reflect.TypeOf(ChildL2BridgeEndpointProfile{}), fieldNameMap, validators) +} + +func ChildL2VPNServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["L2VPNService"] = bindings.NewOptionalType(bindings.NewReferenceType(L2VPNServiceBindingType)) + fieldNameMap["L2VPNService"] = "L2VPNService" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_l2_VPN_service", fields, reflect.TypeOf(ChildL2VPNService{}), fieldNameMap, validators) +} + +func ChildL2VPNSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["L2VPNSession"] = bindings.NewOptionalType(bindings.NewReferenceType(L2VPNSessionBindingType)) + fieldNameMap["L2VPNSession"] = "L2VPNSession" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_l2_VPN_session", fields, reflect.TypeOf(ChildL2VPNSession{}), fieldNameMap, validators) +} + +func ChildL2VpnBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["L2Vpn"] = bindings.NewOptionalType(bindings.NewReferenceType(L2VpnBindingType)) + fieldNameMap["L2Vpn"] = "L2Vpn" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_l2_vpn", fields, reflect.TypeOf(ChildL2Vpn{}), fieldNameMap, validators) +} + +func ChildL2VpnContextBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["L2VpnContext"] = bindings.NewOptionalType(bindings.NewReferenceType(L2VpnContextBindingType)) + fieldNameMap["L2VpnContext"] = "L2VpnContext" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_l2_vpn_context", fields, reflect.TypeOf(ChildL2VpnContext{}), fieldNameMap, validators) +} + +func ChildL3VpnBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["L3Vpn"] = bindings.NewOptionalType(bindings.NewReferenceType(L3VpnBindingType)) + fieldNameMap["L3Vpn"] = "L3Vpn" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_l3_vpn", fields, reflect.TypeOf(ChildL3Vpn{}), fieldNameMap, validators) +} + +func ChildL3VpnContextBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["L3VpnContext"] = bindings.NewOptionalType(bindings.NewReferenceType(L3VpnContextBindingType)) + fieldNameMap["L3VpnContext"] = "L3VpnContext" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_l3_vpn_context", fields, reflect.TypeOf(ChildL3VpnContext{}), fieldNameMap, validators) +} + +func ChildLBAppProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LBAppProfile"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LBAppProfileBindingType),}, bindings.REST)) + fieldNameMap["LBAppProfile"] = "LbAppProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_LB_app_profile", fields, reflect.TypeOf(ChildLBAppProfile{}), fieldNameMap, validators) +} + +func ChildLBClientSslProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LBClientSslProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(LBClientSslProfileBindingType)) + fieldNameMap["LBClientSslProfile"] = "LbClientSslProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_LB_client_ssl_profile", fields, reflect.TypeOf(ChildLBClientSslProfile{}), fieldNameMap, validators) +} + +func ChildLBMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LBMonitorProfile"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LBMonitorProfileBindingType),}, bindings.REST)) + fieldNameMap["LBMonitorProfile"] = "LbMonitorProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_LB_monitor_profile", fields, reflect.TypeOf(ChildLBMonitorProfile{}), fieldNameMap, validators) +} + +func ChildLBPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LBPersistenceProfile"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LBPersistenceProfileBindingType),}, bindings.REST)) + fieldNameMap["LBPersistenceProfile"] = "LbPersistenceProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_LB_persistence_profile", fields, reflect.TypeOf(ChildLBPersistenceProfile{}), fieldNameMap, validators) +} + +func ChildLBPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LBPool"] = bindings.NewOptionalType(bindings.NewReferenceType(LBPoolBindingType)) + fieldNameMap["LBPool"] = "LbPool" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_LB_pool", fields, reflect.TypeOf(ChildLBPool{}), fieldNameMap, validators) +} + +func ChildLBServerSslProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LBServerSslProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(LBServerSslProfileBindingType)) + fieldNameMap["LBServerSslProfile"] = "LbServerSslProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_LB_server_ssl_profile", fields, reflect.TypeOf(ChildLBServerSslProfile{}), fieldNameMap, validators) +} + +func ChildLBServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LBService"] = bindings.NewOptionalType(bindings.NewReferenceType(LBServiceBindingType)) + fieldNameMap["LBService"] = "LbService" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_LB_service", fields, reflect.TypeOf(ChildLBService{}), fieldNameMap, validators) +} + +func ChildLBVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LBVirtualServer"] = bindings.NewOptionalType(bindings.NewReferenceType(LBVirtualServerBindingType)) + fieldNameMap["LBVirtualServer"] = "LbVirtualServer" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_LB_virtual_server", fields, reflect.TypeOf(ChildLBVirtualServer{}), fieldNameMap, validators) +} + +func ChildLocaleServicesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["LocaleServices"] = bindings.NewOptionalType(bindings.NewReferenceType(LocaleServicesBindingType)) + fieldNameMap["LocaleServices"] = "LocaleServices" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_locale_services", fields, reflect.TypeOf(ChildLocaleServices{}), fieldNameMap, validators) +} + +func ChildMacDiscoveryProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["MacDiscoveryProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(MacDiscoveryProfileBindingType)) + fieldNameMap["MacDiscoveryProfile"] = "MacDiscoveryProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_mac_discovery_profile", fields, reflect.TypeOf(ChildMacDiscoveryProfile{}), fieldNameMap, validators) +} + +func ChildMetadataProxyConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["MetadataProxyConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(MetadataProxyConfigBindingType)) + fieldNameMap["MetadataProxyConfig"] = "MetadataProxyConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_metadata_proxy_config", fields, reflect.TypeOf(ChildMetadataProxyConfig{}), fieldNameMap, validators) +} + +func ChildPolicyConfigResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_config_resource", fields, reflect.TypeOf(ChildPolicyConfigResource{}), fieldNameMap, validators) +} + +func ChildPolicyContextProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyContextProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyContextProfileBindingType)) + fieldNameMap["PolicyContextProfile"] = "PolicyContextProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_context_profile", fields, reflect.TypeOf(ChildPolicyContextProfile{}), fieldNameMap, validators) +} + +func ChildPolicyDnsForwarderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyDnsForwarder"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyDnsForwarderBindingType)) + fieldNameMap["PolicyDnsForwarder"] = "PolicyDnsForwarder" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_dns_forwarder", fields, reflect.TypeOf(ChildPolicyDnsForwarder{}), fieldNameMap, validators) +} + +func ChildPolicyDnsForwarderZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyDnsForwarderZone"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyDnsForwarderZoneBindingType)) + fieldNameMap["PolicyDnsForwarderZone"] = "PolicyDnsForwarderZone" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_dns_forwarder_zone", fields, reflect.TypeOf(ChildPolicyDnsForwarderZone{}), fieldNameMap, validators) +} + +func ChildPolicyEdgeClusterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyEdgeCluster"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyEdgeClusterBindingType)) + fieldNameMap["PolicyEdgeCluster"] = "PolicyEdgeCluster" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_edge_cluster", fields, reflect.TypeOf(ChildPolicyEdgeCluster{}), fieldNameMap, validators) +} + +func ChildPolicyEdgeNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyEdgeNode"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyEdgeNodeBindingType)) + fieldNameMap["PolicyEdgeNode"] = "PolicyEdgeNode" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_edge_node", fields, reflect.TypeOf(ChildPolicyEdgeNode{}), fieldNameMap, validators) +} + +func ChildPolicyExcludeListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyExcludeList"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyExcludeListBindingType)) + fieldNameMap["PolicyExcludeList"] = "PolicyExcludeList" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_exclude_list", fields, reflect.TypeOf(ChildPolicyExcludeList{}), fieldNameMap, validators) +} + +func ChildPolicyFirewallCPUMemThresholdsProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyFirewallCPUMemThresholdsProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyFirewallCPUMemThresholdsProfileBindingMapBindingType)) + fieldNameMap["PolicyFirewallCPUMemThresholdsProfileBindingMap"] = "PolicyFirewallCPUMemThresholdsProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_firewall_CPU_mem_thresholds_profile_binding_map", fields, reflect.TypeOf(ChildPolicyFirewallCPUMemThresholdsProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildPolicyFirewallCpuMemThresholdsProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyFirewallCpuMemThresholdsProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyFirewallCpuMemThresholdsProfileBindingType)) + fieldNameMap["PolicyFirewallCpuMemThresholdsProfile"] = "PolicyFirewallCpuMemThresholdsProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_firewall_cpu_mem_thresholds_profile", fields, reflect.TypeOf(ChildPolicyFirewallCpuMemThresholdsProfile{}), fieldNameMap, validators) +} + +func ChildPolicyFirewallFloodProtectionProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyFirewallFloodProtectionProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyFirewallFloodProtectionProfileBindingMapBindingType)) + fieldNameMap["PolicyFirewallFloodProtectionProfileBindingMap"] = "PolicyFirewallFloodProtectionProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_firewall_flood_protection_profile_binding_map", fields, reflect.TypeOf(ChildPolicyFirewallFloodProtectionProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildPolicyFirewallSchedulerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyFirewallScheduler"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyFirewallSchedulerBindingType)) + fieldNameMap["PolicyFirewallScheduler"] = "PolicyFirewallScheduler" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_firewall_scheduler", fields, reflect.TypeOf(ChildPolicyFirewallScheduler{}), fieldNameMap, validators) +} + +func ChildPolicyFirewallSessionTimerProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyFirewallSessionTimerProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyFirewallSessionTimerProfileBindingType)) + fieldNameMap["PolicyFirewallSessionTimerProfile"] = "PolicyFirewallSessionTimerProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_firewall_session_timer_profile", fields, reflect.TypeOf(ChildPolicyFirewallSessionTimerProfile{}), fieldNameMap, validators) +} + +func ChildPolicyFirewallSessionTimerProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyFirewallSessionTimerProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyFirewallSessionTimerProfileBindingMapBindingType)) + fieldNameMap["PolicyFirewallSessionTimerProfileBindingMap"] = "PolicyFirewallSessionTimerProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_firewall_session_timer_profile_binding_map", fields, reflect.TypeOf(ChildPolicyFirewallSessionTimerProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildPolicyIgmpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyIgmpProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyIgmpProfileBindingType)) + fieldNameMap["PolicyIgmpProfile"] = "PolicyIgmpProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_igmp_profile", fields, reflect.TypeOf(ChildPolicyIgmpProfile{}), fieldNameMap, validators) +} + +func ChildPolicyLabelBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyLabel"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyLabelBindingType)) + fieldNameMap["PolicyLabel"] = "PolicyLabel" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_label", fields, reflect.TypeOf(ChildPolicyLabel{}), fieldNameMap, validators) +} + +func ChildPolicyLbMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyLbMonitorProfile"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(PolicyLbMonitorProfileBindingType),}, bindings.REST)) + fieldNameMap["PolicyLbMonitorProfile"] = "PolicyLbMonitorProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_lb_monitor_profile", fields, reflect.TypeOf(ChildPolicyLbMonitorProfile{}), fieldNameMap, validators) +} + +func ChildPolicyLbPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyLbPersistenceProfile"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(PolicyLbPersistenceProfileBindingType),}, bindings.REST)) + fieldNameMap["PolicyLbPersistenceProfile"] = "PolicyLbPersistenceProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_lb_persistence_profile", fields, reflect.TypeOf(ChildPolicyLbPersistenceProfile{}), fieldNameMap, validators) +} + +func ChildPolicyLbPoolAccessBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyLbPoolAccess"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyLbPoolAccessBindingType)) + fieldNameMap["PolicyLbPoolAccess"] = "PolicyLbPoolAccess" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_lb_pool_access", fields, reflect.TypeOf(ChildPolicyLbPoolAccess{}), fieldNameMap, validators) +} + +func ChildPolicyLbRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyLbRule"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyLbRuleBindingType)) + fieldNameMap["PolicyLbRule"] = "PolicyLbRule" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_lb_rule", fields, reflect.TypeOf(ChildPolicyLbRule{}), fieldNameMap, validators) +} + +func ChildPolicyLbVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyLbVirtualServer"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(PolicyLbVirtualServerBindingType),}, bindings.REST)) + fieldNameMap["PolicyLbVirtualServer"] = "PolicyLbVirtualServer" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_lb_virtual_server", fields, reflect.TypeOf(ChildPolicyLbVirtualServer{}), fieldNameMap, validators) +} + +func ChildPolicyMulticastConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyMulticastConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyMulticastConfigBindingType)) + fieldNameMap["PolicyMulticastConfig"] = "PolicyMulticastConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_multicast_config", fields, reflect.TypeOf(ChildPolicyMulticastConfig{}), fieldNameMap, validators) +} + +func ChildPolicyNatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyNat"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyNatBindingType)) + fieldNameMap["PolicyNat"] = "PolicyNat" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_nat", fields, reflect.TypeOf(ChildPolicyNat{}), fieldNameMap, validators) +} + +func ChildPolicyNatRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyNatRule"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyNatRuleBindingType)) + fieldNameMap["PolicyNatRule"] = "PolicyNatRule" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_nat_rule", fields, reflect.TypeOf(ChildPolicyNatRule{}), fieldNameMap, validators) +} + +func ChildPolicyPimProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyPimProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyPimProfileBindingType)) + fieldNameMap["PolicyPimProfile"] = "PolicyPimProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_pim_profile", fields, reflect.TypeOf(ChildPolicyPimProfile{}), fieldNameMap, validators) +} + +func ChildPolicyServiceChainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyServiceChain"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyServiceChainBindingType)) + fieldNameMap["PolicyServiceChain"] = "PolicyServiceChain" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_service_chain", fields, reflect.TypeOf(ChildPolicyServiceChain{}), fieldNameMap, validators) +} + +func ChildPolicyServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyServiceInstance"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyServiceInstanceBindingType)) + fieldNameMap["PolicyServiceInstance"] = "PolicyServiceInstance" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_service_instance", fields, reflect.TypeOf(ChildPolicyServiceInstance{}), fieldNameMap, validators) +} + +func ChildPolicyServiceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyServiceProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyServiceProfileBindingType)) + fieldNameMap["PolicyServiceProfile"] = "PolicyServiceProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_service_profile", fields, reflect.TypeOf(ChildPolicyServiceProfile{}), fieldNameMap, validators) +} + +func ChildPolicyTransportZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyTransportZone"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyTransportZoneBindingType)) + fieldNameMap["PolicyTransportZone"] = "PolicyTransportZone" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_transport_zone", fields, reflect.TypeOf(ChildPolicyTransportZone{}), fieldNameMap, validators) +} + +func ChildPolicyUrlCategorizationConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PolicyUrlCategorizationConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyUrlCategorizationConfigBindingType)) + fieldNameMap["PolicyUrlCategorizationConfig"] = "PolicyUrlCategorizationConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_policy_url_categorization_config", fields, reflect.TypeOf(ChildPolicyUrlCategorizationConfig{}), fieldNameMap, validators) +} + +func ChildPortDiscoveryProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PortDiscoveryProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(PortDiscoveryProfileBindingMapBindingType)) + fieldNameMap["PortDiscoveryProfileBindingMap"] = "PortDiscoveryProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_port_discovery_profile_binding_map", fields, reflect.TypeOf(ChildPortDiscoveryProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildPortMirroringProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PortMirroringProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(PortMirroringProfileBindingType)) + fieldNameMap["PortMirroringProfile"] = "PortMirroringProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_port_mirroring_profile", fields, reflect.TypeOf(ChildPortMirroringProfile{}), fieldNameMap, validators) +} + +func ChildPortMonitoringProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PortMonitoringProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(PortMonitoringProfileBindingMapBindingType)) + fieldNameMap["PortMonitoringProfileBindingMap"] = "PortMonitoringProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_port_monitoring_profile_binding_map", fields, reflect.TypeOf(ChildPortMonitoringProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildPortQosProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PortQoSProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(PortQosProfileBindingMapBindingType)) + fieldNameMap["PortQoSProfileBindingMap"] = "PortQosProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_port_qos_profile_binding_map", fields, reflect.TypeOf(ChildPortQosProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildPortSecurityProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PortSecurityProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(PortSecurityProfileBindingMapBindingType)) + fieldNameMap["PortSecurityProfileBindingMap"] = "PortSecurityProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_port_security_profile_binding_map", fields, reflect.TypeOf(ChildPortSecurityProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildPrefixListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["PrefixList"] = bindings.NewOptionalType(bindings.NewReferenceType(PrefixListBindingType)) + fieldNameMap["PrefixList"] = "PrefixList" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_prefix_list", fields, reflect.TypeOf(ChildPrefixList{}), fieldNameMap, validators) +} + +func ChildQosProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["QoSProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(QosProfileBindingType)) + fieldNameMap["QoSProfile"] = "QosProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_qos_profile", fields, reflect.TypeOf(ChildQosProfile{}), fieldNameMap, validators) +} + +func ChildReactionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Reaction"] = bindings.NewOptionalType(bindings.NewReferenceType(ReactionBindingType)) + fieldNameMap["Reaction"] = "Reaction" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_reaction", fields, reflect.TypeOf(ChildReaction{}), fieldNameMap, validators) +} + +func ChildRedirectionPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["RedirectionPolicy"] = bindings.NewOptionalType(bindings.NewReferenceType(RedirectionPolicyBindingType)) + fieldNameMap["RedirectionPolicy"] = "RedirectionPolicy" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_redirection_policy", fields, reflect.TypeOf(ChildRedirectionPolicy{}), fieldNameMap, validators) +} + +func ChildRedirectionRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["RedirectionRule"] = bindings.NewOptionalType(bindings.NewReferenceType(RedirectionRuleBindingType)) + fieldNameMap["RedirectionRule"] = "RedirectionRule" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_redirection_rule", fields, reflect.TypeOf(ChildRedirectionRule{}), fieldNameMap, validators) +} + +func ChildResourceReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_resource_reference", fields, reflect.TypeOf(ChildResourceReference{}), fieldNameMap, validators) +} + +func ChildRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Rule"] = bindings.NewOptionalType(bindings.NewReferenceType(RuleBindingType)) + fieldNameMap["Rule"] = "Rule" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_rule", fields, reflect.TypeOf(ChildRule{}), fieldNameMap, validators) +} + +func ChildSecurityPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SecurityPolicy"] = bindings.NewOptionalType(bindings.NewReferenceType(SecurityPolicyBindingType)) + fieldNameMap["SecurityPolicy"] = "SecurityPolicy" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_security_policy", fields, reflect.TypeOf(ChildSecurityPolicy{}), fieldNameMap, validators) +} + +func ChildSegmentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Segment"] = bindings.NewOptionalType(bindings.NewReferenceType(SegmentBindingType)) + fieldNameMap["Segment"] = "Segment" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_segment", fields, reflect.TypeOf(ChildSegment{}), fieldNameMap, validators) +} + +func ChildSegmentDiscoveryProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SegmentDiscoveryProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(SegmentDiscoveryProfileBindingMapBindingType)) + fieldNameMap["SegmentDiscoveryProfileBindingMap"] = "SegmentDiscoveryProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_segment_discovery_profile_binding_map", fields, reflect.TypeOf(ChildSegmentDiscoveryProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildSegmentMonitoringProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SegmentMonitoringProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(SegmentMonitoringProfileBindingMapBindingType)) + fieldNameMap["SegmentMonitoringProfileBindingMap"] = "SegmentMonitoringProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_segment_monitoring_profile_binding_map", fields, reflect.TypeOf(ChildSegmentMonitoringProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildSegmentPortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SegmentPort"] = bindings.NewOptionalType(bindings.NewReferenceType(SegmentPortBindingType)) + fieldNameMap["SegmentPort"] = "SegmentPort" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_segment_port", fields, reflect.TypeOf(ChildSegmentPort{}), fieldNameMap, validators) +} + +func ChildSegmentQosProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SegmentQoSProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(SegmentQosProfileBindingMapBindingType)) + fieldNameMap["SegmentQoSProfileBindingMap"] = "SegmentQosProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_segment_qos_profile_binding_map", fields, reflect.TypeOf(ChildSegmentQosProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildSegmentSecurityProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SegmentSecurityProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(SegmentSecurityProfileBindingType)) + fieldNameMap["SegmentSecurityProfile"] = "SegmentSecurityProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_segment_security_profile", fields, reflect.TypeOf(ChildSegmentSecurityProfile{}), fieldNameMap, validators) +} + +func ChildSegmentSecurityProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SegmentSecurityProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(SegmentSecurityProfileBindingMapBindingType)) + fieldNameMap["SegmentSecurityProfileBindingMap"] = "SegmentSecurityProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_segment_security_profile_binding_map", fields, reflect.TypeOf(ChildSegmentSecurityProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Service"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceBindingType)) + fieldNameMap["Service"] = "Service" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_service", fields, reflect.TypeOf(ChildService{}), fieldNameMap, validators) +} + +func ChildServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Service"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST)) + fieldNameMap["Service"] = "Service" + fields["ServiceEntry"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST)) + fieldNameMap["ServiceEntry"] = "ServiceEntry" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_service_entry", fields, reflect.TypeOf(ChildServiceEntry{}), fieldNameMap, validators) +} + +func ChildServiceInstanceEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ServiceInstanceEndpoint"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceInstanceEndpointBindingType)) + fieldNameMap["ServiceInstanceEndpoint"] = "ServiceInstanceEndpoint" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_service_instance_endpoint", fields, reflect.TypeOf(ChildServiceInstanceEndpoint{}), fieldNameMap, validators) +} + +func ChildServiceInterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ServiceInterface"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceInterfaceBindingType)) + fieldNameMap["ServiceInterface"] = "ServiceInterface" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_service_interface", fields, reflect.TypeOf(ChildServiceInterface{}), fieldNameMap, validators) +} + +func ChildServiceReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ServiceReference"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceReferenceBindingType)) + fieldNameMap["ServiceReference"] = "ServiceReference" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_service_reference", fields, reflect.TypeOf(ChildServiceReference{}), fieldNameMap, validators) +} + +func ChildServiceSegmentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ServiceSegment"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceSegmentBindingType)) + fieldNameMap["ServiceSegment"] = "ServiceSegment" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_service_segment", fields, reflect.TypeOf(ChildServiceSegment{}), fieldNameMap, validators) +} + +func ChildSessionTimerProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SessionTimerProfileBindingMap"] = bindings.NewOptionalType(bindings.NewReferenceType(SessionTimerProfileBindingMapBindingType)) + fieldNameMap["SessionTimerProfileBindingMap"] = "SessionTimerProfileBindingMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_session_timer_profile_binding_map", fields, reflect.TypeOf(ChildSessionTimerProfileBindingMap{}), fieldNameMap, validators) +} + +func ChildSiteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Site"] = bindings.NewOptionalType(bindings.NewReferenceType(SiteBindingType)) + fieldNameMap["Site"] = "Site" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_site", fields, reflect.TypeOf(ChildSite{}), fieldNameMap, validators) +} + +func ChildSpoofGuardProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SpoofGuardProfile"] = bindings.NewOptionalType(bindings.NewReferenceType(SpoofGuardProfileBindingType)) + fieldNameMap["SpoofGuardProfile"] = "SpoofGuardProfile" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_spoof_guard_profile", fields, reflect.TypeOf(ChildSpoofGuardProfile{}), fieldNameMap, validators) +} + +func ChildSslTrustObjectDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["SslTrustObjectData"] = bindings.NewOptionalType(bindings.NewReferenceType(SslTrustObjectDataBindingType)) + fieldNameMap["SslTrustObjectData"] = "SslTrustObjectData" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_ssl_trust_object_data", fields, reflect.TypeOf(ChildSslTrustObjectData{}), fieldNameMap, validators) +} + +func ChildStandaloneHostIdfwConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["StandaloneHostIdfwConfiguration"] = bindings.NewOptionalType(bindings.NewReferenceType(StandaloneHostIdfwConfigurationBindingType)) + fieldNameMap["StandaloneHostIdfwConfiguration"] = "StandaloneHostIdfwConfiguration" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_standalone_host_idfw_configuration", fields, reflect.TypeOf(ChildStandaloneHostIdfwConfiguration{}), fieldNameMap, validators) +} + +func ChildStaticARPConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["StaticARPConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(StaticARPConfigBindingType)) + fieldNameMap["StaticARPConfig"] = "StaticARPConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_static_ARP_config", fields, reflect.TypeOf(ChildStaticARPConfig{}), fieldNameMap, validators) +} + +func ChildStaticRouteBfdPeerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["BfdPeer"] = bindings.NewOptionalType(bindings.NewReferenceType(StaticRouteBfdPeerBindingType)) + fieldNameMap["BfdPeer"] = "BfdPeer" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_static_route_bfd_peer", fields, reflect.TypeOf(ChildStaticRouteBfdPeer{}), fieldNameMap, validators) +} + +func ChildStaticRoutesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["StaticRoutes"] = bindings.NewOptionalType(bindings.NewReferenceType(StaticRoutesBindingType)) + fieldNameMap["StaticRoutes"] = "StaticRoutes" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_static_routes", fields, reflect.TypeOf(ChildStaticRoutes{}), fieldNameMap, validators) +} + +func ChildTier0BindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Tier0"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier0BindingType)) + fieldNameMap["Tier0"] = "Tier0" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tier0", fields, reflect.TypeOf(ChildTier0{}), fieldNameMap, validators) +} + +func ChildTier0DeploymentMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Tier0DeploymentMap"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier0DeploymentMapBindingType)) + fieldNameMap["Tier0DeploymentMap"] = "Tier0DeploymentMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tier0_deployment_map", fields, reflect.TypeOf(ChildTier0DeploymentMap{}), fieldNameMap, validators) +} + +func ChildTier0InterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Tier0Interface"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier0InterfaceBindingType)) + fieldNameMap["Tier0Interface"] = "Tier0Interface" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tier0_interface", fields, reflect.TypeOf(ChildTier0Interface{}), fieldNameMap, validators) +} + +func ChildTier0RouteMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Tier0RouteMap"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier0RouteMapBindingType)) + fieldNameMap["Tier0RouteMap"] = "Tier0RouteMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tier0_route_map", fields, reflect.TypeOf(ChildTier0RouteMap{}), fieldNameMap, validators) +} + +func ChildTier1BindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Tier1"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier1BindingType)) + fieldNameMap["Tier1"] = "Tier1" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tier1", fields, reflect.TypeOf(ChildTier1{}), fieldNameMap, validators) +} + +func ChildTier1DeploymentMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Tier1DeploymentMap"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier1DeploymentMapBindingType)) + fieldNameMap["Tier1DeploymentMap"] = "Tier1DeploymentMap" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tier1_deployment_map", fields, reflect.TypeOf(ChildTier1DeploymentMap{}), fieldNameMap, validators) +} + +func ChildTier1InterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["Tier1Interface"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier1InterfaceBindingType)) + fieldNameMap["Tier1Interface"] = "Tier1Interface" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tier1_interface", fields, reflect.TypeOf(ChildTier1Interface{}), fieldNameMap, validators) +} + +func ChildTlsCertificateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["TlsCertificate"] = bindings.NewOptionalType(bindings.NewReferenceType(TlsCertificateBindingType)) + fieldNameMap["TlsCertificate"] = "TlsCertificate" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tls_certificate", fields, reflect.TypeOf(ChildTlsCertificate{}), fieldNameMap, validators) +} + +func ChildTlsCrlBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["TlsCrl"] = bindings.NewOptionalType(bindings.NewReferenceType(TlsCrlBindingType)) + fieldNameMap["TlsCrl"] = "TlsCrl" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tls_crl", fields, reflect.TypeOf(ChildTlsCrl{}), fieldNameMap, validators) +} + +func ChildTlsTrustDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["TlsTrustData"] = bindings.NewOptionalType(bindings.NewReferenceType(TlsTrustDataBindingType)) + fieldNameMap["TlsTrustData"] = "TlsTrustData" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_tls_trust_data", fields, reflect.TypeOf(ChildTlsTrustData{}), fieldNameMap, validators) +} + +func ChildTraceflowConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["TraceflowConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(TraceflowConfigBindingType)) + fieldNameMap["TraceflowConfig"] = "TraceflowConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_traceflow_config", fields, reflect.TypeOf(ChildTraceflowConfig{}), fieldNameMap, validators) +} + +func ChildVirtualEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["VirtualEndpoint"] = bindings.NewOptionalType(bindings.NewReferenceType(VirtualEndpointBindingType)) + fieldNameMap["VirtualEndpoint"] = "VirtualEndpoint" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_virtual_endpoint", fields, reflect.TypeOf(ChildVirtualEndpoint{}), fieldNameMap, validators) +} + +func ChildVniPoolConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["VniPoolConfig"] = bindings.NewOptionalType(bindings.NewReferenceType(VniPoolConfigBindingType)) + fieldNameMap["VniPoolConfig"] = "VniPoolConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.child_vni_pool_config", fields, reflect.TypeOf(ChildVniPoolConfig{}), fieldNameMap, validators) +} + +func ClasslessStaticRouteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.classless_static_route", fields, reflect.TypeOf(ClasslessStaticRoute{}), fieldNameMap, validators) +} + +func CloudNativeServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_type"] = "ServiceType" + fields["source"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["source"] = "Source" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.cloud_native_service_instance", fields, reflect.TypeOf(CloudNativeServiceInstance{}), fieldNameMap, validators) +} + +func ClusterBackupInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["restore_type"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["restore_type"] = "RestoreType" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.cluster_backup_info", fields, reflect.TypeOf(ClusterBackupInfo{}), fieldNameMap, validators) +} + +func ClusterBackupInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterBackupInfoBindingType), reflect.TypeOf([]ClusterBackupInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.cluster_backup_info_list_result", fields, reflect.TypeOf(ClusterBackupInfoListResult{}), fieldNameMap, validators) +} + +func ClusterRestoreStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backup_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["backup_timestamp"] = "BackupTimestamp" + fields["endpoints"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["endpoints"] = "Endpoints" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["instructions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InstructionInfoBindingType), reflect.TypeOf([]InstructionInfo{}))) + fieldNameMap["instructions"] = "Instructions" + fields["restore_end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["restore_end_time"] = "RestoreEndTime" + fields["restore_start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["restore_start_time"] = "RestoreStartTime" + fields["status"] = bindings.NewOptionalType(bindings.NewReferenceType(GlobalRestoreStatusBindingType)) + fieldNameMap["status"] = "Status" + fields["step"] = bindings.NewOptionalType(bindings.NewReferenceType(RestoreStepBindingType)) + fieldNameMap["step"] = "Step" + fields["total_steps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_steps"] = "TotalSteps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.cluster_restore_status", fields, reflect.TypeOf(ClusterRestoreStatus{}), fieldNameMap, validators) +} + +func ColumnItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["column_identifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["column_identifier"] = "ColumnIdentifier" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["hidden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["hidden"] = "Hidden" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["render_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RenderConfigurationBindingType), reflect.TypeOf([]RenderConfiguration{}))) + fieldNameMap["render_configuration"] = "RenderConfiguration" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_key"] = "SortKey" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.column_item", fields, reflect.TypeOf(ColumnItem{}), fieldNameMap, validators) +} + +func CommunicationEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["destination_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_groups"] = "DestinationGroups" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["services"] = "Services" + fields["source_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_groups"] = "SourceGroups" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.communication_entry", fields, reflect.TypeOf(CommunicationEntry{}), fieldNameMap, validators) +} + +func CommunicationMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["communication_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CommunicationEntryBindingType), reflect.TypeOf([]CommunicationEntry{}))) + fieldNameMap["communication_entries"] = "CommunicationEntries" + fields["precedence"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["precedence"] = "Precedence" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.communication_map", fields, reflect.TypeOf(CommunicationMap{}), fieldNameMap, validators) +} + +func CommunityListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["communities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["communities"] = "Communities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.community_list", fields, reflect.TypeOf(CommunityList{}), fieldNameMap, validators) +} + +func CommunityListListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CommunityListBindingType), reflect.TypeOf([]CommunityList{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.community_list_list_result", fields, reflect.TypeOf(CommunityListListResult{}), fieldNameMap, validators) +} + +func CommunityMatchCriteriaBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["criteria"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["criteria"] = "Criteria" + fields["match_operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_operator"] = "MatchOperator" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.community_match_criteria", fields, reflect.TypeOf(CommunityMatchCriteria{}), fieldNameMap, validators) +} + +func ComputeClusterIdfwConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["cluster_idfw_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cluster_idfw_enabled"] = "ClusterIdfwEnabled" + fields["member"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyResourceReferenceBindingType)) + fieldNameMap["member"] = "Member" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.compute_cluster_idfw_configuration", fields, reflect.TypeOf(ComputeClusterIdfwConfiguration{}), fieldNameMap, validators) +} + +func ComputeCollectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["owner_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["owner_id"] = "OwnerId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.compute_collection", fields, reflect.TypeOf(ComputeCollection{}), fieldNameMap, validators) +} + +func ConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["member_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_type"] = "MemberType" + fields["operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operator"] = "Operator" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.condition", fields, reflect.TypeOf(Condition{}), fieldNameMap, validators) +} + +func ConditionalValueConstraintExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operator"] = "Operator" + fields["rhs_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["rhs_value"] = "RhsValue" + fields["value_constraint"] = bindings.NewOptionalType(bindings.NewReferenceType(ValueConstraintExpressionBindingType)) + fieldNameMap["value_constraint"] = "ValueConstraint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.conditional_value_constraint_expression", fields, reflect.TypeOf(ConditionalValueConstraintExpression{}), fieldNameMap, validators) +} + +func ConfigurationStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.configuration_state", fields, reflect.TypeOf(ConfigurationState{}), fieldNameMap, validators) +} + +func ConfigurationStateElementBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["sub_system_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_system_address"] = "SubSystemAddress" + fields["sub_system_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_system_id"] = "SubSystemId" + fields["sub_system_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_system_name"] = "SubSystemName" + fields["sub_system_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_system_type"] = "SubSystemType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.configuration_state_element", fields, reflect.TypeOf(ConfigurationStateElement{}), fieldNameMap, validators) +} + +func ConjunctionOperatorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["conjunction_operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["conjunction_operator"] = "ConjunctionOperator" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.conjunction_operator", fields, reflect.TypeOf(ConjunctionOperator{}), fieldNameMap, validators) +} + +func ConnectivityAdvancedConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connectivity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity"] = "Connectivity" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.connectivity_advanced_config", fields, reflect.TypeOf(ConnectivityAdvancedConfig{}), fieldNameMap, validators) +} + +func ConsolidatedRealizedStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fields["consolidated_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ConsolidatedStatusBindingType)) + fieldNameMap["consolidated_status"] = "ConsolidatedStatus" + fields["consolidated_status_per_enforcement_point"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConsolidatedStatusPerEnforcementPointBindingType), reflect.TypeOf([]ConsolidatedStatusPerEnforcementPoint{}))) + fieldNameMap["consolidated_status_per_enforcement_point"] = "ConsolidatedStatusPerEnforcementPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.consolidated_realized_status", fields, reflect.TypeOf(ConsolidatedRealizedStatus{}), fieldNameMap, validators) +} + +func ConsolidatedStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["consolidated_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["consolidated_status"] = "ConsolidatedStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.consolidated_status", fields, reflect.TypeOf(ConsolidatedStatus{}), fieldNameMap, validators) +} + +func ConsolidatedStatusNsxtBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforced_status"] = bindings.NewOptionalType(bindings.NewReferenceType(EnforcedStatusDetailsNsxtBindingType)) + fieldNameMap["enforced_status"] = "EnforcedStatus" + fields["alarm"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyRuntimeAlarmBindingType)) + fieldNameMap["alarm"] = "Alarm" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["consolidated_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ConsolidatedStatusBindingType)) + fieldNameMap["consolidated_status"] = "ConsolidatedStatus" + fields["enforcement_point_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_id"] = "EnforcementPointId" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.consolidated_status_nsxt", fields, reflect.TypeOf(ConsolidatedStatusNsxt{}), fieldNameMap, validators) +} + +func ConsolidatedStatusPerEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alarm"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyRuntimeAlarmBindingType)) + fieldNameMap["alarm"] = "Alarm" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["consolidated_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ConsolidatedStatusBindingType)) + fieldNameMap["consolidated_status"] = "ConsolidatedStatus" + fields["enforcement_point_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_id"] = "EnforcementPointId" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.consolidated_status_per_enforcement_point", fields, reflect.TypeOf(ConsolidatedStatusPerEnforcementPoint{}), fieldNameMap, validators) +} + +func ConstantFieldValueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["constant"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["constant"] = "Constant" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.constant_field_value", fields, reflect.TypeOf(ConstantFieldValue{}), fieldNameMap, validators) +} + +func ConstraintBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["constraint_expression"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ConstraintExpressionBindingType),}, bindings.REST)) + fieldNameMap["constraint_expression"] = "ConstraintExpression" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + fields["target"] = bindings.NewOptionalType(bindings.NewReferenceType(ConstraintTargetBindingType)) + fieldNameMap["target"] = "Target" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.constraint", fields, reflect.TypeOf(Constraint{}), fieldNameMap, validators) +} + +func ConstraintExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.constraint_expression", fields, reflect.TypeOf(ConstraintExpression{}), fieldNameMap, validators) +} + +func ConstraintListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConstraintBindingType), reflect.TypeOf([]Constraint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.constraint_list_result", fields, reflect.TypeOf(ConstraintListResult{}), fieldNameMap, validators) +} + +func ConstraintTargetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attribute"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute"] = "Attribute" + fields["path_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path_prefix"] = "PathPrefix" + fields["target_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_resource_type"] = "TargetResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.constraint_target", fields, reflect.TypeOf(ConstraintTarget{}), fieldNameMap, validators) +} + +func ContainerApplicationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_project_id"] = "ContainerProjectId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_application", fields, reflect.TypeOf(ContainerApplication{}), fieldNameMap, validators) +} + +func ContainerApplicationInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_node_id"] = "ClusterNodeId" + fields["container_application_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["container_application_ids"] = "ContainerApplicationIds" + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_project_id"] = "ContainerProjectId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_application_instance", fields, reflect.TypeOf(ContainerApplicationInstance{}), fieldNameMap, validators) +} + +func ContainerClusterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_type"] = "ClusterType" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["infrastructure"] = bindings.NewOptionalType(bindings.NewReferenceType(ContainerInfrastructureInfoBindingType)) + fieldNameMap["infrastructure"] = "Infrastructure" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_cluster", fields, reflect.TypeOf(ContainerCluster{}), fieldNameMap, validators) +} + +func ContainerClusterNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_cluster_node", fields, reflect.TypeOf(ContainerClusterNode{}), fieldNameMap, validators) +} + +func ContainerConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header"] = bindings.NewOptionalType(bindings.NewReferenceType(HeaderBindingType)) + fieldNameMap["header"] = "Header" + fields["labels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LabelBindingType), reflect.TypeOf([]Label{}))) + fieldNameMap["labels"] = "Labels" + fields["layout"] = bindings.NewOptionalType(bindings.NewReferenceType(LayoutBindingType)) + fieldNameMap["layout"] = "Layout" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["widgets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetItemBindingType), reflect.TypeOf([]WidgetItem{}))) + fieldNameMap["widgets"] = "Widgets" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_configuration", fields, reflect.TypeOf(ContainerConfiguration{}), fieldNameMap, validators) +} + +func ContainerInfrastructureInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["infra_type"] = "InfraType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_infrastructure_info", fields, reflect.TypeOf(ContainerInfrastructureInfo{}), fieldNameMap, validators) +} + +func ContainerIngressPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_application_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["container_application_ids"] = "ContainerApplicationIds" + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_project_id"] = "ContainerProjectId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["spec"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spec"] = "Spec" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_ingress_policy", fields, reflect.TypeOf(ContainerIngressPolicy{}), fieldNameMap, validators) +} + +func ContainerNetworkPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_project_id"] = "ContainerProjectId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["policy_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy_type"] = "PolicyType" + fields["spec"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spec"] = "Spec" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_network_policy", fields, reflect.TypeOf(ContainerNetworkPolicy{}), fieldNameMap, validators) +} + +func ContainerProjectBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.container_project", fields, reflect.TypeOf(ContainerProject{}), fieldNameMap, validators) +} + +func CriterionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["evaluations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(EvaluationBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["evaluations"] = "Evaluations" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.criterion", fields, reflect.TypeOf(Criterion{}), fieldNameMap, validators) +} + +func CsvListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.csv_list_result", fields, reflect.TypeOf(CsvListResult{}), fieldNameMap, validators) +} + +func CsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.csv_record", fields, reflect.TypeOf(CsvRecord{}), fieldNameMap, validators) +} + +func CurrentBackupOperationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backup_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["backup_id"] = "BackupId" + fields["current_step"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_step"] = "CurrentStep" + fields["current_step_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_step_message"] = "CurrentStepMessage" + fields["end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end_time"] = "EndTime" + fields["operation_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation_type"] = "OperationType" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.current_backup_operation_status", fields, reflect.TypeOf(CurrentBackupOperationStatus{}), fieldNameMap, validators) +} + +func CustomPolicyLbPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["persistence"] = "Persistence" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.custom_policy_lb_persistence_profile", fields, reflect.TypeOf(CustomPolicyLbPersistenceProfile{}), fieldNameMap, validators) +} + +func CustomPolicyLbVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["app_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["app_protocol"] = "AppProtocol" + fields["client_ssl_certificate_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["client_ssl_certificate_ids"] = "ClientSslCertificateIds" + fields["client_ssl_settings"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_ssl_settings"] = "ClientSslSettings" + fields["default_client_ssl_certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_client_ssl_certificate_id"] = "DefaultClientSslCertificateId" + fields["server_auth_ca_certificate_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_auth_ca_certificate_ids"] = "ServerAuthCaCertificateIds" + fields["server_ssl_settings"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_ssl_settings"] = "ServerSslSettings" + fields["insert_client_ip_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["insert_client_ip_header"] = "InsertClientIpHeader" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lb_persistence_profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + fields["ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ports"] = "Ports" + fields["router_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_path"] = "RouterPath" + fields["traffic_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traffic_source"] = "TrafficSource" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.custom_policy_lb_virtual_server", fields, reflect.TypeOf(CustomPolicyLbVirtualServer{}), fieldNameMap, validators) +} + +func CustomWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ui_component_identifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ui_component_identifier"] = "UiComponentIdentifier" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.custom_widget_configuration", fields, reflect.TypeOf(CustomWidgetConfiguration{}), fieldNameMap, validators) +} + +func CvxConnectionInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + fields["enforcement_point_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_address"] = "EnforcementPointAddress" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.cvx_connection_info", fields, reflect.TypeOf(CvxConnectionInfo{}), fieldNameMap, validators) +} + +func DNSForwarderStatisticsPerEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.DNS_forwarder_statistics_per_enforcement_point", fields, reflect.TypeOf(DNSForwarderStatisticsPerEnforcementPoint{}), fieldNameMap, validators) +} + +func DNSForwarderStatusPerEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.DNS_forwarder_status_per_enforcement_point", fields, reflect.TypeOf(DNSForwarderStatusPerEnforcementPoint{}), fieldNameMap, validators) +} + +func DataCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped"] = "Dropped" + fields["multicast_broadcast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["multicast_broadcast"] = "MulticastBroadcast" + fields["total"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total"] = "Total" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.data_counter", fields, reflect.TypeOf(DataCounter{}), fieldNameMap, validators) +} + +func DatasourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["urls"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UrlAliasBindingType), reflect.TypeOf([]UrlAlias{}))) + fieldNameMap["urls"] = "Urls" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.datasource", fields, reflect.TypeOf(Datasource{}), fieldNameMap, validators) +} + +func DefaultFilterValueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.default_filter_value", fields, reflect.TypeOf(DefaultFilterValue{}), fieldNameMap, validators) +} + +func DeleteRequestParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.delete_request_parameters", fields, reflect.TypeOf(DeleteRequestParameters{}), fieldNameMap, validators) +} + +func DeploymentZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enforcement_points"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EnforcementPointBindingType), reflect.TypeOf([]EnforcementPoint{}))) + fieldNameMap["enforcement_points"] = "EnforcementPoints" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.deployment_zone", fields, reflect.TypeOf(DeploymentZone{}), fieldNameMap, validators) +} + +func DfwFirewallConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["idfw_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["idfw_enabled"] = "IdfwEnabled" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["disable_auto_drafts"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disable_auto_drafts"] = "DisableAutoDrafts" + fields["enable_firewall"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_firewall"] = "EnableFirewall" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dfw_firewall_configuration", fields, reflect.TypeOf(DfwFirewallConfiguration{}), fieldNameMap, validators) +} + +func DhcpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["op_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["op_code"] = "OpCode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_header", fields, reflect.TypeOf(DhcpHeader{}), fieldNameMap, validators) +} + +func DhcpIpPoolUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocated_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["allocated_number"] = "AllocatedNumber" + fields["allocated_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["allocated_percentage"] = "AllocatedPercentage" + fields["dhcp_ip_pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_ip_pool_id"] = "DhcpIpPoolId" + fields["pool_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["pool_size"] = "PoolSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_ip_pool_usage", fields, reflect.TypeOf(DhcpIpPoolUsage{}), fieldNameMap, validators) +} + +func DhcpLeasePerIPBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["expire_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["expire_time"] = "ExpireTime" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["start_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start_time"] = "StartTime" + fields["subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet"] = "Subnet" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_lease_per_IP", fields, reflect.TypeOf(DhcpLeasePerIP{}), fieldNameMap, validators) +} + +func DhcpLeasesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_server_id"] = "DhcpServerId" + fields["leases"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpLeasePerIPBindingType), reflect.TypeOf([]DhcpLeasePerIP{}))) + fieldNameMap["leases"] = "Leases" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_leases", fields, reflect.TypeOf(DhcpLeases{}), fieldNameMap, validators) +} + +func DhcpLeasesResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_server_id"] = "DhcpServerId" + fields["leases"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpLeasePerIPBindingType), reflect.TypeOf([]DhcpLeasePerIP{}))) + fieldNameMap["leases"] = "Leases" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["connectivity_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity_path"] = "ConnectivityPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_leases_result", fields, reflect.TypeOf(DhcpLeasesResult{}), fieldNameMap, validators) +} + +func DhcpOption121BindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["static_routes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClasslessStaticRouteBindingType), reflect.TypeOf([]ClasslessStaticRoute{}))) + fieldNameMap["static_routes"] = "StaticRoutes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_option121", fields, reflect.TypeOf(DhcpOption121{}), fieldNameMap, validators) +} + +func DhcpRelayConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["server_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_addresses"] = "ServerAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_relay_config", fields, reflect.TypeOf(DhcpRelayConfig{}), fieldNameMap, validators) +} + +func DhcpRelayConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpRelayConfigBindingType), reflect.TypeOf([]DhcpRelayConfig{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_relay_config_list_result", fields, reflect.TypeOf(DhcpRelayConfigListResult{}), fieldNameMap, validators) +} + +func DhcpServerConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["edge_cluster_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_path"] = "EdgeClusterPath" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["preferred_edge_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["preferred_edge_paths"] = "PreferredEdgePaths" + fields["server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_address"] = "ServerAddress" + fields["server_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_addresses"] = "ServerAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_server_config", fields, reflect.TypeOf(DhcpServerConfig{}), fieldNameMap, validators) +} + +func DhcpServerConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpServerConfigBindingType), reflect.TypeOf([]DhcpServerConfig{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_server_config_list_result", fields, reflect.TypeOf(DhcpServerConfigListResult{}), fieldNameMap, validators) +} + +func DhcpServerStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_server_state", fields, reflect.TypeOf(DhcpServerState{}), fieldNameMap, validators) +} + +func DhcpServerStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["acks"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acks"] = "Acks" + fields["declines"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["declines"] = "Declines" + fields["dhcp_server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_server_id"] = "DhcpServerId" + fields["discovers"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["discovers"] = "Discovers" + fields["errors"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["errors"] = "Errors" + fields["informs"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["informs"] = "Informs" + fields["ip_pool_stats"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpIpPoolUsageBindingType), reflect.TypeOf([]DhcpIpPoolUsage{}))) + fieldNameMap["ip_pool_stats"] = "IpPoolStats" + fields["nacks"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nacks"] = "Nacks" + fields["offers"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["offers"] = "Offers" + fields["releases"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["releases"] = "Releases" + fields["requests"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["requests"] = "Requests" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_server_statistics", fields, reflect.TypeOf(DhcpServerStatistics{}), fieldNameMap, validators) +} + +func DhcpServerStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_node"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["active_node"] = "ActiveNode" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["service_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_status"] = "ServiceStatus" + fields["stand_by_node"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["stand_by_node"] = "StandByNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_server_status", fields, reflect.TypeOf(DhcpServerStatus{}), fieldNameMap, validators) +} + +func DhcpStaticBindingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_static_binding_config", fields, reflect.TypeOf(DhcpStaticBindingConfig{}), fieldNameMap, validators) +} + +func DhcpStaticBindingConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(DhcpStaticBindingConfigBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_static_binding_config_list_result", fields, reflect.TypeOf(DhcpStaticBindingConfigListResult{}), fieldNameMap, validators) +} + +func DhcpStaticBindingStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_static_binding_state", fields, reflect.TypeOf(DhcpStaticBindingState{}), fieldNameMap, validators) +} + +func DhcpStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["acks"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acks"] = "Acks" + fields["declines"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["declines"] = "Declines" + fields["dhcp_server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_server_id"] = "DhcpServerId" + fields["discovers"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["discovers"] = "Discovers" + fields["errors"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["errors"] = "Errors" + fields["informs"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["informs"] = "Informs" + fields["ip_pool_stats"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpIpPoolUsageBindingType), reflect.TypeOf([]DhcpIpPoolUsage{}))) + fieldNameMap["ip_pool_stats"] = "IpPoolStats" + fields["nacks"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nacks"] = "Nacks" + fields["offers"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["offers"] = "Offers" + fields["releases"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["releases"] = "Releases" + fields["requests"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["requests"] = "Requests" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_statistics", fields, reflect.TypeOf(DhcpStatistics{}), fieldNameMap, validators) +} + +func DhcpV4OptionsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["option121"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpOption121BindingType)) + fieldNameMap["option121"] = "Option121" + fields["others"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GenericDhcpOptionBindingType), reflect.TypeOf([]GenericDhcpOption{}))) + fieldNameMap["others"] = "Others" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_v4_options", fields, reflect.TypeOf(DhcpV4Options{}), fieldNameMap, validators) +} + +func DhcpV4StaticBindingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["gateway_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_address"] = "GatewayAddress" + fields["host_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_name"] = "HostName" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["options"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpV4OptionsBindingType)) + fieldNameMap["options"] = "Options" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_v4_static_binding_config", fields, reflect.TypeOf(DhcpV4StaticBindingConfig{}), fieldNameMap, validators) +} + +func DhcpV6OptionsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_v6_options", fields, reflect.TypeOf(DhcpV6Options{}), fieldNameMap, validators) +} + +func DhcpV6StaticBindingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_nameservers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_nameservers"] = "DnsNameservers" + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["preferred_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["preferred_time"] = "PreferredTime" + fields["sntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sntp_servers"] = "SntpServers" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcp_v6_static_binding_config", fields, reflect.TypeOf(DhcpV6StaticBindingConfig{}), fieldNameMap, validators) +} + +func Dhcpv6HeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["msg_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["msg_type"] = "MsgType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dhcpv6_header", fields, reflect.TypeOf(Dhcpv6Header{}), fieldNameMap, validators) +} + +func DiscoveredNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate"] = "Certificate" + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["hardware_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hardware_id"] = "HardwareId" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_type"] = "NodeType" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["os_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_type"] = "OsType" + fields["os_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_version"] = "OsVersion" + fields["parent_compute_collection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_compute_collection"] = "ParentComputeCollection" + fields["stateless"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateless"] = "Stateless" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.discovered_node", fields, reflect.TypeOf(DiscoveredNode{}), fieldNameMap, validators) +} + +func DiscoveredResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.discovered_resource", fields, reflect.TypeOf(DiscoveredResource{}), fieldNameMap, validators) +} + +func DiscoveryProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.discovery_profile_binding_map", fields, reflect.TypeOf(DiscoveryProfileBindingMap{}), fieldNameMap, validators) +} + +func DistributedFloodProtectionProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enable_rst_spoofing"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_rst_spoofing"] = "EnableRstSpoofing" + fields["enable_syncache"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_syncache"] = "EnableSyncache" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["icmp_active_flow_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_active_flow_limit"] = "IcmpActiveFlowLimit" + fields["other_active_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["other_active_conn_limit"] = "OtherActiveConnLimit" + fields["tcp_half_open_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_half_open_conn_limit"] = "TcpHalfOpenConnLimit" + fields["udp_active_flow_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_active_flow_limit"] = "UdpActiveFlowLimit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.distributed_flood_protection_profile", fields, reflect.TypeOf(DistributedFloodProtectionProfile{}), fieldNameMap, validators) +} + +func DistributedVirtualPortgroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backing_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["backing_type"] = "BackingType" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["overall_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_status"] = "OverallStatus" + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.distributed_virtual_portgroup", fields, reflect.TypeOf(DistributedVirtualPortgroup{}), fieldNameMap, validators) +} + +func DistributedVirtualSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["discovered_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredNodeBindingType), reflect.TypeOf([]DiscoveredNode{}))) + fieldNameMap["discovered_nodes"] = "DiscoveredNodes" + fields["lacp_group_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LacpGroupConfigInfoBindingType), reflect.TypeOf([]LacpGroupConfigInfo{}))) + fieldNameMap["lacp_group_configs"] = "LacpGroupConfigs" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["uplink_port_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_port_names"] = "UplinkPortNames" + fields["uplink_portgroup"] = bindings.NewOptionalType(bindings.NewReferenceType(DistributedVirtualPortgroupBindingType)) + fieldNameMap["uplink_portgroup"] = "UplinkPortgroup" + fields["uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uuid"] = "Uuid" + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.distributed_virtual_switch", fields, reflect.TypeOf(DistributedVirtualSwitch{}), fieldNameMap, validators) +} + +func DnsHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["address_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address_type"] = "AddressType" + fields["message_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message_type"] = "MessageType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dns_header", fields, reflect.TypeOf(DnsHeader{}), fieldNameMap, validators) +} + +func DnsSecurityProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ttl"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ttl"] = "Ttl" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dns_security_profile", fields, reflect.TypeOf(DnsSecurityProfile{}), fieldNameMap, validators) +} + +func DnsSecurityProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_path"] = "ProfilePath" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dns_security_profile_binding_map", fields, reflect.TypeOf(DnsSecurityProfileBindingMap{}), fieldNameMap, validators) +} + +func DnsSecurityProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DnsSecurityProfileBindingMapBindingType), reflect.TypeOf([]DnsSecurityProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dns_security_profile_binding_map_list_result", fields, reflect.TypeOf(DnsSecurityProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func DnsSecurityProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DnsSecurityProfileBindingType), reflect.TypeOf([]DnsSecurityProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dns_security_profile_list_result", fields, reflect.TypeOf(DnsSecurityProfileListResult{}), fieldNameMap, validators) +} + +func DomainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.domain", fields, reflect.TypeOf(Domain{}), fieldNameMap, validators) +} + +func DomainDeploymentMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.domain_deployment_map", fields, reflect.TypeOf(DomainDeploymentMap{}), fieldNameMap, validators) +} + +func DomainDeploymentMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DomainDeploymentMapBindingType), reflect.TypeOf([]DomainDeploymentMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.domain_deployment_map_list_result", fields, reflect.TypeOf(DomainDeploymentMapListResult{}), fieldNameMap, validators) +} + +func DomainListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DomainBindingType), reflect.TypeOf([]Domain{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.domain_list_result", fields, reflect.TypeOf(DomainListResult{}), fieldNameMap, validators) +} + +func DonutConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["count"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["count"] = "Count" + fields["display_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["display_count"] = "DisplayCount" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["sections"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DonutSectionBindingType), reflect.TypeOf([]DonutSection{}))) + fieldNameMap["sections"] = "Sections" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.donut_configuration", fields, reflect.TypeOf(DonutConfiguration{}), fieldNameMap, validators) +} + +func DonutPartBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["hide_empty_legend"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["hide_empty_legend"] = "HideEmptyLegend" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["render_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RenderConfigurationBindingType), reflect.TypeOf([]RenderConfiguration{}))) + fieldNameMap["render_configuration"] = "RenderConfiguration" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.donut_part", fields, reflect.TypeOf(DonutPart{}), fieldNameMap, validators) +} + +func DonutSectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["parts"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DonutPartBindingType), reflect.TypeOf([]DonutPart{}))) + fieldNameMap["parts"] = "Parts" + fields["row_list_field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["row_list_field"] = "RowListField" + fields["template"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["template"] = "Template" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.donut_section", fields, reflect.TypeOf(DonutSection{}), fieldNameMap, validators) +} + +func DropdownFilterWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["default_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_value"] = "DefaultValue" + fields["dropdown_item"] = bindings.NewOptionalType(bindings.NewReferenceType(DropdownItemBindingType)) + fieldNameMap["dropdown_item"] = "DropdownItem" + fields["placeholder_msg"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["placeholder_msg"] = "PlaceholderMsg" + fields["static_filter_condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["static_filter_condition"] = "StaticFilterCondition" + fields["static_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StaticFilterBindingType), reflect.TypeOf([]StaticFilter{}))) + fieldNameMap["static_filters"] = "StaticFilters" + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dropdown_filter_widget_configuration", fields, reflect.TypeOf(DropdownFilterWidgetConfiguration{}), fieldNameMap, validators) +} + +func DropdownItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.dropdown_item", fields, reflect.TypeOf(DropdownItem{}), fieldNameMap, validators) +} + +func DuplicateIPDetectionOptionsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["duplicate_ip_detection_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["duplicate_ip_detection_enabled"] = "DuplicateIpDetectionEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.duplicate_IP_detection_options", fields, reflect.TypeOf(DuplicateIPDetectionOptions{}), fieldNameMap, validators) +} + +func EULAAcceptanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["acceptance"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["acceptance"] = "Acceptance" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.EULA_acceptance", fields, reflect.TypeOf(EULAAcceptance{}), fieldNameMap, validators) +} + +func EULAContentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["content"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["content"] = "Content" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.EULA_content", fields, reflect.TypeOf(EULAContent{}), fieldNameMap, validators) +} + +func EdgeConfigurationStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.edge_configuration_state", fields, reflect.TypeOf(EdgeConfigurationState{}), fieldNameMap, validators) +} + +func EgressRateLimiterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["average_bandwidth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["average_bandwidth"] = "AverageBandwidth" + fields["burst_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["burst_size"] = "BurstSize" + fields["peak_bandwidth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["peak_bandwidth"] = "PeakBandwidth" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.egress_rate_limiter", fields, reflect.TypeOf(EgressRateLimiter{}), fieldNameMap, validators) +} + +func EndpointPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["endpoint_rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EndpointRuleBindingType), reflect.TypeOf([]EndpointRule{}))) + fieldNameMap["endpoint_rules"] = "EndpointRules" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.endpoint_policy", fields, reflect.TypeOf(EndpointPolicy{}), fieldNameMap, validators) +} + +func EndpointRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["groups"] = "Groups" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["service_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["service_profiles"] = "ServiceProfiles" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.endpoint_rule", fields, reflect.TypeOf(EndpointRule{}), fieldNameMap, validators) +} + +func EnforcedStatusDetailsNsxtBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforced_status_info"] = bindings.NewOptionalType(bindings.NewReferenceType(EnforcedStatusInfoNsxtBindingType)) + fieldNameMap["enforced_status_info"] = "EnforcedStatusInfo" + fields["pending_changes_info"] = bindings.NewOptionalType(bindings.NewReferenceType(PendingChangesInfoNsxtBindingType)) + fieldNameMap["pending_changes_info"] = "PendingChangesInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.enforced_status_details_nsxt", fields, reflect.TypeOf(EnforcedStatusDetailsNsxt{}), fieldNameMap, validators) +} + +func EnforcedStatusInfoNsxtBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforced_status"] = bindings.NewOptionalType(bindings.NewReferenceType(EnforcedStatusNsxtBindingType)) + fieldNameMap["enforced_status"] = "EnforcedStatus" + fields["enforced_status_per_scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(EnforcedStatusPerScopeNsxtBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["enforced_status_per_scope"] = "EnforcedStatusPerScope" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.enforced_status_info_nsxt", fields, reflect.TypeOf(EnforcedStatusInfoNsxt{}), fieldNameMap, validators) +} + +func EnforcedStatusNsxtBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["status_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status_message"] = "StatusMessage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.enforced_status_nsxt", fields, reflect.TypeOf(EnforcedStatusNsxt{}), fieldNameMap, validators) +} + +func EnforcedStatusPerScopeNsxtBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.enforced_status_per_scope_nsxt", fields, reflect.TypeOf(EnforcedStatusPerScopeNsxt{}), fieldNameMap, validators) +} + +func EnforcedStatusPerTransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["enforced_status"] = bindings.NewOptionalType(bindings.NewReferenceType(EnforcedStatusNsxtBindingType)) + fieldNameMap["enforced_status"] = "EnforcedStatus" + fields["nsx_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsx_id"] = "NsxId" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.enforced_status_per_transport_node", fields, reflect.TypeOf(EnforcedStatusPerTransportNode{}), fieldNameMap, validators) +} + +func EnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["auto_enforce"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["auto_enforce"] = "AutoEnforce" + fields["connection_info"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(EnforcementPointConnectionInfoBindingType),}, bindings.REST)) + fieldNameMap["connection_info"] = "ConnectionInfo" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.enforcement_point", fields, reflect.TypeOf(EnforcementPoint{}), fieldNameMap, validators) +} + +func EnforcementPointConnectionInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_address"] = "EnforcementPointAddress" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.enforcement_point_connection_info", fields, reflect.TypeOf(EnforcementPointConnectionInfo{}), fieldNameMap, validators) +} + +func EnforcementPointListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EnforcementPointBindingType), reflect.TypeOf([]EnforcementPoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.enforcement_point_list_result", fields, reflect.TypeOf(EnforcementPointListResult{}), fieldNameMap, validators) +} + +func EntityInstanceCountConstraintExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["count"] = "Count" + fields["operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operator"] = "Operator" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.entity_instance_count_constraint_expression", fields, reflect.TypeOf(EntityInstanceCountConstraintExpression{}), fieldNameMap, validators) +} + +func ErrorResolverInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_id"] = "ErrorId" + fields["resolver_present"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["resolver_present"] = "ResolverPresent" + fields["user_metadata"] = bindings.NewOptionalType(bindings.NewReferenceType(ErrorResolverUserMetadataBindingType)) + fieldNameMap["user_metadata"] = "UserMetadata" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.error_resolver_info", fields, reflect.TypeOf(ErrorResolverInfo{}), fieldNameMap, validators) +} + +func ErrorResolverInfoListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ErrorResolverInfoBindingType), reflect.TypeOf([]ErrorResolverInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.error_resolver_info_list", fields, reflect.TypeOf(ErrorResolverInfoList{}), fieldNameMap, validators) +} + +func ErrorResolverMetadataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["entity_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_id"] = "EntityId" + fields["error_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_id"] = "ErrorId" + fields["system_metadata"] = bindings.NewOptionalType(bindings.NewReferenceType(ErrorResolverSystemMetadataBindingType)) + fieldNameMap["system_metadata"] = "SystemMetadata" + fields["user_metadata"] = bindings.NewOptionalType(bindings.NewReferenceType(ErrorResolverUserMetadataBindingType)) + fieldNameMap["user_metadata"] = "UserMetadata" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.error_resolver_metadata", fields, reflect.TypeOf(ErrorResolverMetadata{}), fieldNameMap, validators) +} + +func ErrorResolverMetadataListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ErrorResolverMetadataBindingType), reflect.TypeOf([]ErrorResolverMetadata{}))) + fieldNameMap["errors"] = "Errors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.error_resolver_metadata_list", fields, reflect.TypeOf(ErrorResolverMetadataList{}), fieldNameMap, validators) +} + +func ErrorResolverSystemMetadataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.error_resolver_system_metadata", fields, reflect.TypeOf(ErrorResolverSystemMetadata{}), fieldNameMap, validators) +} + +func ErrorResolverUserInputDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["data_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["data_type"] = "DataType" + fields["property_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["property_name"] = "PropertyName" + fields["property_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["property_value"] = "PropertyValue" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.error_resolver_user_input_data", fields, reflect.TypeOf(ErrorResolverUserInputData{}), fieldNameMap, validators) +} + +func ErrorResolverUserMetadataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["user_input_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ErrorResolverUserInputDataBindingType), reflect.TypeOf([]ErrorResolverUserInputData{}))) + fieldNameMap["user_input_list"] = "UserInputList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.error_resolver_user_metadata", fields, reflect.TypeOf(ErrorResolverUserMetadata{}), fieldNameMap, validators) +} + +func EtherTypeServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ether_type"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ether_type"] = "EtherType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ether_type_service_entry", fields, reflect.TypeOf(EtherTypeServiceEntry{}), fieldNameMap, validators) +} + +func EthernetHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_mac"] = "DstMac" + fields["eth_type"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["eth_type"] = "EthType" + fields["src_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_mac"] = "SrcMac" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ethernet_header", fields, reflect.TypeOf(EthernetHeader{}), fieldNameMap, validators) +} + +func EvaluationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.evaluation", fields, reflect.TypeOf(Evaluation{}), fieldNameMap, validators) +} + +func EventBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["criteria"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CriterionBindingType), reflect.TypeOf([]Criterion{}))) + fieldNameMap["criteria"] = "Criteria" + fields["source"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(SourceBindingType),}, bindings.REST)) + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.event", fields, reflect.TypeOf(Event{}), fieldNameMap, validators) +} + +func EvpnConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["encapsulation_method"] = bindings.NewOptionalType(bindings.NewReferenceType(EvpnEncapConfigBindingType)) + fieldNameMap["encapsulation_method"] = "EncapsulationMethod" + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.evpn_config", fields, reflect.TypeOf(EvpnConfig{}), fieldNameMap, validators) +} + +func EvpnEncapConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["vni_pool_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vni_pool_path"] = "VniPoolPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.evpn_encap_config", fields, reflect.TypeOf(EvpnEncapConfig{}), fieldNameMap, validators) +} + +func EvpnTunnelEndpointConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_path"] = "EdgePath" + fields["local_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["local_addresses"] = "LocalAddresses" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.evpn_tunnel_endpoint_config", fields, reflect.TypeOf(EvpnTunnelEndpointConfig{}), fieldNameMap, validators) +} + +func ExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.expression", fields, reflect.TypeOf(Expression{}), fieldNameMap, validators) +} + +func ExternalIDExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["external_ids"] = "ExternalIds" + fields["member_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_type"] = "MemberType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.external_ID_expression", fields, reflect.TypeOf(ExternalIDExpression{}), fieldNameMap, validators) +} + +func FIPSGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_fips_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["lb_fips_enabled"] = "LbFipsEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.FIPS_global_config", fields, reflect.TypeOf(FIPSGlobalConfig{}), fieldNameMap, validators) +} + +func FeaturePermissionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["feature"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature"] = "Feature" + fields["feature_description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature_description"] = "FeatureDescription" + fields["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature_name"] = "FeatureName" + fields["is_execute_recommended"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_execute_recommended"] = "IsExecuteRecommended" + fields["is_internal"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_internal"] = "IsInternal" + fields["permission"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["permission"] = "Permission" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.feature_permission", fields, reflect.TypeOf(FeaturePermission{}), fieldNameMap, validators) +} + +func FederationComponentUpgradeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["current_version_node_summary"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FederationNodeSummaryBindingType), reflect.TypeOf([]FederationNodeSummary{}))) + fieldNameMap["current_version_node_summary"] = "CurrentVersionNodeSummary" + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["target_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_version"] = "TargetVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.federation_component_upgrade_status", fields, reflect.TypeOf(FederationComponentUpgradeStatus{}), fieldNameMap, validators) +} + +func FederationConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_config"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SiteFederationConfigBindingType), reflect.TypeOf([]SiteFederationConfig{}))) + fieldNameMap["site_config"] = "SiteConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.federation_config", fields, reflect.TypeOf(FederationConfig{}), fieldNameMap, validators) +} + +func FederationConnectivityConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_overlay_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["global_overlay_id"] = "GlobalOverlayId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.federation_connectivity_config", fields, reflect.TypeOf(FederationConnectivityConfig{}), fieldNameMap, validators) +} + +func FederationGatewayConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_overlay_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["global_overlay_id"] = "GlobalOverlayId" + fields["site_allocation_indices"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SiteAllocationIndexForEdgeBindingType), reflect.TypeOf([]SiteAllocationIndexForEdge{}))) + fieldNameMap["site_allocation_indices"] = "SiteAllocationIndices" + fields["transit_segment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transit_segment_id"] = "TransitSegmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.federation_gateway_config", fields, reflect.TypeOf(FederationGatewayConfig{}), fieldNameMap, validators) +} + +func FederationNodeSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["node_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count"] = "NodeCount" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.federation_node_summary", fields, reflect.TypeOf(FederationNodeSummary{}), fieldNameMap, validators) +} + +func FederationUpgradeSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FederationComponentUpgradeStatusBindingType), reflect.TypeOf([]FederationComponentUpgradeStatus{}))) + fieldNameMap["component_status"] = "ComponentStatus" + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_version"] = "CurrentVersion" + fields["gpm_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gpm_name"] = "GpmName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["last_upgrade_timestamp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["last_upgrade_timestamp"] = "LastUpgradeTimestamp" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["overall_upgrade_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_upgrade_status"] = "OverallUpgradeStatus" + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + fields["site_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_ip"] = "SiteIp" + fields["site_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_type"] = "SiteType" + fields["target_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_version"] = "TargetVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.federation_upgrade_summary", fields, reflect.TypeOf(FederationUpgradeSummary{}), fieldNameMap, validators) +} + +func FederationUpgradeSummaryListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FederationUpgradeSummaryBindingType), reflect.TypeOf([]FederationUpgradeSummary{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.federation_upgrade_summary_list_result", fields, reflect.TypeOf(FederationUpgradeSummaryListResult{}), fieldNameMap, validators) +} + +func FieldSanityConstraintExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["checks"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["checks"] = "Checks" + fields["operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operator"] = "Operator" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.field_sanity_constraint_expression", fields, reflect.TypeOf(FieldSanityConstraintExpression{}), fieldNameMap, validators) +} + +func FieldSettingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["field_pointer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field_pointer"] = "FieldPointer" + fields["value"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(FieldSettingValueBindingType),}, bindings.REST)) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.field_setting", fields, reflect.TypeOf(FieldSetting{}), fieldNameMap, validators) +} + +func FieldSettingValueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.field_setting_value", fields, reflect.TypeOf(FieldSettingValue{}), fieldNameMap, validators) +} + +func FieldsPacketDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["arp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(ArpHeaderBindingType)) + fieldNameMap["arp_header"] = "ArpHeader" + fields["eth_header"] = bindings.NewOptionalType(bindings.NewReferenceType(EthernetHeaderBindingType)) + fieldNameMap["eth_header"] = "EthHeader" + fields["ip_header"] = bindings.NewOptionalType(bindings.NewReferenceType(Ipv4HeaderBindingType)) + fieldNameMap["ip_header"] = "IpHeader" + fields["ipv6_header"] = bindings.NewOptionalType(bindings.NewReferenceType(Ipv6HeaderBindingType)) + fieldNameMap["ipv6_header"] = "Ipv6Header" + fields["payload"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["payload"] = "Payload" + fields["transport_header"] = bindings.NewOptionalType(bindings.NewReferenceType(TransportProtocolHeaderBindingType)) + fieldNameMap["transport_header"] = "TransportHeader" + fields["frame_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["frame_size"] = "FrameSize" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["routed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["routed"] = "Routed" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.fields_packet_data", fields, reflect.TypeOf(FieldsPacketData{}), fieldNameMap, validators) +} + +func FileTransferAuthenticationSchemeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["scheme_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme_name"] = "SchemeName" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.file_transfer_authentication_scheme", fields, reflect.TypeOf(FileTransferAuthenticationScheme{}), fieldNameMap, validators) +} + +func FileTransferProtocolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(FileTransferAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["protocol_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol_name"] = "ProtocolName" + fields["ssh_fingerprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssh_fingerprint"] = "SshFingerprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.file_transfer_protocol", fields, reflect.TypeOf(FileTransferProtocol{}), fieldNameMap, validators) +} + +func FilterWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.filter_widget_configuration", fields, reflect.TypeOf(FilterWidgetConfiguration{}), fieldNameMap, validators) +} + +func FirewallConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["disable_auto_drafts"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disable_auto_drafts"] = "DisableAutoDrafts" + fields["enable_firewall"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_firewall"] = "EnableFirewall" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.firewall_configuration", fields, reflect.TypeOf(FirewallConfiguration{}), fieldNameMap, validators) +} + +func FirewallIdentityStoreBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["base_distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["base_distinguished_name"] = "BaseDistinguishedName" + fields["ldap_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallIdentityStoreLdapServerBindingType), reflect.TypeOf([]FirewallIdentityStoreLdapServer{}))) + fieldNameMap["ldap_servers"] = "LdapServers" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["netbios_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["netbios_name"] = "NetbiosName" + fields["selective_sync_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(FirewallIdentityStoreSelectiveSyncSettingsBindingType)) + fieldNameMap["selective_sync_settings"] = "SelectiveSyncSettings" + fields["sync_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(FirewallIdentityStoreSyncSettingsBindingType)) + fieldNameMap["sync_settings"] = "SyncSettings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.firewall_identity_store", fields, reflect.TypeOf(FirewallIdentityStore{}), fieldNameMap, validators) +} + +func FirewallIdentityStoreLdapServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host"] = "Host" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.firewall_identity_store_ldap_server", fields, reflect.TypeOf(FirewallIdentityStoreLdapServer{}), fieldNameMap, validators) +} + +func FirewallIdentityStoreSelectiveSyncSettingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["selected_org_units"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["selected_org_units"] = "SelectedOrgUnits" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.firewall_identity_store_selective_sync_settings", fields, reflect.TypeOf(FirewallIdentityStoreSelectiveSyncSettings{}), fieldNameMap, validators) +} + +func FirewallIdentityStoreSyncSettingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["delta_sync_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["delta_sync_interval"] = "DeltaSyncInterval" + fields["full_sync_cron_expr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["full_sync_cron_expr"] = "FullSyncCronExpr" + fields["sync_delay_in_sec"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sync_delay_in_sec"] = "SyncDelayInSec" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.firewall_identity_store_sync_settings", fields, reflect.TypeOf(FirewallIdentityStoreSyncSettings{}), fieldNameMap, validators) +} + +func FloodProtectionProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["icmp_active_flow_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_active_flow_limit"] = "IcmpActiveFlowLimit" + fields["other_active_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["other_active_conn_limit"] = "OtherActiveConnLimit" + fields["tcp_half_open_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_half_open_conn_limit"] = "TcpHalfOpenConnLimit" + fields["udp_active_flow_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_active_flow_limit"] = "UdpActiveFlowLimit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.flood_protection_profile", fields, reflect.TypeOf(FloodProtectionProfile{}), fieldNameMap, validators) +} + +func FloodProtectionProfileBindingListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FloodProtectionProfileBindingMapBindingType), reflect.TypeOf([]FloodProtectionProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.flood_protection_profile_binding_list_result", fields, reflect.TypeOf(FloodProtectionProfileBindingListResult{}), fieldNameMap, validators) +} + +func FloodProtectionProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_path"] = "ProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.flood_protection_profile_binding_map", fields, reflect.TypeOf(FloodProtectionProfileBindingMap{}), fieldNameMap, validators) +} + +func FloodProtectionProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(FloodProtectionProfileBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.flood_protection_profile_list_result", fields, reflect.TypeOf(FloodProtectionProfileListResult{}), fieldNameMap, validators) +} + +func FooterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FooterActionBindingType), reflect.TypeOf([]FooterAction{}))) + fieldNameMap["actions"] = "Actions" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.footer", fields, reflect.TypeOf(Footer{}), fieldNameMap, validators) +} + +func FooterActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dock_to_container_footer"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dock_to_container_footer"] = "DockToContainerFooter" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.footer_action", fields, reflect.TypeOf(FooterAction{}), fieldNameMap, validators) +} + +func ForwardingPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["internal_sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["internal_sequence_number"] = "InternalSequenceNumber" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["scheduler_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheduler_path"] = "SchedulerPath" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ForwardingRuleBindingType), reflect.TypeOf([]ForwardingRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.forwarding_policy", fields, reflect.TypeOf(ForwardingPolicy{}), fieldNameMap, validators) +} + +func ForwardingPolicyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ForwardingPolicyBindingType), reflect.TypeOf([]ForwardingPolicy{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.forwarding_policy_list_result", fields, reflect.TypeOf(ForwardingPolicyListResult{}), fieldNameMap, validators) +} + +func ForwardingRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["destination_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_groups"] = "DestinationGroups" + fields["destinations_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destinations_excluded"] = "DestinationsExcluded" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["profiles"] = "Profiles" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_id"] = "RuleId" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["service_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["service_entries"] = "ServiceEntries" + fields["services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["services"] = "Services" + fields["source_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_groups"] = "SourceGroups" + fields["sources_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sources_excluded"] = "SourcesExcluded" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.forwarding_rule", fields, reflect.TypeOf(ForwardingRule{}), fieldNameMap, validators) +} + +func ForwardingRuleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ForwardingRuleBindingType), reflect.TypeOf([]ForwardingRule{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.forwarding_rule_list_result", fields, reflect.TypeOf(ForwardingRuleListResult{}), fieldNameMap, validators) +} + +func FullSyncStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["errors"] = "Errors" + fields["full_sync_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["full_sync_id"] = "FullSyncId" + fields["last_completed_stage"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["last_completed_stage"] = "LastCompletedStage" + fields["last_upate_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_upate_time"] = "LastUpateTime" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.full_sync_state", fields, reflect.TypeOf(FullSyncState{}), fieldNameMap, validators) +} + +func FullSyncStateListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FullSyncStateBindingType), reflect.TypeOf([]FullSyncState{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.full_sync_state_list_result", fields, reflect.TypeOf(FullSyncStateListResult{}), fieldNameMap, validators) +} + +func GatewayFloodProtectionProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["icmp_active_flow_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_active_flow_limit"] = "IcmpActiveFlowLimit" + fields["other_active_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["other_active_conn_limit"] = "OtherActiveConnLimit" + fields["tcp_half_open_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_half_open_conn_limit"] = "TcpHalfOpenConnLimit" + fields["udp_active_flow_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_active_flow_limit"] = "UdpActiveFlowLimit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gateway_flood_protection_profile", fields, reflect.TypeOf(GatewayFloodProtectionProfile{}), fieldNameMap, validators) +} + +func GatewayPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["internal_sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["internal_sequence_number"] = "InternalSequenceNumber" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["scheduler_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheduler_path"] = "SchedulerPath" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RuleBindingType), reflect.TypeOf([]Rule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gateway_policy", fields, reflect.TypeOf(GatewayPolicy{}), fieldNameMap, validators) +} + +func GatewayPolicyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GatewayPolicyBindingType), reflect.TypeOf([]GatewayPolicy{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gateway_policy_list_result", fields, reflect.TypeOf(GatewayPolicyListResult{}), fieldNameMap, validators) +} + +func GatewayQosProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["burst_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["burst_size"] = "BurstSize" + fields["committed_bandwitdth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["committed_bandwitdth"] = "CommittedBandwitdth" + fields["excess_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["excess_action"] = "ExcessAction" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gateway_qos_profile", fields, reflect.TypeOf(GatewayQosProfile{}), fieldNameMap, validators) +} + +func GatewayQosProfileConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["egress_qos_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["egress_qos_profile_path"] = "EgressQosProfilePath" + fields["ingress_qos_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ingress_qos_profile_path"] = "IngressQosProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gateway_qos_profile_config", fields, reflect.TypeOf(GatewayQosProfileConfig{}), fieldNameMap, validators) +} + +func GatewayQosProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GatewayQosProfileBindingType), reflect.TypeOf([]GatewayQosProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gateway_qos_profile_list_result", fields, reflect.TypeOf(GatewayQosProfileListResult{}), fieldNameMap, validators) +} + +func GatewayRouteCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_distance"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["admin_distance"] = "AdminDistance" + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_path"] = "EdgePath" + fields["interface"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface"] = "_Interface" + fields["lr_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_id"] = "LrComponentId" + fields["lr_component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_type"] = "LrComponentType" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["route_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_type"] = "RouteType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gateway_route_csv_record", fields, reflect.TypeOf(GatewayRouteCsvRecord{}), fieldNameMap, validators) +} + +func GatewayRouteTableInCsvFormatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GatewayRouteCsvRecordBindingType), reflect.TypeOf([]GatewayRouteCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gateway_route_table_in_csv_format", fields, reflect.TypeOf(GatewayRouteTableInCsvFormat{}), fieldNameMap, validators) +} + +func GenericDhcpOptionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["code"] = "Code" + fields["values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["values"] = "Values" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.generic_dhcp_option", fields, reflect.TypeOf(GenericDhcpOption{}), fieldNameMap, validators) +} + +func GenericPolicyRealizedResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["alarms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyAlarmResourceBindingType), reflect.TypeOf([]PolicyAlarmResource{}))) + fieldNameMap["alarms"] = "Alarms" + fields["intent_reference"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["intent_reference"] = "IntentReference" + fields["realization_api"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["realization_api"] = "RealizationApi" + fields["realization_specific_identifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["realization_specific_identifier"] = "RealizationSpecificIdentifier" + fields["runtime_error"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_error"] = "RuntimeError" + fields["runtime_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_status"] = "RuntimeStatus" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_type"] = "EntityType" + fields["extended_attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AttributeValBindingType), reflect.TypeOf([]AttributeVal{}))) + fieldNameMap["extended_attributes"] = "ExtendedAttributes" + fields["intent_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["intent_paths"] = "IntentPaths" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.generic_policy_realized_resource", fields, reflect.TypeOf(GenericPolicyRealizedResource{}), fieldNameMap, validators) +} + +func GenericPolicyRealizedResourceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GenericPolicyRealizedResourceBindingType), reflect.TypeOf([]GenericPolicyRealizedResource{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.generic_policy_realized_resource_list_result", fields, reflect.TypeOf(GenericPolicyRealizedResourceListResult{}), fieldNameMap, validators) +} + +func GlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["fips"] = bindings.NewOptionalType(bindings.NewReferenceType(FIPSGlobalConfigBindingType)) + fieldNameMap["fips"] = "Fips" + fields["l3_forwarding_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["l3_forwarding_mode"] = "L3ForwardingMode" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.global_config", fields, reflect.TypeOf(GlobalConfig{}), fieldNameMap, validators) +} + +func GlobalManagerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["connection_info"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SiteNodeConnectionInfoBindingType), reflect.TypeOf([]SiteNodeConnectionInfo{}))) + fieldNameMap["connection_info"] = "ConnectionInfo" + fields["fail_if_rtt_exceeded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["fail_if_rtt_exceeded"] = "FailIfRttExceeded" + fields["federation_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_id"] = "FederationId" + fields["maximum_rtt"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["maximum_rtt"] = "MaximumRtt" + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.global_manager", fields, reflect.TypeOf(GlobalManager{}), fieldNameMap, validators) +} + +func GlobalManagerConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["rtep_config"] = bindings.NewOptionalType(bindings.NewReferenceType(GmRtepConfigBindingType)) + fieldNameMap["rtep_config"] = "RtepConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.global_manager_config", fields, reflect.TypeOf(GlobalManagerConfig{}), fieldNameMap, validators) +} + +func GlobalManagerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GlobalManagerBindingType), reflect.TypeOf([]GlobalManager{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.global_manager_list_result", fields, reflect.TypeOf(GlobalManagerListResult{}), fieldNameMap, validators) +} + +func GlobalRestoreStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.global_restore_status", fields, reflect.TypeOf(GlobalRestoreStatus{}), fieldNameMap, validators) +} + +func GmFederationSiteConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transit_subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transit_subnet"] = "TransitSubnet" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gm_federation_site_config", fields, reflect.TypeOf(GmFederationSiteConfig{}), fieldNameMap, validators) +} + +func GmRtepConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ibgp_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ibgp_password"] = "IbgpPassword" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.gm_rtep_config", fields, reflect.TypeOf(GmRtepConfig{}), fieldNameMap, validators) +} + +func GraphConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["axes"] = bindings.NewOptionalType(bindings.NewReferenceType(AxesBindingType)) + fieldNameMap["axes"] = "Axes" + fields["display_x_value"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["display_x_value"] = "DisplayxValue" + fields["graphs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GraphDefinitionBindingType), reflect.TypeOf([]GraphDefinition{}))) + fieldNameMap["graphs"] = "Graphs" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_type"] = "SubType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.graph_configuration", fields, reflect.TypeOf(GraphConfiguration{}), fieldNameMap, validators) +} + +func GraphDefinitionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["point_definition"] = bindings.NewOptionalType(bindings.NewReferenceType(PointDefinitionBindingType)) + fieldNameMap["point_definition"] = "PointDefinition" + fields["render_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RenderConfigurationBindingType), reflect.TypeOf([]RenderConfiguration{}))) + fieldNameMap["render_configuration"] = "RenderConfiguration" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.graph_definition", fields, reflect.TypeOf(GraphDefinition{}), fieldNameMap, validators) +} + +func GridConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["columns"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ColumnItemBindingType), reflect.TypeOf([]ColumnItem{}))) + fieldNameMap["columns"] = "Columns" + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["page_size"] = "PageSize" + fields["row_list_fields"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RowListFieldBindingType), reflect.TypeOf([]RowListField{}))) + fieldNameMap["row_list_fields"] = "RowListFields" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.grid_configuration", fields, reflect.TypeOf(GridConfiguration{}), fieldNameMap, validators) +} + +func GroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["expression"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ExpressionBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["expression"] = "Expression" + fields["extended_expression"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ExpressionBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["extended_expression"] = "ExtendedExpression" + fields["reference"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["reference"] = "Reference" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group", fields, reflect.TypeOf(Group{}), fieldNameMap, validators) +} + +func GroupDiscoveryProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_path"] = "ProfilePath" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group_discovery_profile_binding_map", fields, reflect.TypeOf(GroupDiscoveryProfileBindingMap{}), fieldNameMap, validators) +} + +func GroupListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GroupBindingType), reflect.TypeOf([]Group{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group_list_result", fields, reflect.TypeOf(GroupListResult{}), fieldNameMap, validators) +} + +func GroupMemberListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group_member_list", fields, reflect.TypeOf(GroupMemberList{}), fieldNameMap, validators) +} + +func GroupMemberTagsListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["member_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_type"] = "MemberType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group_member_tags_list", fields, reflect.TypeOf(GroupMemberTagsList{}), fieldNameMap, validators) +} + +func GroupMemberTypeListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group_member_type_list_result", fields, reflect.TypeOf(GroupMemberTypeListResult{}), fieldNameMap, validators) +} + +func GroupMonitoringProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ipfix_dfw_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipfix_dfw_profile_path"] = "IpfixDfwProfilePath" + fields["ipfix_l2_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipfix_l2_profile_path"] = "IpfixL2ProfilePath" + fields["port_mirroring_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port_mirroring_profile_path"] = "PortMirroringProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group_monitoring_profile_binding_map", fields, reflect.TypeOf(GroupMonitoringProfileBindingMap{}), fieldNameMap, validators) +} + +func GroupMonitoringProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GroupMonitoringProfileBindingMapBindingType), reflect.TypeOf([]GroupMonitoringProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group_monitoring_profile_binding_map_list_result", fields, reflect.TypeOf(GroupMonitoringProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func GroupTagsListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GroupMemberTagsListBindingType), reflect.TypeOf([]GroupMemberTagsList{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.group_tags_list", fields, reflect.TypeOf(GroupTagsList{}), fieldNameMap, validators) +} + +func GuestInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["computer_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["computer_name"] = "ComputerName" + fields["os_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_name"] = "OsName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.guest_info", fields, reflect.TypeOf(GuestInfo{}), fieldNameMap, validators) +} + +func HeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["content_alignment"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["content_alignment"] = "ContentAlignment" + fields["sub_headers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PropertyItemBindingType), reflect.TypeOf([]PropertyItem{}))) + fieldNameMap["sub_headers"] = "SubHeaders" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.header", fields, reflect.TypeOf(Header{}), fieldNameMap, validators) +} + +func HttpPolicyLbMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.http_policy_lb_monitor_profile", fields, reflect.TypeOf(HttpPolicyLbMonitorProfile{}), fieldNameMap, validators) +} + +func HttpPolicyLbVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["insert_client_ip_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["insert_client_ip_header"] = "InsertClientIpHeader" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lb_persistence_profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + fields["ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ports"] = "Ports" + fields["router_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_path"] = "RouterPath" + fields["traffic_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traffic_source"] = "TrafficSource" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.http_policy_lb_virtual_server", fields, reflect.TypeOf(HttpPolicyLbVirtualServer{}), fieldNameMap, validators) +} + +func HttpsPolicyLbMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.https_policy_lb_monitor_profile", fields, reflect.TypeOf(HttpsPolicyLbMonitorProfile{}), fieldNameMap, validators) +} + +func HttpsPolicyLbVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_ssl_certificate_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["client_ssl_certificate_ids"] = "ClientSslCertificateIds" + fields["client_ssl_settings"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_ssl_settings"] = "ClientSslSettings" + fields["default_client_ssl_certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_client_ssl_certificate_id"] = "DefaultClientSslCertificateId" + fields["insert_client_ip_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["insert_client_ip_header"] = "InsertClientIpHeader" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lb_persistence_profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + fields["ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ports"] = "Ports" + fields["router_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_path"] = "RouterPath" + fields["traffic_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traffic_source"] = "TrafficSource" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.https_policy_lb_virtual_server", fields, reflect.TypeOf(HttpsPolicyLbVirtualServer{}), fieldNameMap, validators) +} + +func ICMPTypeServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["icmp_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_code"] = "IcmpCode" + fields["icmp_type"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_type"] = "IcmpType" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ICMP_type_service_entry", fields, reflect.TypeOf(ICMPTypeServiceEntry{}), fieldNameMap, validators) +} + +func IGMPTypeServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IGMP_type_service_entry", fields, reflect.TypeOf(IGMPTypeServiceEntry{}), fieldNameMap, validators) +} + +func IPAddressExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_address_expression", fields, reflect.TypeOf(IPAddressExpression{}), fieldNameMap, validators) +} + +func IPAddressListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_address_list", fields, reflect.TypeOf(IPAddressList{}), fieldNameMap, validators) +} + +func IPAddressPortPairBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_address_port_pair", fields, reflect.TypeOf(IPAddressPortPair{}), fieldNameMap, validators) +} + +func IPDiscoveryProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["arp_nd_binding_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["arp_nd_binding_timeout"] = "ArpNdBindingTimeout" + fields["duplicate_ip_detection"] = bindings.NewOptionalType(bindings.NewReferenceType(DuplicateIPDetectionOptionsBindingType)) + fieldNameMap["duplicate_ip_detection"] = "DuplicateIpDetection" + fields["ip_v4_discovery_options"] = bindings.NewOptionalType(bindings.NewReferenceType(IPv4DiscoveryOptionsBindingType)) + fieldNameMap["ip_v4_discovery_options"] = "IpV4DiscoveryOptions" + fields["ip_v6_discovery_options"] = bindings.NewOptionalType(bindings.NewReferenceType(IPv6DiscoveryOptionsBindingType)) + fieldNameMap["ip_v6_discovery_options"] = "IpV6DiscoveryOptions" + fields["tofu_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tofu_enabled"] = "TofuEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_discovery_profile", fields, reflect.TypeOf(IPDiscoveryProfile{}), fieldNameMap, validators) +} + +func IPDiscoveryProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPDiscoveryProfileBindingType), reflect.TypeOf([]IPDiscoveryProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_discovery_profile_list_result", fields, reflect.TypeOf(IPDiscoveryProfileListResult{}), fieldNameMap, validators) +} + +func IPFIXDFWCollectorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["collector_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["collector_ip_address"] = "CollectorIpAddress" + fields["collector_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["collector_port"] = "CollectorPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIXDFW_collector", fields, reflect.TypeOf(IPFIXDFWCollector{}), fieldNameMap, validators) +} + +func IPFIXDFWCollectorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ipfix_dfw_collectors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPFIXDFWCollectorBindingType), reflect.TypeOf([]IPFIXDFWCollector{}))) + fieldNameMap["ipfix_dfw_collectors"] = "IpfixDfwCollectors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIXDFW_collector_profile", fields, reflect.TypeOf(IPFIXDFWCollectorProfile{}), fieldNameMap, validators) +} + +func IPFIXDFWCollectorProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPFIXDFWCollectorProfileBindingType), reflect.TypeOf([]IPFIXDFWCollectorProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIXDFW_collector_profile_list_result", fields, reflect.TypeOf(IPFIXDFWCollectorProfileListResult{}), fieldNameMap, validators) +} + +func IPFIXDFWProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["active_flow_export_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_flow_export_timeout"] = "ActiveFlowExportTimeout" + fields["ipfix_dfw_collector_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipfix_dfw_collector_profile_path"] = "IpfixDfwCollectorProfilePath" + fields["observation_domain_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["observation_domain_id"] = "ObservationDomainId" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIXDFW_profile", fields, reflect.TypeOf(IPFIXDFWProfile{}), fieldNameMap, validators) +} + +func IPFIXDFWProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPFIXDFWProfileBindingType), reflect.TypeOf([]IPFIXDFWProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIXDFW_profile_list_result", fields, reflect.TypeOf(IPFIXDFWProfileListResult{}), fieldNameMap, validators) +} + +func IPFIXL2CollectorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["collector_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["collector_ip_address"] = "CollectorIpAddress" + fields["collector_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["collector_port"] = "CollectorPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIX_l2_collector", fields, reflect.TypeOf(IPFIXL2Collector{}), fieldNameMap, validators) +} + +func IPFIXL2CollectorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ipfix_l2_collectors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPFIXL2CollectorBindingType), reflect.TypeOf([]IPFIXL2Collector{}))) + fieldNameMap["ipfix_l2_collectors"] = "IpfixL2Collectors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIX_l2_collector_profile", fields, reflect.TypeOf(IPFIXL2CollectorProfile{}), fieldNameMap, validators) +} + +func IPFIXL2CollectorProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPFIXL2CollectorProfileBindingType), reflect.TypeOf([]IPFIXL2CollectorProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIX_l2_collector_profile_list_result", fields, reflect.TypeOf(IPFIXL2CollectorProfileListResult{}), fieldNameMap, validators) +} + +func IPFIXL2ProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["active_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_timeout"] = "ActiveTimeout" + fields["export_overlay_flow"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["export_overlay_flow"] = "ExportOverlayFlow" + fields["idle_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["idle_timeout"] = "IdleTimeout" + fields["ipfix_collector_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipfix_collector_profile_path"] = "IpfixCollectorProfilePath" + fields["max_flows"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_flows"] = "MaxFlows" + fields["observation_domain_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["observation_domain_id"] = "ObservationDomainId" + fields["packet_sample_probability"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["packet_sample_probability"] = "PacketSampleProbability" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIX_l2_profile", fields, reflect.TypeOf(IPFIXL2Profile{}), fieldNameMap, validators) +} + +func IPFIXL2ProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPFIXL2ProfileBindingType), reflect.TypeOf([]IPFIXL2Profile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IPFIX_l2_profile_list_result", fields, reflect.TypeOf(IPFIXL2ProfileListResult{}), fieldNameMap, validators) +} + +func IPInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_info", fields, reflect.TypeOf(IPInfo{}), fieldNameMap, validators) +} + +func IPProtocolServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["protocol_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["protocol_number"] = "ProtocolNumber" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_protocol_service_entry", fields, reflect.TypeOf(IPProtocolServiceEntry{}), fieldNameMap, validators) +} + +func IPSecVpnDpdProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["dpd_probe_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dpd_probe_interval"] = "DpdProbeInterval" + fields["dpd_probe_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dpd_probe_mode"] = "DpdProbeMode" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["retry_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["retry_count"] = "RetryCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_dpd_profile", fields, reflect.TypeOf(IPSecVpnDpdProfile{}), fieldNameMap, validators) +} + +func IPSecVpnIkeProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["dh_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dh_groups"] = "DhGroups" + fields["digest_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["digest_algorithms"] = "DigestAlgorithms" + fields["encryption_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["encryption_algorithms"] = "EncryptionAlgorithms" + fields["ike_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_version"] = "IkeVersion" + fields["sa_life_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sa_life_time"] = "SaLifeTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_ike_profile", fields, reflect.TypeOf(IPSecVpnIkeProfile{}), fieldNameMap, validators) +} + +func IPSecVpnLocalEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["certificate_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_path"] = "CertificatePath" + fields["local_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_address"] = "LocalAddress" + fields["local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_id"] = "LocalId" + fields["trust_ca_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["trust_ca_paths"] = "TrustCaPaths" + fields["trust_crl_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["trust_crl_paths"] = "TrustCrlPaths" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_local_endpoint", fields, reflect.TypeOf(IPSecVpnLocalEndpoint{}), fieldNameMap, validators) +} + +func IPSecVpnRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["destinations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVpnSubnetBindingType), reflect.TypeOf([]IPSecVpnSubnet{}))) + fieldNameMap["destinations"] = "Destinations" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVpnSubnetBindingType), reflect.TypeOf([]IPSecVpnSubnet{}))) + fieldNameMap["sources"] = "Sources" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_rule", fields, reflect.TypeOf(IPSecVpnRule{}), fieldNameMap, validators) +} + +func IPSecVpnServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["bypass_rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVpnRuleBindingType), reflect.TypeOf([]IPSecVpnRule{}))) + fieldNameMap["bypass_rules"] = "BypassRules" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ha_sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ha_sync"] = "HaSync" + fields["ike_log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_log_level"] = "IkeLogLevel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_service", fields, reflect.TypeOf(IPSecVpnService{}), fieldNameMap, validators) +} + +func IPSecVpnSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["authentication_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["authentication_mode"] = "AuthenticationMode" + fields["compliance_suite"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compliance_suite"] = "ComplianceSuite" + fields["connection_initiation_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_initiation_mode"] = "ConnectionInitiationMode" + fields["dpd_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dpd_profile_path"] = "DpdProfilePath" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ike_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_profile_path"] = "IkeProfilePath" + fields["local_endpoint_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_endpoint_path"] = "LocalEndpointPath" + fields["peer_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_address"] = "PeerAddress" + fields["peer_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_id"] = "PeerId" + fields["psk"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["psk"] = "Psk" + fields["tcp_mss_clamping"] = bindings.NewOptionalType(bindings.NewReferenceType(TcpMaximumSegmentSizeClampingBindingType)) + fieldNameMap["tcp_mss_clamping"] = "TcpMssClamping" + fields["tunnel_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_profile_path"] = "TunnelProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_session", fields, reflect.TypeOf(IPSecVpnSession{}), fieldNameMap, validators) +} + +func IPSecVpnSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet"] = "Subnet" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_subnet", fields, reflect.TypeOf(IPSecVpnSubnet{}), fieldNameMap, validators) +} + +func IPSecVpnTunnelInterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ip_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TunnelInterfaceIPSubnetBindingType), reflect.TypeOf([]TunnelInterfaceIPSubnet{}))) + fieldNameMap["ip_subnets"] = "IpSubnets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_tunnel_interface", fields, reflect.TypeOf(IPSecVpnTunnelInterface{}), fieldNameMap, validators) +} + +func IPSecVpnTunnelProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["df_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["df_policy"] = "DfPolicy" + fields["dh_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dh_groups"] = "DhGroups" + fields["digest_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["digest_algorithms"] = "DigestAlgorithms" + fields["enable_perfect_forward_secrecy"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_perfect_forward_secrecy"] = "EnablePerfectForwardSecrecy" + fields["encryption_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["encryption_algorithms"] = "EncryptionAlgorithms" + fields["extended_attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AttributeValBindingType), reflect.TypeOf([]AttributeVal{}))) + fieldNameMap["extended_attributes"] = "ExtendedAttributes" + fields["sa_life_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sa_life_time"] = "SaLifeTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.IP_sec_vpn_tunnel_profile", fields, reflect.TypeOf(IPSecVpnTunnelProfile{}), fieldNameMap, validators) +} + +func IPv4DiscoveryOptionsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["arp_snooping_config"] = bindings.NewOptionalType(bindings.NewReferenceType(ArpSnoopingConfigBindingType)) + fieldNameMap["arp_snooping_config"] = "ArpSnoopingConfig" + fields["dhcp_snooping_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dhcp_snooping_enabled"] = "DhcpSnoopingEnabled" + fields["vmtools_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["vmtools_enabled"] = "VmtoolsEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.I_pv4_discovery_options", fields, reflect.TypeOf(IPv4DiscoveryOptions{}), fieldNameMap, validators) +} + +func IPv6DADStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["transport_node"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["transport_node"] = "TransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.I_pv6_DAD_status", fields, reflect.TypeOf(IPv6DADStatus{}), fieldNameMap, validators) +} + +func IPv6DiscoveryOptionsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_snooping_v6_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dhcp_snooping_v6_enabled"] = "DhcpSnoopingV6Enabled" + fields["nd_snooping_config"] = bindings.NewOptionalType(bindings.NewReferenceType(NdSnoopingConfigBindingType)) + fieldNameMap["nd_snooping_config"] = "NdSnoopingConfig" + fields["vmtools_v6_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["vmtools_v6_enabled"] = "VmtoolsV6Enabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.I_pv6_discovery_options", fields, reflect.TypeOf(IPv6DiscoveryOptions{}), fieldNameMap, validators) +} + +func IPv6StatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connected_segment_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connected_segment_path"] = "ConnectedSegmentPath" + fields["dad_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPv6DADStatusBindingType), reflect.TypeOf([]IPv6DADStatus{}))) + fieldNameMap["dad_statuses"] = "DadStatuses" + fields["interface_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_id"] = "InterfaceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.I_pv6_status", fields, reflect.TypeOf(IPv6Status{}), fieldNameMap, validators) +} + +func IcmpEchoRequestHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["id"] = "Id" + fields["sequence"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence"] = "Sequence" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.icmp_echo_request_header", fields, reflect.TypeOf(IcmpEchoRequestHeader{}), fieldNameMap, validators) +} + +func IcmpPolicyLbMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.icmp_policy_lb_monitor_profile", fields, reflect.TypeOf(IcmpPolicyLbMonitorProfile{}), fieldNameMap, validators) +} + +func IconBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["placement"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["placement"] = "Placement" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.icon", fields, reflect.TypeOf(Icon{}), fieldNameMap, validators) +} + +func IdentityGroupExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["identity_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdentityGroupInfoBindingType), reflect.TypeOf([]IdentityGroupInfo{}))) + fieldNameMap["identity_groups"] = "IdentityGroups" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.identity_group_expression", fields, reflect.TypeOf(IdentityGroupExpression{}), fieldNameMap, validators) +} + +func IdentityGroupInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["distinguished_name"] = "DistinguishedName" + fields["domain_base_distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_base_distinguished_name"] = "DomainBaseDistinguishedName" + fields["sid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sid"] = "Sid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.identity_group_info", fields, reflect.TypeOf(IdentityGroupInfo{}), fieldNameMap, validators) +} + +func IdentitySourceLdapServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bind_identity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bind_identity"] = "BindIdentity" + fields["certificates"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["certificates"] = "Certificates" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + fields["use_starttls"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["use_starttls"] = "UseStarttls" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.identity_source_ldap_server", fields, reflect.TypeOf(IdentitySourceLdapServer{}), fieldNameMap, validators) +} + +func IdentitySourceLdapServerEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + fields["use_starttls"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["use_starttls"] = "UseStarttls" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.identity_source_ldap_server_endpoint", fields, reflect.TypeOf(IdentitySourceLdapServerEndpoint{}), fieldNameMap, validators) +} + +func IdentitySourceLdapServerProbeResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LdapProbeErrorBindingType), reflect.TypeOf([]LdapProbeError{}))) + fieldNameMap["errors"] = "Errors" + fields["result"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["result"] = "Result" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.identity_source_ldap_server_probe_result", fields, reflect.TypeOf(IdentitySourceLdapServerProbeResult{}), fieldNameMap, validators) +} + +func IdsClusterConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["cluster"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyResourceReferenceBindingType)) + fieldNameMap["cluster"] = "Cluster" + fields["ids_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ids_enabled"] = "IdsEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ids_cluster_config", fields, reflect.TypeOf(IdsClusterConfig{}), fieldNameMap, validators) +} + +func IdsProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["severities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdsProfileSeverityBindingType), reflect.TypeOf([]IdsProfileSeverity{}))) + fieldNameMap["severities"] = "Severities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ids_profile", fields, reflect.TypeOf(IdsProfile{}), fieldNameMap, validators) +} + +func IdsProfileSeverityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ignore_signatures"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ignore_signatures"] = "IgnoreSignatures" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ids_profile_severity", fields, reflect.TypeOf(IdsProfileSeverity{}), fieldNameMap, validators) +} + +func IdsRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["destination_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_groups"] = "DestinationGroups" + fields["destinations_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destinations_excluded"] = "DestinationsExcluded" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["profiles"] = "Profiles" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_id"] = "RuleId" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["service_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["service_entries"] = "ServiceEntries" + fields["services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["services"] = "Services" + fields["source_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_groups"] = "SourceGroups" + fields["sources_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sources_excluded"] = "SourcesExcluded" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["ids_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ids_profiles"] = "IdsProfiles" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ids_rule", fields, reflect.TypeOf(IdsRule{}), fieldNameMap, validators) +} + +func IdsSecurityPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["internal_sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["internal_sequence_number"] = "InternalSequenceNumber" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["scheduler_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheduler_path"] = "SchedulerPath" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdsRuleBindingType), reflect.TypeOf([]IdsRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ids_security_policy", fields, reflect.TypeOf(IdsSecurityPolicy{}), fieldNameMap, validators) +} + +func IdsSignatureBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["attack_target"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attack_target"] = "AttackTarget" + fields["categories"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["categories"] = "Categories" + fields["class_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["class_type"] = "ClassType" + fields["cves"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["cves"] = "Cves" + fields["cvssv2"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cvssv2"] = "Cvssv2" + fields["cvssv3"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cvssv3"] = "Cvssv3" + fields["flow"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["flow"] = "Flow" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["product_affected"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["product_affected"] = "ProductAffected" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["signature_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["signature_id"] = "SignatureId" + fields["signature_revision"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["signature_revision"] = "SignatureRevision" + fields["urls"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["urls"] = "Urls" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ids_signature", fields, reflect.TypeOf(IdsSignature{}), fieldNameMap, validators) +} + +func IdsStandaloneHostConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ids_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ids_enabled"] = "IdsEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ids_standalone_host_config", fields, reflect.TypeOf(IdsStandaloneHostConfig{}), fieldNameMap, validators) +} + +func IncludedFieldsParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["included_fields"] = "IncludedFields" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.included_fields_parameters", fields, reflect.TypeOf(IncludedFieldsParameters{}), fieldNameMap, validators) +} + +func InfraBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["connectivity_strategy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity_strategy"] = "ConnectivityStrategy" + fields["domains"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DomainBindingType), reflect.TypeOf([]Domain{}))) + fieldNameMap["domains"] = "Domains" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.infra", fields, reflect.TypeOf(Infra{}), fieldNameMap, validators) +} + +func IngressBroadcastRateLimiterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["average_bandwidth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["average_bandwidth"] = "AverageBandwidth" + fields["burst_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["burst_size"] = "BurstSize" + fields["peak_bandwidth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["peak_bandwidth"] = "PeakBandwidth" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ingress_broadcast_rate_limiter", fields, reflect.TypeOf(IngressBroadcastRateLimiter{}), fieldNameMap, validators) +} + +func IngressRateLimiterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["average_bandwidth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["average_bandwidth"] = "AverageBandwidth" + fields["burst_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["burst_size"] = "BurstSize" + fields["peak_bandwidth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["peak_bandwidth"] = "PeakBandwidth" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ingress_rate_limiter", fields, reflect.TypeOf(IngressRateLimiter{}), fieldNameMap, validators) +} + +func InitiateClusterRestoreRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.initiate_cluster_restore_request", fields, reflect.TypeOf(InitiateClusterRestoreRequest{}), fieldNameMap, validators) +} + +func InjectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(InjectionValueBindingType),}, bindings.REST)) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.injection", fields, reflect.TypeOf(Injection{}), fieldNameMap, validators) +} + +func InjectionValueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.injection_value", fields, reflect.TypeOf(InjectionValue{}), fieldNameMap, validators) +} + +func InstructionInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["actions"] = "Actions" + fields["fields"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["fields"] = "Fields" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.instruction_info", fields, reflect.TypeOf(InstructionInfo{}), fieldNameMap, validators) +} + +func IntentRuntimeRequestParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.intent_runtime_request_parameters", fields, reflect.TypeOf(IntentRuntimeRequestParameters{}), fieldNameMap, validators) +} + +func InterfaceArpCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip"] = "Ip" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.interface_arp_csv_record", fields, reflect.TypeOf(InterfaceArpCsvRecord{}), fieldNameMap, validators) +} + +func InterfaceArpEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip"] = "Ip" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.interface_arp_entry", fields, reflect.TypeOf(InterfaceArpEntry{}), fieldNameMap, validators) +} + +func InterfaceArpTableBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_path"] = "EdgePath" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_path"] = "InterfacePath" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceArpEntryBindingType), reflect.TypeOf([]InterfaceArpEntry{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.interface_arp_table", fields, reflect.TypeOf(InterfaceArpTable{}), fieldNameMap, validators) +} + +func InterfaceArpTableInCsvFormatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceArpCsvRecordBindingType), reflect.TypeOf([]InterfaceArpCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.interface_arp_table_in_csv_format", fields, reflect.TypeOf(InterfaceArpTableInCsvFormat{}), fieldNameMap, validators) +} + +func InterfaceDADStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceiPv6DADStatusBindingType), reflect.TypeOf([]InterfaceiPv6DADStatus{}))) + fieldNameMap["dad_statuses"] = "DadStatuses" + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_path"] = "InterfacePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.interface_DAD_state", fields, reflect.TypeOf(InterfaceDADState{}), fieldNameMap, validators) +} + +func InterfaceiPv6DADStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["edge_paths"] = "EdgePaths" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.interfacei_pv6_DAD_status", fields, reflect.TypeOf(InterfaceiPv6DADStatus{}), fieldNameMap, validators) +} + +func InterfaceSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["prefix_len"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_len"] = "PrefixLen" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.interface_subnet", fields, reflect.TypeOf(InterfaceSubnet{}), fieldNameMap, validators) +} + +func IntersiteGatewayConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fallback_sites"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["fallback_sites"] = "FallbackSites" + fields["intersite_transit_subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intersite_transit_subnet"] = "IntersiteTransitSubnet" + fields["last_admin_active_epoch"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_admin_active_epoch"] = "LastAdminActiveEpoch" + fields["primary_site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["primary_site_path"] = "PrimarySitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.intersite_gateway_config", fields, reflect.TypeOf(IntersiteGatewayConfig{}), fieldNameMap, validators) +} + +func IntervalBackupScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["seconds_between_backups"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["seconds_between_backups"] = "SecondsBetweenBackups" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.interval_backup_schedule", fields, reflect.TypeOf(IntervalBackupSchedule{}), fieldNameMap, validators) +} + +func IpAddressAllocationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["allocation_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["allocation_ip"] = "AllocationIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ip_address_allocation", fields, reflect.TypeOf(IpAddressAllocation{}), fieldNameMap, validators) +} + +func IpAddressBlockBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["cidr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cidr"] = "Cidr" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ip_address_block", fields, reflect.TypeOf(IpAddressBlock{}), fieldNameMap, validators) +} + +func IpAddressInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ip_address_info", fields, reflect.TypeOf(IpAddressInfo{}), fieldNameMap, validators) +} + +func IpAddressPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ip_release_delay"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ip_release_delay"] = "IpReleaseDelay" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ip_address_pool", fields, reflect.TypeOf(IpAddressPool{}), fieldNameMap, validators) +} + +func IpAddressPoolBlockSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["auto_assign_gateway"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["auto_assign_gateway"] = "AutoAssignGateway" + fields["ip_block_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_block_path"] = "IpBlockPath" + fields["size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["size"] = "Size" + fields["start_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start_ip"] = "StartIp" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ip_address_pool_block_subnet", fields, reflect.TypeOf(IpAddressPoolBlockSubnet{}), fieldNameMap, validators) +} + +func IpAddressPoolStaticSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocation_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpPoolRangeBindingType), reflect.TypeOf([]IpPoolRange{}))) + fieldNameMap["allocation_ranges"] = "AllocationRanges" + fields["cidr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cidr"] = "Cidr" + fields["dns_nameservers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_nameservers"] = "DnsNameservers" + fields["dns_suffix"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dns_suffix"] = "DnsSuffix" + fields["gateway_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_ip"] = "GatewayIp" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ip_address_pool_static_subnet", fields, reflect.TypeOf(IpAddressPoolStaticSubnet{}), fieldNameMap, validators) +} + +func IpAddressPoolSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ip_address_pool_subnet", fields, reflect.TypeOf(IpAddressPoolSubnet{}), fieldNameMap, validators) +} + +func IpPoolRangeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["end"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["end"] = "End" + fields["start"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start"] = "Start" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ip_pool_range", fields, reflect.TypeOf(IpPoolRange{}), fieldNameMap, validators) +} + +func Ipv4HeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["flags"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["flags"] = "Flags" + fields["protocol"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["protocol"] = "Protocol" + fields["src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_ip"] = "SrcIp" + fields["src_subnet_prefix_len"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["src_subnet_prefix_len"] = "SrcSubnetPrefixLen" + fields["ttl"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ttl"] = "Ttl" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ipv4_header", fields, reflect.TypeOf(Ipv4Header{}), fieldNameMap, validators) +} + +func Ipv6DadProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["dad_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dad_mode"] = "DadMode" + fields["ns_retries"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ns_retries"] = "NsRetries" + fields["wait_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["wait_time"] = "WaitTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ipv6_dad_profile", fields, reflect.TypeOf(Ipv6DadProfile{}), fieldNameMap, validators) +} + +func Ipv6DadProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Ipv6DadProfileBindingType), reflect.TypeOf([]Ipv6DadProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ipv6_dad_profile_list_result", fields, reflect.TypeOf(Ipv6DadProfileListResult{}), fieldNameMap, validators) +} + +func Ipv6HeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["hop_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hop_limit"] = "HopLimit" + fields["next_header"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["next_header"] = "NextHeader" + fields["src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_ip"] = "SrcIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ipv6_header", fields, reflect.TypeOf(Ipv6Header{}), fieldNameMap, validators) +} + +func Ipv6NdraProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["dns_config"] = bindings.NewOptionalType(bindings.NewReferenceType(RaDNSConfigBindingType)) + fieldNameMap["dns_config"] = "DnsConfig" + fields["ra_config"] = bindings.NewOptionalType(bindings.NewReferenceType(RAConfigBindingType)) + fieldNameMap["ra_config"] = "RaConfig" + fields["ra_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ra_mode"] = "RaMode" + fields["reachable_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["reachable_timer"] = "ReachableTimer" + fields["retransmit_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["retransmit_interval"] = "RetransmitInterval" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ipv6_ndra_profile", fields, reflect.TypeOf(Ipv6NdraProfile{}), fieldNameMap, validators) +} + +func Ipv6NdraProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Ipv6NdraProfileBindingType), reflect.TypeOf([]Ipv6NdraProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ipv6_ndra_profile_list_result", fields, reflect.TypeOf(Ipv6NdraProfileListResult{}), fieldNameMap, validators) +} + +func KeyValuePairBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.key_value_pair", fields, reflect.TypeOf(KeyValuePair{}), fieldNameMap, validators) +} + +func L2BridgeEndpointProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["edge_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["edge_paths"] = "EdgePaths" + fields["failover_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failover_mode"] = "FailoverMode" + fields["ha_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ha_mode"] = "HaMode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l2_bridge_endpoint_profile", fields, reflect.TypeOf(L2BridgeEndpointProfile{}), fieldNameMap, validators) +} + +func L2ExtensionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2vpn_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["l2vpn_path"] = "L2vpnPath" + fields["l2vpn_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["l2vpn_paths"] = "L2vpnPaths" + fields["local_egress"] = bindings.NewOptionalType(bindings.NewReferenceType(LocalEgressBindingType)) + fieldNameMap["local_egress"] = "LocalEgress" + fields["tunnel_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tunnel_id"] = "TunnelId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l2_extension", fields, reflect.TypeOf(L2Extension{}), fieldNameMap, validators) +} + +func L2VPNServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enable_hub"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_hub"] = "EnableHub" + fields["encap_ip_pool"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["encap_ip_pool"] = "EncapIpPool" + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l2_VPN_service", fields, reflect.TypeOf(L2VPNService{}), fieldNameMap, validators) +} + +func L2VPNSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["transport_tunnels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transport_tunnels"] = "TransportTunnels" + fields["tunnel_encapsulation"] = bindings.NewOptionalType(bindings.NewReferenceType(L2VPNTunnelEncapsulationBindingType)) + fieldNameMap["tunnel_encapsulation"] = "TunnelEncapsulation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l2_VPN_session", fields, reflect.TypeOf(L2VPNSession{}), fieldNameMap, validators) +} + +func L2VPNTunnelEncapsulationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["local_endpoint_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_endpoint_address"] = "LocalEndpointAddress" + fields["peer_endpoint_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_endpoint_address"] = "PeerEndpointAddress" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l2_VPN_tunnel_encapsulation", fields, reflect.TypeOf(L2VPNTunnelEncapsulation{}), fieldNameMap, validators) +} + +func L2VpnBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["transport_tunnels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transport_tunnels"] = "TransportTunnels" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l2_vpn", fields, reflect.TypeOf(L2Vpn{}), fieldNameMap, validators) +} + +func L2VpnContextBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enable_hub"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_hub"] = "EnableHub" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l2_vpn_context", fields, reflect.TypeOf(L2VpnContext{}), fieldNameMap, validators) +} + +func L3VpnBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["dh_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dh_groups"] = "DhGroups" + fields["enable_perfect_forward_secrecy"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_perfect_forward_secrecy"] = "EnablePerfectForwardSecrecy" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ike_digest_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ike_digest_algorithms"] = "IkeDigestAlgorithms" + fields["ike_encryption_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ike_encryption_algorithms"] = "IkeEncryptionAlgorithms" + fields["ike_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_version"] = "IkeVersion" + fields["l3vpn_session"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(L3VpnSessionBindingType),}, bindings.REST)) + fieldNameMap["l3vpn_session"] = "L3vpnSession" + fields["local_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_address"] = "LocalAddress" + fields["passphrases"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["passphrases"] = "Passphrases" + fields["remote_private_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_private_address"] = "RemotePrivateAddress" + fields["remote_public_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_public_address"] = "RemotePublicAddress" + fields["tunnel_digest_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["tunnel_digest_algorithms"] = "TunnelDigestAlgorithms" + fields["tunnel_encryption_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["tunnel_encryption_algorithms"] = "TunnelEncryptionAlgorithms" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l3_vpn", fields, reflect.TypeOf(L3Vpn{}), fieldNameMap, validators) +} + +func L3VpnContextBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["available_local_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyIPAddressInfoBindingType), reflect.TypeOf([]PolicyIPAddressInfo{}))) + fieldNameMap["available_local_addresses"] = "AvailableLocalAddresses" + fields["bypass_rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L3VpnRuleBindingType), reflect.TypeOf([]L3VpnRule{}))) + fieldNameMap["bypass_rules"] = "BypassRules" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ike_log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_log_level"] = "IkeLogLevel" + fields["label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["label"] = "Label" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l3_vpn_context", fields, reflect.TypeOf(L3VpnContext{}), fieldNameMap, validators) +} + +func L3VpnRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["destinations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L3VpnSubnetBindingType), reflect.TypeOf([]L3VpnSubnet{}))) + fieldNameMap["destinations"] = "Destinations" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L3VpnSubnetBindingType), reflect.TypeOf([]L3VpnSubnet{}))) + fieldNameMap["sources"] = "Sources" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l3_vpn_rule", fields, reflect.TypeOf(L3VpnRule{}), fieldNameMap, validators) +} + +func L3VpnSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l3_vpn_session", fields, reflect.TypeOf(L3VpnSession{}), fieldNameMap, validators) +} + +func L3VpnSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet"] = "Subnet" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l3_vpn_subnet", fields, reflect.TypeOf(L3VpnSubnet{}), fieldNameMap, validators) +} + +func L4PolicyLbPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["persistence"] = "Persistence" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l4_policy_lb_persistence_profile", fields, reflect.TypeOf(L4PolicyLbPersistenceProfile{}), fieldNameMap, validators) +} + +func L4PortSetServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["destination_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_ports"] = "DestinationPorts" + fields["l4_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["l4_protocol"] = "L4Protocol" + fields["source_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_ports"] = "SourcePorts" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l4_port_set_service_entry", fields, reflect.TypeOf(L4PortSetServiceEntry{}), fieldNameMap, validators) +} + +func L7PolicyLbPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["persistence"] = "Persistence" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.l7_policy_lb_persistence_profile", fields, reflect.TypeOf(L7PolicyLbPersistenceProfile{}), fieldNameMap, validators) +} + +func LBAccessListControlBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["group_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_path"] = "GroupPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_access_list_control", fields, reflect.TypeOf(LBAccessListControl{}), fieldNameMap, validators) +} + +func LBActiveMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_active_monitor", fields, reflect.TypeOf(LBActiveMonitor{}), fieldNameMap, validators) +} + +func LBAppProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_app_profile", fields, reflect.TypeOf(LBAppProfile{}), fieldNameMap, validators) +} + +func LBClientCertificateIssuerDnConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["issuer_dn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer_dn"] = "IssuerDn" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_client_certificate_issuer_dn_condition", fields, reflect.TypeOf(LBClientCertificateIssuerDnCondition{}), fieldNameMap, validators) +} + +func LBClientCertificateSubjectDnConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["subject_dn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subject_dn"] = "SubjectDn" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_client_certificate_subject_dn_condition", fields, reflect.TypeOf(LBClientCertificateSubjectDnCondition{}), fieldNameMap, validators) +} + +func LBClientSslProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["cipher_group_label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cipher_group_label"] = "CipherGroupLabel" + fields["ciphers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ciphers"] = "Ciphers" + fields["is_fips"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_fips"] = "IsFips" + fields["is_secure"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_secure"] = "IsSecure" + fields["prefer_server_ciphers"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["prefer_server_ciphers"] = "PreferServerCiphers" + fields["protocols"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["protocols"] = "Protocols" + fields["session_cache_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["session_cache_enabled"] = "SessionCacheEnabled" + fields["session_cache_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["session_cache_timeout"] = "SessionCacheTimeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_client_ssl_profile", fields, reflect.TypeOf(LBClientSslProfile{}), fieldNameMap, validators) +} + +func LBClientSslProfileBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_chain_depth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["certificate_chain_depth"] = "CertificateChainDepth" + fields["client_auth"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_auth"] = "ClientAuth" + fields["client_auth_ca_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["client_auth_ca_paths"] = "ClientAuthCaPaths" + fields["client_auth_crl_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["client_auth_crl_paths"] = "ClientAuthCrlPaths" + fields["default_certificate_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_certificate_path"] = "DefaultCertificatePath" + fields["sni_certificate_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sni_certificate_paths"] = "SniCertificatePaths" + fields["ssl_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssl_profile_path"] = "SslProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_client_ssl_profile_binding", fields, reflect.TypeOf(LBClientSslProfileBinding{}), fieldNameMap, validators) +} + +func LBConnectionDropActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_connection_drop_action", fields, reflect.TypeOf(LBConnectionDropAction{}), fieldNameMap, validators) +} + +func LBCookiePersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cookie_domain"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_domain"] = "CookieDomain" + fields["cookie_fallback"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cookie_fallback"] = "CookieFallback" + fields["cookie_garble"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cookie_garble"] = "CookieGarble" + fields["cookie_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_mode"] = "CookieMode" + fields["cookie_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_name"] = "CookieName" + fields["cookie_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_path"] = "CookiePath" + fields["cookie_time"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LBCookieTimeBindingType),}, bindings.REST)) + fieldNameMap["cookie_time"] = "CookieTime" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_cookie_persistence_profile", fields, reflect.TypeOf(LBCookiePersistenceProfile{}), fieldNameMap, validators) +} + +func LBCookieTimeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_cookie_time", fields, reflect.TypeOf(LBCookieTime{}), fieldNameMap, validators) +} + +func LBFastTcpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["close_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["close_timeout"] = "CloseTimeout" + fields["ha_flow_mirroring_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ha_flow_mirroring_enabled"] = "HaFlowMirroringEnabled" + fields["idle_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["idle_timeout"] = "IdleTimeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_fast_tcp_profile", fields, reflect.TypeOf(LBFastTcpProfile{}), fieldNameMap, validators) +} + +func LBFastUdpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["flow_mirroring_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["flow_mirroring_enabled"] = "FlowMirroringEnabled" + fields["idle_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["idle_timeout"] = "IdleTimeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_fast_udp_profile", fields, reflect.TypeOf(LBFastUdpProfile{}), fieldNameMap, validators) +} + +func LBGenericPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ha_persistence_mirroring_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ha_persistence_mirroring_enabled"] = "HaPersistenceMirroringEnabled" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_generic_persistence_profile", fields, reflect.TypeOf(LBGenericPersistenceProfile{}), fieldNameMap, validators) +} + +func LBHttpMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["request_body"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_body"] = "RequestBody" + fields["request_headers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbHttpRequestHeaderBindingType), reflect.TypeOf([]LbHttpRequestHeader{}))) + fieldNameMap["request_headers"] = "RequestHeaders" + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_method"] = "RequestMethod" + fields["request_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_url"] = "RequestUrl" + fields["request_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_version"] = "RequestVersion" + fields["response_body"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["response_body"] = "ResponseBody" + fields["response_status_codes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["response_status_codes"] = "ResponseStatusCodes" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_monitor_profile", fields, reflect.TypeOf(LBHttpMonitorProfile{}), fieldNameMap, validators) +} + +func LBHttpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["http_redirect_to"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["http_redirect_to"] = "HttpRedirectTo" + fields["http_redirect_to_https"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["http_redirect_to_https"] = "HttpRedirectToHttps" + fields["idle_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["idle_timeout"] = "IdleTimeout" + fields["ntlm"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ntlm"] = "Ntlm" + fields["request_body_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["request_body_size"] = "RequestBodySize" + fields["request_header_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["request_header_size"] = "RequestHeaderSize" + fields["response_buffering"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["response_buffering"] = "ResponseBuffering" + fields["response_header_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["response_header_size"] = "ResponseHeaderSize" + fields["response_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["response_timeout"] = "ResponseTimeout" + fields["x_forwarded_for"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["x_forwarded_for"] = "XForwardedFor" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_profile", fields, reflect.TypeOf(LBHttpProfile{}), fieldNameMap, validators) +} + +func LBHttpRedirectActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["redirect_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirect_status"] = "RedirectStatus" + fields["redirect_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirect_url"] = "RedirectUrl" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_redirect_action", fields, reflect.TypeOf(LBHttpRedirectAction{}), fieldNameMap, validators) +} + +func LBHttpRejectActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["reply_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reply_message"] = "ReplyMessage" + fields["reply_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reply_status"] = "ReplyStatus" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_reject_action", fields, reflect.TypeOf(LBHttpRejectAction{}), fieldNameMap, validators) +} + +func LBHttpRequestBodyConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["body_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["body_value"] = "BodyValue" + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_body_condition", fields, reflect.TypeOf(LBHttpRequestBodyCondition{}), fieldNameMap, validators) +} + +func LBHttpRequestCookieConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["cookie_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_name"] = "CookieName" + fields["cookie_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_value"] = "CookieValue" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_cookie_condition", fields, reflect.TypeOf(LBHttpRequestCookieCondition{}), fieldNameMap, validators) +} + +func LBHttpRequestHeaderConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_header_condition", fields, reflect.TypeOf(LBHttpRequestHeaderCondition{}), fieldNameMap, validators) +} + +func LBHttpRequestHeaderDeleteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_header_delete_action", fields, reflect.TypeOf(LBHttpRequestHeaderDeleteAction{}), fieldNameMap, validators) +} + +func LBHttpRequestHeaderRewriteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_header_rewrite_action", fields, reflect.TypeOf(LBHttpRequestHeaderRewriteAction{}), fieldNameMap, validators) +} + +func LBHttpRequestMethodConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["method"] = "Method" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_method_condition", fields, reflect.TypeOf(LBHttpRequestMethodCondition{}), fieldNameMap, validators) +} + +func LBHttpRequestUriArgumentsConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["uri_arguments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri_arguments"] = "UriArguments" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_uri_arguments_condition", fields, reflect.TypeOf(LBHttpRequestUriArgumentsCondition{}), fieldNameMap, validators) +} + +func LBHttpRequestUriConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_uri_condition", fields, reflect.TypeOf(LBHttpRequestUriCondition{}), fieldNameMap, validators) +} + +func LBHttpRequestUriRewriteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["uri_arguments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri_arguments"] = "UriArguments" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_uri_rewrite_action", fields, reflect.TypeOf(LBHttpRequestUriRewriteAction{}), fieldNameMap, validators) +} + +func LBHttpRequestVersionConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_request_version_condition", fields, reflect.TypeOf(LBHttpRequestVersionCondition{}), fieldNameMap, validators) +} + +func LBHttpResponseHeaderConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_response_header_condition", fields, reflect.TypeOf(LBHttpResponseHeaderCondition{}), fieldNameMap, validators) +} + +func LBHttpResponseHeaderDeleteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_response_header_delete_action", fields, reflect.TypeOf(LBHttpResponseHeaderDeleteAction{}), fieldNameMap, validators) +} + +func LBHttpResponseHeaderRewriteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_response_header_rewrite_action", fields, reflect.TypeOf(LBHttpResponseHeaderRewriteAction{}), fieldNameMap, validators) +} + +func LBHttpSslConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_certificate_issuer_dn"] = bindings.NewOptionalType(bindings.NewReferenceType(LBClientCertificateIssuerDnConditionBindingType)) + fieldNameMap["client_certificate_issuer_dn"] = "ClientCertificateIssuerDn" + fields["client_certificate_subject_dn"] = bindings.NewOptionalType(bindings.NewReferenceType(LBClientCertificateSubjectDnConditionBindingType)) + fieldNameMap["client_certificate_subject_dn"] = "ClientCertificateSubjectDn" + fields["client_supported_ssl_ciphers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["client_supported_ssl_ciphers"] = "ClientSupportedSslCiphers" + fields["session_reused"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_reused"] = "SessionReused" + fields["used_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["used_protocol"] = "UsedProtocol" + fields["used_ssl_cipher"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["used_ssl_cipher"] = "UsedSslCipher" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_http_ssl_condition", fields, reflect.TypeOf(LBHttpSslCondition{}), fieldNameMap, validators) +} + +func LBHttpsMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["request_body"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_body"] = "RequestBody" + fields["request_headers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbHttpRequestHeaderBindingType), reflect.TypeOf([]LbHttpRequestHeader{}))) + fieldNameMap["request_headers"] = "RequestHeaders" + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_method"] = "RequestMethod" + fields["request_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_url"] = "RequestUrl" + fields["request_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_version"] = "RequestVersion" + fields["response_body"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["response_body"] = "ResponseBody" + fields["response_status_codes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["response_status_codes"] = "ResponseStatusCodes" + fields["server_ssl_profile_binding"] = bindings.NewOptionalType(bindings.NewReferenceType(LBServerSslProfileBindingBindingType)) + fieldNameMap["server_ssl_profile_binding"] = "ServerSslProfileBinding" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_https_monitor_profile", fields, reflect.TypeOf(LBHttpsMonitorProfile{}), fieldNameMap, validators) +} + +func LBIcmpMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["data_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["data_length"] = "DataLength" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_icmp_monitor_profile", fields, reflect.TypeOf(LBIcmpMonitorProfile{}), fieldNameMap, validators) +} + +func LBIpHeaderConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_path"] = "GroupPath" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_ip_header_condition", fields, reflect.TypeOf(LBIpHeaderCondition{}), fieldNameMap, validators) +} + +func LBJwtAuthActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LBJwtKeyBindingType),}, bindings.REST)) + fieldNameMap["key"] = "Key" + fields["pass_jwt_to_pool"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pass_jwt_to_pool"] = "PassJwtToPool" + fields["realm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["realm"] = "Realm" + fields["tokens"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["tokens"] = "Tokens" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_jwt_auth_action", fields, reflect.TypeOf(LBJwtAuthAction{}), fieldNameMap, validators) +} + +func LBJwtCertificateKeyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_path"] = "CertificatePath" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_jwt_certificate_key", fields, reflect.TypeOf(LBJwtCertificateKey{}), fieldNameMap, validators) +} + +func LBJwtKeyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_jwt_key", fields, reflect.TypeOf(LBJwtKey{}), fieldNameMap, validators) +} + +func LBJwtPublicKeyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["public_key_content"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["public_key_content"] = "PublicKeyContent" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_jwt_public_key", fields, reflect.TypeOf(LBJwtPublicKey{}), fieldNameMap, validators) +} + +func LBJwtSymmetricKeyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_jwt_symmetric_key", fields, reflect.TypeOf(LBJwtSymmetricKey{}), fieldNameMap, validators) +} + +func LBMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_monitor_profile", fields, reflect.TypeOf(LBMonitorProfile{}), fieldNameMap, validators) +} + +func LBPassiveMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["max_fails"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_fails"] = "MaxFails" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_passive_monitor_profile", fields, reflect.TypeOf(LBPassiveMonitorProfile{}), fieldNameMap, validators) +} + +func LBPersistenceCookieTimeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cookie_max_idle"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cookie_max_idle"] = "CookieMaxIdle" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_persistence_cookie_time", fields, reflect.TypeOf(LBPersistenceCookieTime{}), fieldNameMap, validators) +} + +func LBPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_persistence_profile", fields, reflect.TypeOf(LBPersistenceProfile{}), fieldNameMap, validators) +} + +func LBPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["active_monitor_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["active_monitor_paths"] = "ActiveMonitorPaths" + fields["algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["algorithm"] = "Algorithm" + fields["member_group"] = bindings.NewOptionalType(bindings.NewReferenceType(LBPoolMemberGroupBindingType)) + fieldNameMap["member_group"] = "MemberGroup" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LBPoolMemberBindingType), reflect.TypeOf([]LBPoolMember{}))) + fieldNameMap["members"] = "Members" + fields["min_active_members"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["min_active_members"] = "MinActiveMembers" + fields["passive_monitor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passive_monitor_path"] = "PassiveMonitorPath" + fields["snat_translation"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LBSnatTranslationBindingType),}, bindings.REST)) + fieldNameMap["snat_translation"] = "SnatTranslation" + fields["tcp_multiplexing_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_multiplexing_enabled"] = "TcpMultiplexingEnabled" + fields["tcp_multiplexing_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_multiplexing_number"] = "TcpMultiplexingNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_pool", fields, reflect.TypeOf(LBPool{}), fieldNameMap, validators) +} + +func LBPoolMemberBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["backup_member"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["backup_member"] = "BackupMember" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["max_concurrent_connections"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_concurrent_connections"] = "MaxConcurrentConnections" + fields["port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port"] = "Port" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_pool_member", fields, reflect.TypeOf(LBPoolMember{}), fieldNameMap, validators) +} + +func LBPoolMemberGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["customized_members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PoolMemberSettingBindingType), reflect.TypeOf([]PoolMemberSetting{}))) + fieldNameMap["customized_members"] = "CustomizedMembers" + fields["group_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_path"] = "GroupPath" + fields["ip_revision_filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_revision_filter"] = "IpRevisionFilter" + fields["max_ip_list_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_ip_list_size"] = "MaxIpListSize" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_pool_member_group", fields, reflect.TypeOf(LBPoolMemberGroup{}), fieldNameMap, validators) +} + +func LBRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LBRuleActionBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["actions"] = "Actions" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["match_conditions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LBRuleConditionBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["match_conditions"] = "MatchConditions" + fields["match_strategy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_strategy"] = "MatchStrategy" + fields["phase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["phase"] = "Phase" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_rule", fields, reflect.TypeOf(LBRule{}), fieldNameMap, validators) +} + +func LBRuleActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_rule_action", fields, reflect.TypeOf(LBRuleAction{}), fieldNameMap, validators) +} + +func LBRuleConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_rule_condition", fields, reflect.TypeOf(LBRuleCondition{}), fieldNameMap, validators) +} + +func LBSelectPoolActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pool_id"] = "PoolId" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_select_pool_action", fields, reflect.TypeOf(LBSelectPoolAction{}), fieldNameMap, validators) +} + +func LBServerSslProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["cipher_group_label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cipher_group_label"] = "CipherGroupLabel" + fields["ciphers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ciphers"] = "Ciphers" + fields["is_fips"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_fips"] = "IsFips" + fields["is_secure"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_secure"] = "IsSecure" + fields["protocols"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["protocols"] = "Protocols" + fields["session_cache_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["session_cache_enabled"] = "SessionCacheEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_server_ssl_profile", fields, reflect.TypeOf(LBServerSslProfile{}), fieldNameMap, validators) +} + +func LBServerSslProfileBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_chain_depth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["certificate_chain_depth"] = "CertificateChainDepth" + fields["client_certificate_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_certificate_path"] = "ClientCertificatePath" + fields["server_auth"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_auth"] = "ServerAuth" + fields["server_auth_ca_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_auth_ca_paths"] = "ServerAuthCaPaths" + fields["server_auth_crl_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_auth_crl_paths"] = "ServerAuthCrlPaths" + fields["ssl_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssl_profile_path"] = "SslProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_server_ssl_profile_binding", fields, reflect.TypeOf(LBServerSslProfileBinding{}), fieldNameMap, validators) +} + +func LBServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["connectivity_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity_path"] = "ConnectivityPath" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["error_log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_log_level"] = "ErrorLogLevel" + fields["relax_scale_validation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["relax_scale_validation"] = "RelaxScaleValidation" + fields["size"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["size"] = "Size" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_service", fields, reflect.TypeOf(LBService{}), fieldNameMap, validators) +} + +func LBSessionCookieTimeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cookie_max_idle"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cookie_max_idle"] = "CookieMaxIdle" + fields["cookie_max_life"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cookie_max_life"] = "CookieMaxLife" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_session_cookie_time", fields, reflect.TypeOf(LBSessionCookieTime{}), fieldNameMap, validators) +} + +func LBSnatAutoMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_snat_auto_map", fields, reflect.TypeOf(LBSnatAutoMap{}), fieldNameMap, validators) +} + +func LBSnatDisabledBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_snat_disabled", fields, reflect.TypeOf(LBSnatDisabled{}), fieldNameMap, validators) +} + +func LBSnatIpElementBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_snat_ip_element", fields, reflect.TypeOf(LBSnatIpElement{}), fieldNameMap, validators) +} + +func LBSnatIpPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LBSnatIpElementBindingType), reflect.TypeOf([]LBSnatIpElement{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_snat_ip_pool", fields, reflect.TypeOf(LBSnatIpPool{}), fieldNameMap, validators) +} + +func LBSnatTranslationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_snat_translation", fields, reflect.TypeOf(LBSnatTranslation{}), fieldNameMap, validators) +} + +func LBSourceIpPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ha_persistence_mirroring_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ha_persistence_mirroring_enabled"] = "HaPersistenceMirroringEnabled" + fields["purge"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["purge"] = "Purge" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_source_ip_persistence_profile", fields, reflect.TypeOf(LBSourceIpPersistenceProfile{}), fieldNameMap, validators) +} + +func LBSslModeSelectionActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ssl_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssl_mode"] = "SslMode" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_ssl_mode_selection_action", fields, reflect.TypeOf(LBSslModeSelectionAction{}), fieldNameMap, validators) +} + +func LBSslProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_ssl_profile", fields, reflect.TypeOf(LBSslProfile{}), fieldNameMap, validators) +} + +func LBSslSniConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["sni"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sni"] = "Sni" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_ssl_sni_condition", fields, reflect.TypeOf(LBSslSniCondition{}), fieldNameMap, validators) +} + +func LBTcpHeaderConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["source_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_port"] = "SourcePort" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_tcp_header_condition", fields, reflect.TypeOf(LBTcpHeaderCondition{}), fieldNameMap, validators) +} + +func LBTcpMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["receive"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["receive"] = "Receive" + fields["send"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["send"] = "Send" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_tcp_monitor_profile", fields, reflect.TypeOf(LBTcpMonitorProfile{}), fieldNameMap, validators) +} + +func LBUdpMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["receive"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["receive"] = "Receive" + fields["send"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["send"] = "Send" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_udp_monitor_profile", fields, reflect.TypeOf(LBUdpMonitorProfile{}), fieldNameMap, validators) +} + +func LBVariableAssignmentActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["variable_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_name"] = "VariableName" + fields["variable_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_value"] = "VariableValue" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_variable_assignment_action", fields, reflect.TypeOf(LBVariableAssignmentAction{}), fieldNameMap, validators) +} + +func LBVariableConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["variable_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_name"] = "VariableName" + fields["variable_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_value"] = "VariableValue" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_variable_condition", fields, reflect.TypeOf(LBVariableCondition{}), fieldNameMap, validators) +} + +func LBVariablePersistenceLearnActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["persistence_profile_path"] = "PersistenceProfilePath" + fields["variable_hash_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["variable_hash_enabled"] = "VariableHashEnabled" + fields["variable_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_name"] = "VariableName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_variable_persistence_learn_action", fields, reflect.TypeOf(LBVariablePersistenceLearnAction{}), fieldNameMap, validators) +} + +func LBVariablePersistenceOnActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["persistence_profile_path"] = "PersistenceProfilePath" + fields["variable_hash_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["variable_hash_enabled"] = "VariableHashEnabled" + fields["variable_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_name"] = "VariableName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_variable_persistence_on_action", fields, reflect.TypeOf(LBVariablePersistenceOnAction{}), fieldNameMap, validators) +} + +func LBVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["access_list_control"] = bindings.NewOptionalType(bindings.NewReferenceType(LBAccessListControlBindingType)) + fieldNameMap["access_list_control"] = "AccessListControl" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["application_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["application_profile_path"] = "ApplicationProfilePath" + fields["client_ssl_profile_binding"] = bindings.NewOptionalType(bindings.NewReferenceType(LBClientSslProfileBindingBindingType)) + fieldNameMap["client_ssl_profile_binding"] = "ClientSslProfileBinding" + fields["default_pool_member_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["default_pool_member_ports"] = "DefaultPoolMemberPorts" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lb_persistence_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_persistence_profile_path"] = "LbPersistenceProfilePath" + fields["lb_service_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_service_path"] = "LbServicePath" + fields["log_significant_event_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["log_significant_event_only"] = "LogSignificantEventOnly" + fields["max_concurrent_connections"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_concurrent_connections"] = "MaxConcurrentConnections" + fields["max_new_connection_rate"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_new_connection_rate"] = "MaxNewConnectionRate" + fields["pool_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pool_path"] = "PoolPath" + fields["ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ports"] = "Ports" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LBRuleBindingType), reflect.TypeOf([]LBRule{}))) + fieldNameMap["rules"] = "Rules" + fields["server_ssl_profile_binding"] = bindings.NewOptionalType(bindings.NewReferenceType(LBServerSslProfileBindingBindingType)) + fieldNameMap["server_ssl_profile_binding"] = "ServerSslProfileBinding" + fields["sorry_pool_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sorry_pool_path"] = "SorryPoolPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.LB_virtual_server", fields, reflect.TypeOf(LBVirtualServer{}), fieldNameMap, validators) +} + +func LabelBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["hover"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["hover"] = "Hover" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["text"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["text"] = "Text" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.label", fields, reflect.TypeOf(Label{}), fieldNameMap, validators) +} + +func LabelValueConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["layout"] = bindings.NewOptionalType(bindings.NewReferenceType(LayoutBindingType)) + fieldNameMap["layout"] = "Layout" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PropertyItemBindingType), reflect.TypeOf([]PropertyItem{}))) + fieldNameMap["properties"] = "Properties" + fields["sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_type"] = "SubType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.label_value_configuration", fields, reflect.TypeOf(LabelValueConfiguration{}), fieldNameMap, validators) +} + +func LacpGroupConfigInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["load_balance_algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["load_balance_algorithm"] = "LoadBalanceAlgorithm" + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["uplink_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_names"] = "UplinkNames" + fields["uplink_num"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["uplink_num"] = "UplinkNum" + fields["uplink_port_keys"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_port_keys"] = "UplinkPortKeys" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.lacp_group_config_info", fields, reflect.TypeOf(LacpGroupConfigInfo{}), fieldNameMap, validators) +} + +func LayoutBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["properties"] = bindings.NewOptionalType(bindings.NewReferenceType(LayoutPropertiesBindingType)) + fieldNameMap["properties"] = "Properties" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.layout", fields, reflect.TypeOf(Layout{}), fieldNameMap, validators) +} + +func LayoutPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["num_columns"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_columns"] = "NumColumns" + fields["num_rows"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_rows"] = "NumRows" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.layout_properties", fields, reflect.TypeOf(LayoutProperties{}), fieldNameMap, validators) +} + +func LbHttpRequestHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.lb_http_request_header", fields, reflect.TypeOf(LbHttpRequestHeader{}), fieldNameMap, validators) +} + +func LdapIdentitySourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["base_dn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["base_dn"] = "BaseDn" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["ldap_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdentitySourceLdapServerBindingType), reflect.TypeOf([]IdentitySourceLdapServer{}))) + fieldNameMap["ldap_servers"] = "LdapServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ldap_identity_source", fields, reflect.TypeOf(LdapIdentitySource{}), fieldNameMap, validators) +} + +func LdapIdentitySourceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LdapIdentitySourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ldap_identity_source_list_result", fields, reflect.TypeOf(LdapIdentitySourceListResult{}), fieldNameMap, validators) +} + +func LdapIdentitySourceProbeResultsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdentitySourceLdapServerProbeResultBindingType), reflect.TypeOf([]IdentitySourceLdapServerProbeResult{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ldap_identity_source_probe_results", fields, reflect.TypeOf(LdapIdentitySourceProbeResults{}), fieldNameMap, validators) +} + +func LdapIdentitySourceSearchResultItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["common_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["common_name"] = "CommonName" + fields["dn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dn"] = "Dn" + fields["principal_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["principal_name"] = "PrincipalName" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ldap_identity_source_search_result_item", fields, reflect.TypeOf(LdapIdentitySourceSearchResultItem{}), fieldNameMap, validators) +} + +func LdapIdentitySourceSearchResultListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LdapIdentitySourceSearchResultItemBindingType), reflect.TypeOf([]LdapIdentitySourceSearchResultItem{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ldap_identity_source_search_result_list", fields, reflect.TypeOf(LdapIdentitySourceSearchResultList{}), fieldNameMap, validators) +} + +func LdapProbeErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_type"] = "ErrorType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ldap_probe_error", fields, reflect.TypeOf(LdapProbeError{}), fieldNameMap, validators) +} + +func LegendBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alignment"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alignment"] = "Alignment" + fields["display_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["display_count"] = "DisplayCount" + fields["position"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["position"] = "Position" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["unit"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unit"] = "Unit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.legend", fields, reflect.TypeOf(Legend{}), fieldNameMap, validators) +} + +func ListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.list_result", fields, reflect.TypeOf(ListResult{}), fieldNameMap, validators) +} + +func LocalEgressBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["optimized_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["optimized_ips"] = "OptimizedIps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.local_egress", fields, reflect.TypeOf(LocalEgress{}), fieldNameMap, validators) +} + +func LocalEgressRoutingEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nexthop_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nexthop_address"] = "NexthopAddress" + fields["prefix_list_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["prefix_list_paths"] = "PrefixListPaths" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.local_egress_routing_entry", fields, reflect.TypeOf(LocalEgressRoutingEntry{}), fieldNameMap, validators) +} + +func LocaleServicesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["edge_cluster_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_path"] = "EdgeClusterPath" + fields["ha_vip_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Tier0HaVipConfigBindingType), reflect.TypeOf([]Tier0HaVipConfig{}))) + fieldNameMap["ha_vip_configs"] = "HaVipConfigs" + fields["preferred_edge_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["preferred_edge_paths"] = "PreferredEdgePaths" + fields["route_redistribution_config"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier0RouteRedistributionConfigBindingType)) + fieldNameMap["route_redistribution_config"] = "RouteRedistributionConfig" + fields["route_redistribution_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["route_redistribution_types"] = "RouteRedistributionTypes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.locale_services", fields, reflect.TypeOf(LocaleServices{}), fieldNameMap, validators) +} + +func LocaleServicesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LocaleServicesBindingType), reflect.TypeOf([]LocaleServices{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.locale_services_list_result", fields, reflect.TypeOf(LocaleServicesListResult{}), fieldNameMap, validators) +} + +func LogicalPortStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_port_id"] = "LogicalPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_port_statistics", fields, reflect.TypeOf(LogicalPortStatistics{}), fieldNameMap, validators) +} + +func LogicalRouterPortCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_packets"] = "DroppedPackets" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_router_port_counters", fields, reflect.TypeOf(LogicalRouterPortCounters{}), fieldNameMap, validators) +} + +func LogicalRouterPortStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fields["per_node_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterPortStatisticsPerNodeBindingType), reflect.TypeOf([]LogicalRouterPortStatisticsPerNode{}))) + fieldNameMap["per_node_statistics"] = "PerNodeStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_router_port_statistics", fields, reflect.TypeOf(LogicalRouterPortStatistics{}), fieldNameMap, validators) +} + +func LogicalRouterPortStatisticsPerNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_router_port_statistics_per_node", fields, reflect.TypeOf(LogicalRouterPortStatisticsPerNode{}), fieldNameMap, validators) +} + +func LogicalRouterPortStatisticsSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_router_port_statistics_summary", fields, reflect.TypeOf(LogicalRouterPortStatisticsSummary{}), fieldNameMap, validators) +} + +func LogicalRouterStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_router_state", fields, reflect.TypeOf(LogicalRouterState{}), fieldNameMap, validators) +} + +func LogicalRouterStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["locale_operation_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["locale_operation_mode"] = "LocaleOperationMode" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["per_node_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterStatusPerNodeBindingType), reflect.TypeOf([]LogicalRouterStatusPerNode{}))) + fieldNameMap["per_node_status"] = "PerNodeStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_router_status", fields, reflect.TypeOf(LogicalRouterStatus{}), fieldNameMap, validators) +} + +func LogicalRouterStatusPerNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["high_availability_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["high_availability_status"] = "HighAvailabilityStatus" + fields["service_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_router_id"] = "ServiceRouterId" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_router_status_per_node", fields, reflect.TypeOf(LogicalRouterStatusPerNode{}), fieldNameMap, validators) +} + +func LogicalSwitchStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.logical_switch_statistics", fields, reflect.TypeOf(LogicalSwitchStatistics{}), fieldNameMap, validators) +} + +func MACAddressExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["mac_addresses"] = "MacAddresses" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.MAC_address_expression", fields, reflect.TypeOf(MACAddressExpression{}), fieldNameMap, validators) +} + +func MACAddressListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["mac_addresses"] = "MacAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.MAC_address_list", fields, reflect.TypeOf(MACAddressList{}), fieldNameMap, validators) +} + +func MacDiscoveryProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["mac_change_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["mac_change_enabled"] = "MacChangeEnabled" + fields["mac_learning_aging_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mac_learning_aging_time"] = "MacLearningAgingTime" + fields["mac_learning_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["mac_learning_enabled"] = "MacLearningEnabled" + fields["mac_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mac_limit"] = "MacLimit" + fields["mac_limit_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_limit_policy"] = "MacLimitPolicy" + fields["remote_overlay_mac_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remote_overlay_mac_limit"] = "RemoteOverlayMacLimit" + fields["unknown_unicast_flooding_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["unknown_unicast_flooding_enabled"] = "UnknownUnicastFloodingEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.mac_discovery_profile", fields, reflect.TypeOf(MacDiscoveryProfile{}), fieldNameMap, validators) +} + +func MacDiscoveryProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MacDiscoveryProfileBindingType), reflect.TypeOf([]MacDiscoveryProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.mac_discovery_profile_list_result", fields, reflect.TypeOf(MacDiscoveryProfileListResult{}), fieldNameMap, validators) +} + +func MacLearningCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_not_learned_packets_allowed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mac_not_learned_packets_allowed"] = "MacNotLearnedPacketsAllowed" + fields["mac_not_learned_packets_dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mac_not_learned_packets_dropped"] = "MacNotLearnedPacketsDropped" + fields["macs_learned"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["macs_learned"] = "MacsLearned" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.mac_learning_counters", fields, reflect.TypeOf(MacLearningCounters{}), fieldNameMap, validators) +} + +func ManagedResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.managed_resource", fields, reflect.TypeOf(ManagedResource{}), fieldNameMap, validators) +} + +func ManagementConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["publish_fqdns"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["publish_fqdns"] = "PublishFqdns" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.management_config", fields, reflect.TypeOf(ManagementConfig{}), fieldNameMap, validators) +} + +func MetadataProxyConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["crypto_protocols"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["crypto_protocols"] = "CryptoProtocols" + fields["edge_cluster_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_path"] = "EdgeClusterPath" + fields["enable_standby_relocation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_standby_relocation"] = "EnableStandbyRelocation" + fields["preferred_edge_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["preferred_edge_paths"] = "PreferredEdgePaths" + fields["secret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secret"] = "Secret" + fields["server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_address"] = "ServerAddress" + fields["server_certificates"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_certificates"] = "ServerCertificates" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.metadata_proxy_config", fields, reflect.TypeOf(MetadataProxyConfig{}), fieldNameMap, validators) +} + +func MonitoringProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.monitoring_profile_binding_map", fields, reflect.TypeOf(MonitoringProfileBindingMap{}), fieldNameMap, validators) +} + +func MultiWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["widgets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetItemBindingType), reflect.TypeOf([]WidgetItem{}))) + fieldNameMap["widgets"] = "Widgets" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.multi_widget_configuration", fields, reflect.TypeOf(MultiWidgetConfiguration{}), fieldNameMap, validators) +} + +func NSXTConnectionInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["edge_cluster_ids"] = "EdgeClusterIds" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["transport_zone_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transport_zone_ids"] = "TransportZoneIds" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + fields["enforcement_point_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_address"] = "EnforcementPointAddress" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.NSXT_connection_info", fields, reflect.TypeOf(NSXTConnectionInfo{}), fieldNameMap, validators) +} + +func NSXVConnectionInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + fields["enforcement_point_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_address"] = "EnforcementPointAddress" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.NSXV_connection_info", fields, reflect.TypeOf(NSXVConnectionInfo{}), fieldNameMap, validators) +} + +func NdSnoopingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nd_snooping_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["nd_snooping_enabled"] = "NdSnoopingEnabled" + fields["nd_snooping_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nd_snooping_limit"] = "NdSnoopingLimit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nd_snooping_config", fields, reflect.TypeOf(NdSnoopingConfig{}), fieldNameMap, validators) +} + +func NdpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["msg_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["msg_type"] = "MsgType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ndp_header", fields, reflect.TypeOf(NdpHeader{}), fieldNameMap, validators) +} + +func NestedExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["expressions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ExpressionBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["expressions"] = "Expressions" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nested_expression", fields, reflect.TypeOf(NestedExpression{}), fieldNameMap, validators) +} + +func NestedServiceServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nested_service_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nested_service_path"] = "NestedServicePath" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nested_service_service_entry", fields, reflect.TypeOf(NestedServiceServiceEntry{}), fieldNameMap, validators) +} + +func NetworkErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["spec"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spec"] = "Spec" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.network_error", fields, reflect.TypeOf(NetworkError{}), fieldNameMap, validators) +} + +func NsxRoleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["permissions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["permissions"] = "Permissions" + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role"] = "Role" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nsx_role", fields, reflect.TypeOf(NsxRole{}), fieldNameMap, validators) +} + +func NsxTDNSForwarderStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cached_entries"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cached_entries"] = "CachedEntries" + fields["conditional_forwarder_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxTDNSForwarderZoneStatisticsBindingType), reflect.TypeOf([]NsxTDNSForwarderZoneStatistics{}))) + fieldNameMap["conditional_forwarder_statistics"] = "ConditionalForwarderStatistics" + fields["configured_cache_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["configured_cache_size"] = "ConfiguredCacheSize" + fields["default_forwarder_statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(NsxTDNSForwarderZoneStatisticsBindingType)) + fieldNameMap["default_forwarder_statistics"] = "DefaultForwarderStatistics" + fields["queries_answered_locally"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["queries_answered_locally"] = "QueriesAnsweredLocally" + fields["queries_forwarded"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["queries_forwarded"] = "QueriesForwarded" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["total_queries"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_queries"] = "TotalQueries" + fields["used_cache_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxtPerNodeUsedCacheStatisticsBindingType), reflect.TypeOf([]NsxtPerNodeUsedCacheStatistics{}))) + fieldNameMap["used_cache_statistics"] = "UsedCacheStatistics" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nsx_TDNS_forwarder_statistics", fields, reflect.TypeOf(NsxTDNSForwarderStatistics{}), fieldNameMap, validators) +} + +func NsxTDNSForwarderStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["extra_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["extra_message"] = "ExtraMessage" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nsx_TDNS_forwarder_status", fields, reflect.TypeOf(NsxTDNSForwarderStatus{}), fieldNameMap, validators) +} + +func NsxTDNSForwarderZoneStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + fields["upstream_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxtUpstreamServerStatisticsBindingType), reflect.TypeOf([]NsxtUpstreamServerStatistics{}))) + fieldNameMap["upstream_statistics"] = "UpstreamStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nsx_TDNS_forwarder_zone_statistics", fields, reflect.TypeOf(NsxTDNSForwarderZoneStatistics{}), fieldNameMap, validators) +} + +func NsxtDnsAnswerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authoritative_answers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxtDnsQueryAnswerBindingType), reflect.TypeOf([]NsxtDnsQueryAnswer{}))) + fieldNameMap["authoritative_answers"] = "AuthoritativeAnswers" + fields["dns_server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dns_server"] = "DnsServer" + fields["edge_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_node_id"] = "EdgeNodeId" + fields["non_authoritative_answers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxtDnsQueryAnswerBindingType), reflect.TypeOf([]NsxtDnsQueryAnswer{}))) + fieldNameMap["non_authoritative_answers"] = "NonAuthoritativeAnswers" + fields["raw_answer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["raw_answer"] = "RawAnswer" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nsxt_dns_answer", fields, reflect.TypeOf(NsxtDnsAnswer{}), fieldNameMap, validators) +} + +func NsxtDnsQueryAnswerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nsxt_dns_query_answer", fields, reflect.TypeOf(NsxtDnsQueryAnswer{}), fieldNameMap, validators) +} + +func NsxtPerNodeUsedCacheStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cached_entries"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cached_entries"] = "CachedEntries" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["used_cache_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["used_cache_size"] = "UsedCacheSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nsxt_per_node_used_cache_statistics", fields, reflect.TypeOf(NsxtPerNodeUsedCacheStatistics{}), fieldNameMap, validators) +} + +func NsxtUpstreamServerStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["queries_failed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["queries_failed"] = "QueriesFailed" + fields["queries_succeeded"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["queries_succeeded"] = "QueriesSucceeded" + fields["upstream_server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upstream_server"] = "UpstreamServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.nsxt_upstream_server_statistics", fields, reflect.TypeOf(NsxtUpstreamServerStatistics{}), fieldNameMap, validators) +} + +func ObjectRolePermissionGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["inheritance_disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inheritance_disabled"] = "InheritanceDisabled" + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation"] = "Operation" + fields["path_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path_prefix"] = "PathPrefix" + fields["role_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role_name"] = "RoleName" + fields["rule_disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rule_disabled"] = "RuleDisabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.object_role_permission_group", fields, reflect.TypeOf(ObjectRolePermissionGroup{}), fieldNameMap, validators) +} + +func ObjectRolePermissionGroupListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ObjectRolePermissionGroupBindingType), reflect.TypeOf([]ObjectRolePermissionGroup{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.object_role_permission_group_list_result", fields, reflect.TypeOf(ObjectRolePermissionGroupListResult{}), fieldNameMap, validators) +} + +func OpenLdapIdentitySourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["base_dn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["base_dn"] = "BaseDn" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["ldap_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdentitySourceLdapServerBindingType), reflect.TypeOf([]IdentitySourceLdapServer{}))) + fieldNameMap["ldap_servers"] = "LdapServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.open_ldap_identity_source", fields, reflect.TypeOf(OpenLdapIdentitySource{}), fieldNameMap, validators) +} + +func OverriddenResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["intent_path"] = "IntentPath" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.overridden_resource", fields, reflect.TypeOf(OverriddenResource{}), fieldNameMap, validators) +} + +func OverriddenResourceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(OverriddenResourceBindingType), reflect.TypeOf([]OverriddenResource{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.overridden_resource_list_result", fields, reflect.TypeOf(OverriddenResourceListResult{}), fieldNameMap, validators) +} + +func PacketDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["frame_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["frame_size"] = "FrameSize" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["routed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["routed"] = "Routed" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.packet_data", fields, reflect.TypeOf(PacketData{}), fieldNameMap, validators) +} + +func PacketTypeAndCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["counter"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["counter"] = "Counter" + fields["packet_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["packet_type"] = "PacketType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.packet_type_and_counter", fields, reflect.TypeOf(PacketTypeAndCounter{}), fieldNameMap, validators) +} + +func PacketsDroppedBySecurityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bpdu_filter_dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bpdu_filter_dropped"] = "BpduFilterDropped" + fields["dhcp_client_dropped_ipv4"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_client_dropped_ipv4"] = "DhcpClientDroppedIpv4" + fields["dhcp_client_dropped_ipv6"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_client_dropped_ipv6"] = "DhcpClientDroppedIpv6" + fields["dhcp_server_dropped_ipv4"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_server_dropped_ipv4"] = "DhcpServerDroppedIpv4" + fields["dhcp_server_dropped_ipv6"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_server_dropped_ipv6"] = "DhcpServerDroppedIpv6" + fields["spoof_guard_dropped"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PacketTypeAndCounterBindingType), reflect.TypeOf([]PacketTypeAndCounter{}))) + fieldNameMap["spoof_guard_dropped"] = "SpoofGuardDropped" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.packets_dropped_by_security", fields, reflect.TypeOf(PacketsDroppedBySecurity{}), fieldNameMap, validators) +} + +func PartialPatchConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enable_partial_patch"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_partial_patch"] = "EnablePartialPatch" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.partial_patch_config", fields, reflect.TypeOf(PartialPatchConfig{}), fieldNameMap, validators) +} + +func PatchResourcesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["body"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["body"] = "Body" + fields["injections"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InjectionBindingType), reflect.TypeOf([]Injection{}))) + fieldNameMap["injections"] = "Injections" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.patch_resources", fields, reflect.TypeOf(PatchResources{}), fieldNameMap, validators) +} + +func PathExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["paths"] = "Paths" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.path_expression", fields, reflect.TypeOf(PathExpression{}), fieldNameMap, validators) +} + +func PathPermissionGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["object_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["object_path"] = "ObjectPath" + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.path_permission_group", fields, reflect.TypeOf(PathPermissionGroup{}), fieldNameMap, validators) +} + +func PeerCertificateChainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(X509CertificateBindingType), reflect.TypeOf([]X509Certificate{}))) + fieldNameMap["details"] = "Details" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.peer_certificate_chain", fields, reflect.TypeOf(PeerCertificateChain{}), fieldNameMap, validators) +} + +func PendingChangesInfoNsxtBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pending_changes_flag"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pending_changes_flag"] = "PendingChangesFlag" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.pending_changes_info_nsxt", fields, reflect.TypeOf(PendingChangesInfoNsxt{}), fieldNameMap, validators) +} + +func PerStepRestoreStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.per_step_restore_status", fields, reflect.TypeOf(PerStepRestoreStatus{}), fieldNameMap, validators) +} + +func PointDefinitionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + fields["x_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["x_value"] = "XValue" + fields["y_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["y_value"] = "YValue" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.point_definition", fields, reflect.TypeOf(PointDefinition{}), fieldNameMap, validators) +} + +func PolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["internal_sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["internal_sequence_number"] = "InternalSequenceNumber" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["scheduler_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheduler_path"] = "SchedulerPath" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy", fields, reflect.TypeOf(Policy{}), fieldNameMap, validators) +} + +func PolicyAlarmResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["error_details"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyApiErrorBindingType)) + fieldNameMap["error_details"] = "ErrorDetails" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + fields["source_reference"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_reference"] = "SourceReference" + fields["source_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_site_id"] = "SourceSiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_alarm_resource", fields, reflect.TypeOf(PolicyAlarmResource{}), fieldNameMap, validators) +} + +func PolicyAlarmResourceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyAlarmResourceBindingType), reflect.TypeOf([]PolicyAlarmResource{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_alarm_resource_list_result", fields, reflect.TypeOf(PolicyAlarmResourceListResult{}), fieldNameMap, validators) +} + +func PolicyApiErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["error_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_data"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["error_data"] = "ErrorData" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["module_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["module_name"] = "ModuleName" + fields["related_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyRelatedApiErrorBindingType), reflect.TypeOf([]PolicyRelatedApiError{}))) + fieldNameMap["related_errors"] = "RelatedErrors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_api_error", fields, reflect.TypeOf(PolicyApiError{}), fieldNameMap, validators) +} + +func PolicyAttributesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["datatype"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["datatype"] = "Datatype" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["isALGType"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["isALGType"] = "IsALGType" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["sub_attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicySubAttributesBindingType), reflect.TypeOf([]PolicySubAttributes{}))) + fieldNameMap["sub_attributes"] = "SubAttributes" + fields["value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_attributes", fields, reflect.TypeOf(PolicyAttributes{}), fieldNameMap, validators) +} + +func PolicyBasedIPSecVpnSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVpnRuleBindingType), reflect.TypeOf([]IPSecVpnRule{}))) + fieldNameMap["rules"] = "Rules" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["authentication_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["authentication_mode"] = "AuthenticationMode" + fields["compliance_suite"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compliance_suite"] = "ComplianceSuite" + fields["connection_initiation_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_initiation_mode"] = "ConnectionInitiationMode" + fields["dpd_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dpd_profile_path"] = "DpdProfilePath" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ike_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_profile_path"] = "IkeProfilePath" + fields["local_endpoint_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_endpoint_path"] = "LocalEndpointPath" + fields["peer_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_address"] = "PeerAddress" + fields["peer_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_id"] = "PeerId" + fields["psk"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["psk"] = "Psk" + fields["tcp_mss_clamping"] = bindings.NewOptionalType(bindings.NewReferenceType(TcpMaximumSegmentSizeClampingBindingType)) + fieldNameMap["tcp_mss_clamping"] = "TcpMssClamping" + fields["tunnel_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_profile_path"] = "TunnelProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_based_IP_sec_vpn_session", fields, reflect.TypeOf(PolicyBasedIPSecVpnSession{}), fieldNameMap, validators) +} + +func PolicyBasedL3VpnSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L3VpnRuleBindingType), reflect.TypeOf([]L3VpnRule{}))) + fieldNameMap["rules"] = "Rules" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_based_l3_vpn_session", fields, reflect.TypeOf(PolicyBasedL3VpnSession{}), fieldNameMap, validators) +} + +func PolicyBgpNeighborStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address_families"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpAddressFamilyBindingType), reflect.TypeOf([]BgpAddressFamily{}))) + fieldNameMap["address_families"] = "AddressFamilies" + fields["announced_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["announced_capabilities"] = "AnnouncedCapabilities" + fields["connection_drop_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["connection_drop_count"] = "ConnectionDropCount" + fields["connection_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_state"] = "ConnectionState" + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_path"] = "EdgePath" + fields["established_connection_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["established_connection_count"] = "EstablishedConnectionCount" + fields["graceful_restart_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["graceful_restart_mode"] = "GracefulRestartMode" + fields["hold_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hold_time"] = "HoldTime" + fields["keep_alive_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["keep_alive_interval"] = "KeepAliveInterval" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["local_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["local_port"] = "LocalPort" + fields["messages_received"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["messages_received"] = "MessagesReceived" + fields["messages_sent"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["messages_sent"] = "MessagesSent" + fields["negotiated_capability"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["negotiated_capability"] = "NegotiatedCapability" + fields["neighbor_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_address"] = "NeighborAddress" + fields["neighbor_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_router_id"] = "NeighborRouterId" + fields["remote_as_number"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_as_number"] = "RemoteAsNumber" + fields["remote_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remote_port"] = "RemotePort" + fields["remote_site"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["remote_site"] = "RemoteSite" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["tier0_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_path"] = "Tier0Path" + fields["time_since_established"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["time_since_established"] = "TimeSinceEstablished" + fields["total_in_prefix_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_in_prefix_count"] = "TotalInPrefixCount" + fields["total_out_prefix_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_out_prefix_count"] = "TotalOutPrefixCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_bgp_neighbor_status", fields, reflect.TypeOf(PolicyBgpNeighborStatus{}), fieldNameMap, validators) +} + +func PolicyBgpNeighborsStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyBgpNeighborStatusBindingType), reflect.TypeOf([]PolicyBgpNeighborStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_bgp_neighbors_status_list_result", fields, reflect.TypeOf(PolicyBgpNeighborsStatusListResult{}), fieldNameMap, validators) +} + +func PolicyComplianceStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_updated_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_updated_time"] = "LastUpdatedTime" + fields["non_compliant_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyNonCompliantConfigBindingType), reflect.TypeOf([]PolicyNonCompliantConfig{}))) + fieldNameMap["non_compliant_configs"] = "NonCompliantConfigs" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_compliance_status", fields, reflect.TypeOf(PolicyComplianceStatus{}), fieldNameMap, validators) +} + +func PolicyConfigResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_config_resource", fields, reflect.TypeOf(PolicyConfigResource{}), fieldNameMap, validators) +} + +func PolicyContextProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyAttributesBindingType), reflect.TypeOf([]PolicyAttributes{}))) + fieldNameMap["attributes"] = "Attributes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_context_profile", fields, reflect.TypeOf(PolicyContextProfile{}), fieldNameMap, validators) +} + +func PolicyContextProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyContextProfileBindingType), reflect.TypeOf([]PolicyContextProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_context_profile_list_result", fields, reflect.TypeOf(PolicyContextProfileListResult{}), fieldNameMap, validators) +} + +func PolicyDnsAnswerPerEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_dns_answer_per_enforcement_point", fields, reflect.TypeOf(PolicyDnsAnswerPerEnforcementPoint{}), fieldNameMap, validators) +} + +func PolicyDnsForwarderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["conditional_forwarder_zone_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["conditional_forwarder_zone_paths"] = "ConditionalForwarderZonePaths" + fields["default_forwarder_zone_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_forwarder_zone_path"] = "DefaultForwarderZonePath" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["listener_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["listener_ip"] = "ListenerIp" + fields["log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["log_level"] = "LogLevel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_dns_forwarder", fields, reflect.TypeOf(PolicyDnsForwarder{}), fieldNameMap, validators) +} + +func PolicyDnsForwarderZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["dns_domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_domain_names"] = "DnsDomainNames" + fields["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_ip"] = "SourceIp" + fields["upstream_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["upstream_servers"] = "UpstreamServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_dns_forwarder_zone", fields, reflect.TypeOf(PolicyDnsForwarderZone{}), fieldNameMap, validators) +} + +func PolicyDnsForwarderZoneListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyDnsForwarderZoneBindingType), reflect.TypeOf([]PolicyDnsForwarderZone{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_dns_forwarder_zone_list_result", fields, reflect.TypeOf(PolicyDnsForwarderZoneListResult{}), fieldNameMap, validators) +} + +func PolicyDraftBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["is_auto_draft"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_auto_draft"] = "IsAutoDraft" + fields["lock_comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_comments"] = "LockComments" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["ref_draft_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ref_draft_path"] = "RefDraftPath" + fields["system_area"] = bindings.NewOptionalType(bindings.NewReferenceType(InfraBindingType)) + fieldNameMap["system_area"] = "SystemArea" + fields["user_area"] = bindings.NewOptionalType(bindings.NewReferenceType(InfraBindingType)) + fieldNameMap["user_area"] = "UserArea" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_draft", fields, reflect.TypeOf(PolicyDraft{}), fieldNameMap, validators) +} + +func PolicyDraftListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyDraftBindingType), reflect.TypeOf([]PolicyDraft{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_draft_list_result", fields, reflect.TypeOf(PolicyDraftListResult{}), fieldNameMap, validators) +} + +func PolicyEdgeClusterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["inter_site_forwarding_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inter_site_forwarding_enabled"] = "InterSiteForwardingEnabled" + fields["nsx_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsx_id"] = "NsxId" + fields["rtep_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["rtep_ips"] = "RtepIps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_edge_cluster", fields, reflect.TypeOf(PolicyEdgeCluster{}), fieldNameMap, validators) +} + +func PolicyEdgeClusterListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyEdgeClusterBindingType), reflect.TypeOf([]PolicyEdgeCluster{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_edge_cluster_list_result", fields, reflect.TypeOf(PolicyEdgeClusterListResult{}), fieldNameMap, validators) +} + +func PolicyEdgeNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["member_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_index"] = "MemberIndex" + fields["nsx_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsx_id"] = "NsxId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_edge_node", fields, reflect.TypeOf(PolicyEdgeNode{}), fieldNameMap, validators) +} + +func PolicyEdgeNodeListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyEdgeNodeBindingType), reflect.TypeOf([]PolicyEdgeNode{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_edge_node_list_result", fields, reflect.TypeOf(PolicyEdgeNodeListResult{}), fieldNameMap, validators) +} + +func PolicyExcludeListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_exclude_list", fields, reflect.TypeOf(PolicyExcludeList{}), fieldNameMap, validators) +} + +func PolicyFineTuningResourceInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fields"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyFineTuningResourceInfoDetailBindingType), reflect.TypeOf([]PolicyFineTuningResourceInfoDetail{}))) + fieldNameMap["fields"] = "Fields" + fields["resource_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_name"] = "ResourceName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_fine_tuning_resource_info", fields, reflect.TypeOf(PolicyFineTuningResourceInfo{}), fieldNameMap, validators) +} + +func PolicyFineTuningResourceInfoDetailBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["field_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field_name"] = "FieldName" + fields["sub_type"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyFineTuningResourceInfoBindingType)) + fieldNameMap["sub_type"] = "SubType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_fine_tuning_resource_info_detail", fields, reflect.TypeOf(PolicyFineTuningResourceInfoDetail{}), fieldNameMap, validators) +} + +func PolicyFirewallCPUMemThresholdsProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_path"] = "ProfilePath" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["transport_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyResourceReferenceBindingType), reflect.TypeOf([]PolicyResourceReference{}))) + fieldNameMap["transport_nodes"] = "TransportNodes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_CPU_mem_thresholds_profile_binding_map", fields, reflect.TypeOf(PolicyFirewallCPUMemThresholdsProfileBindingMap{}), fieldNameMap, validators) +} + +func PolicyFirewallCPUMemThresholdsProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyFirewallCPUMemThresholdsProfileBindingMapBindingType), reflect.TypeOf([]PolicyFirewallCPUMemThresholdsProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_CPU_mem_thresholds_profile_binding_map_list_result", fields, reflect.TypeOf(PolicyFirewallCPUMemThresholdsProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func PolicyFirewallCpuMemThresholdsProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["cpu_threshold_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cpu_threshold_percentage"] = "CpuThresholdPercentage" + fields["mem_threshold_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mem_threshold_percentage"] = "MemThresholdPercentage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_cpu_mem_thresholds_profile", fields, reflect.TypeOf(PolicyFirewallCpuMemThresholdsProfile{}), fieldNameMap, validators) +} + +func PolicyFirewallCpuMemThresholdsProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyFirewallCpuMemThresholdsProfileBindingType), reflect.TypeOf([]PolicyFirewallCpuMemThresholdsProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_cpu_mem_thresholds_profile_list_result", fields, reflect.TypeOf(PolicyFirewallCpuMemThresholdsProfileListResult{}), fieldNameMap, validators) +} + +func PolicyFirewallFloodProtectionProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_path"] = "ProfilePath" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_flood_protection_profile_binding_map", fields, reflect.TypeOf(PolicyFirewallFloodProtectionProfileBindingMap{}), fieldNameMap, validators) +} + +func PolicyFirewallFloodProtectionProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyFirewallFloodProtectionProfileBindingMapBindingType), reflect.TypeOf([]PolicyFirewallFloodProtectionProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_flood_protection_profile_binding_map_list_result", fields, reflect.TypeOf(PolicyFirewallFloodProtectionProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func PolicyFirewallSchedulerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["days"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["days"] = "Days" + fields["end_date"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["end_date"] = "EndDate" + fields["end_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["end_time"] = "EndTime" + fields["recurring"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["recurring"] = "Recurring" + fields["start_date"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start_date"] = "StartDate" + fields["start_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start_time"] = "StartTime" + fields["time_interval"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyTimeIntervalValueBindingType), reflect.TypeOf([]PolicyTimeIntervalValue{}))) + fieldNameMap["time_interval"] = "TimeInterval" + fields["timezone"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timezone"] = "Timezone" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_scheduler", fields, reflect.TypeOf(PolicyFirewallScheduler{}), fieldNameMap, validators) +} + +func PolicyFirewallSchedulerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyFirewallSchedulerBindingType), reflect.TypeOf([]PolicyFirewallScheduler{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_scheduler_list_result", fields, reflect.TypeOf(PolicyFirewallSchedulerListResult{}), fieldNameMap, validators) +} + +func PolicyFirewallSessionTimerProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["icmp_error_reply"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_error_reply"] = "IcmpErrorReply" + fields["icmp_first_packet"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_first_packet"] = "IcmpFirstPacket" + fields["tcp_closed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_closed"] = "TcpClosed" + fields["tcp_closing"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_closing"] = "TcpClosing" + fields["tcp_established"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_established"] = "TcpEstablished" + fields["tcp_finwait"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_finwait"] = "TcpFinwait" + fields["tcp_first_packet"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_first_packet"] = "TcpFirstPacket" + fields["tcp_opening"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_opening"] = "TcpOpening" + fields["udp_first_packet"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_first_packet"] = "UdpFirstPacket" + fields["udp_multiple"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_multiple"] = "UdpMultiple" + fields["udp_single"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_single"] = "UdpSingle" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_session_timer_profile", fields, reflect.TypeOf(PolicyFirewallSessionTimerProfile{}), fieldNameMap, validators) +} + +func PolicyFirewallSessionTimerProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["firewall_session_timer_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["firewall_session_timer_profile_path"] = "FirewallSessionTimerProfilePath" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_session_timer_profile_binding_map", fields, reflect.TypeOf(PolicyFirewallSessionTimerProfileBindingMap{}), fieldNameMap, validators) +} + +func PolicyFirewallSessionTimerProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyFirewallSessionTimerProfileBindingMapBindingType), reflect.TypeOf([]PolicyFirewallSessionTimerProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_session_timer_profile_binding_map_list_result", fields, reflect.TypeOf(PolicyFirewallSessionTimerProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func PolicyFirewallSessionTimerProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyFirewallSessionTimerProfileBindingType), reflect.TypeOf([]PolicyFirewallSessionTimerProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_firewall_session_timer_profile_list_result", fields, reflect.TypeOf(PolicyFirewallSessionTimerProfileListResult{}), fieldNameMap, validators) +} + +func PolicyGroupIPMembersListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_group_IP_members_list_result", fields, reflect.TypeOf(PolicyGroupIPMembersListResult{}), fieldNameMap, validators) +} + +func PolicyGroupMemberDetailsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_group_member_details", fields, reflect.TypeOf(PolicyGroupMemberDetails{}), fieldNameMap, validators) +} + +func PolicyGroupMembersListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyGroupMemberDetailsBindingType), reflect.TypeOf([]PolicyGroupMemberDetails{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_group_members_list_result", fields, reflect.TypeOf(PolicyGroupMembersListResult{}), fieldNameMap, validators) +} + +func PolicyIPAddressInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address_value"] = "AddressValue" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_IP_address_info", fields, reflect.TypeOf(PolicyIPAddressInfo{}), fieldNameMap, validators) +} + +func PolicyIgmpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["last_member_query_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_member_query_interval"] = "LastMemberQueryInterval" + fields["query_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["query_interval"] = "QueryInterval" + fields["query_max_response_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["query_max_response_time"] = "QueryMaxResponseTime" + fields["robustness_variable"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["robustness_variable"] = "RobustnessVariable" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_igmp_profile", fields, reflect.TypeOf(PolicyIgmpProfile{}), fieldNameMap, validators) +} + +func PolicyInsertParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["anchor_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["anchor_path"] = "AnchorPath" + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_insert_parameters", fields, reflect.TypeOf(PolicyInsertParameters{}), fieldNameMap, validators) +} + +func PolicyInterfaceStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fields["per_node_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterPortStatisticsPerNodeBindingType), reflect.TypeOf([]LogicalRouterPortStatisticsPerNode{}))) + fieldNameMap["per_node_statistics"] = "PerNodeStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_interface_statistics", fields, reflect.TypeOf(PolicyInterfaceStatistics{}), fieldNameMap, validators) +} + +func PolicyInterfaceStatisticsSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fields["interface_policy_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_policy_path"] = "InterfacePolicyPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_interface_statistics_summary", fields, reflect.TypeOf(PolicyInterfaceStatisticsSummary{}), fieldNameMap, validators) +} + +func PolicyLabelBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["refs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["refs"] = "Refs" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_label", fields, reflect.TypeOf(PolicyLabel{}), fieldNameMap, validators) +} + +func PolicyLabelListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyLabelBindingType), reflect.TypeOf([]PolicyLabel{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_label_list_result", fields, reflect.TypeOf(PolicyLabelListResult{}), fieldNameMap, validators) +} + +func PolicyLbMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_lb_monitor_profile", fields, reflect.TypeOf(PolicyLbMonitorProfile{}), fieldNameMap, validators) +} + +func PolicyLbPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_lb_persistence_profile", fields, reflect.TypeOf(PolicyLbPersistenceProfile{}), fieldNameMap, validators) +} + +func PolicyLbPoolAccessBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["algorithm"] = "Algorithm" + fields["ip_port_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPAddressPortPairBindingType), reflect.TypeOf([]IPAddressPortPair{}))) + fieldNameMap["ip_port_list"] = "IpPortList" + fields["lb_monitor_profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_monitor_profile"] = "LbMonitorProfile" + fields["pool_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["pool_port"] = "PoolPort" + fields["source_nat"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_nat"] = "SourceNat" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_lb_pool_access", fields, reflect.TypeOf(PolicyLbPoolAccess{}), fieldNameMap, validators) +} + +func PolicyLbRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["host_match"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_match"] = "HostMatch" + fields["lb_virtual_server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_virtual_server"] = "LbVirtualServer" + fields["match_strategy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_strategy"] = "MatchStrategy" + fields["path_match"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path_match"] = "PathMatch" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_lb_rule", fields, reflect.TypeOf(PolicyLbRule{}), fieldNameMap, validators) +} + +func PolicyLbVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lb_persistence_profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + fields["ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ports"] = "Ports" + fields["router_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_path"] = "RouterPath" + fields["traffic_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traffic_source"] = "TrafficSource" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_lb_virtual_server", fields, reflect.TypeOf(PolicyLbVirtualServer{}), fieldNameMap, validators) +} + +func PolicyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_list_result", fields, reflect.TypeOf(PolicyListResult{}), fieldNameMap, validators) +} + +func PolicyMulticastConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["igmp_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["igmp_profile_path"] = "IgmpProfilePath" + fields["pim_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pim_profile_path"] = "PimProfilePath" + fields["replication_multicast_range"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["replication_multicast_range"] = "ReplicationMulticastRange" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_multicast_config", fields, reflect.TypeOf(PolicyMulticastConfig{}), fieldNameMap, validators) +} + +func PolicyNATRuleCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_sessions"] = "ActiveSessions" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_NAT_rule_counters", fields, reflect.TypeOf(PolicyNATRuleCounters{}), fieldNameMap, validators) +} + +func PolicyNatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["nat_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nat_type"] = "NatType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat", fields, reflect.TypeOf(PolicyNat{}), fieldNameMap, validators) +} + +func PolicyNatRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["destination_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_network"] = "DestinationNetwork" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["firewall_match"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["firewall_match"] = "FirewallMatch" + fields["logging"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logging"] = "Logging" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["service"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service"] = "Service" + fields["source_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_network"] = "SourceNetwork" + fields["translated_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["translated_network"] = "TranslatedNetwork" + fields["translated_ports"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["translated_ports"] = "TranslatedPorts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat_rule", fields, reflect.TypeOf(PolicyNatRule{}), fieldNameMap, validators) +} + +func PolicyNatRuleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyNatRuleBindingType), reflect.TypeOf([]PolicyNatRule{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat_rule_list_result", fields, reflect.TypeOf(PolicyNatRuleListResult{}), fieldNameMap, validators) +} + +func PolicyNatRuleStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_sessions"] = "ActiveSessions" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["warning_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["warning_message"] = "WarningMessage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat_rule_statistics", fields, reflect.TypeOf(PolicyNatRuleStatistics{}), fieldNameMap, validators) +} + +func PolicyNatRuleStatisticsListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyNatRuleStatisticsPerEnforcementPointBindingType), reflect.TypeOf([]PolicyNatRuleStatisticsPerEnforcementPoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat_rule_statistics_list_result", fields, reflect.TypeOf(PolicyNatRuleStatisticsListResult{}), fieldNameMap, validators) +} + +func PolicyNatRuleStatisticsPerEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rule_path"] = "RulePath" + fields["rule_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyNatRuleStatisticsBindingType), reflect.TypeOf([]PolicyNatRuleStatistics{}))) + fieldNameMap["rule_statistics"] = "RuleStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat_rule_statistics_per_enforcement_point", fields, reflect.TypeOf(PolicyNatRuleStatisticsPerEnforcementPoint{}), fieldNameMap, validators) +} + +func PolicyNatRuleStatisticsPerLogicalRouterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["per_node_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyNatRuleStatisticsPerTransportNodeBindingType), reflect.TypeOf([]PolicyNatRuleStatisticsPerTransportNode{}))) + fieldNameMap["per_node_statistics"] = "PerNodeStatistics" + fields["router_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_path"] = "RouterPath" + fields["statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyNATRuleCountersBindingType)) + fieldNameMap["statistics"] = "Statistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat_rule_statistics_per_logical_router", fields, reflect.TypeOf(PolicyNatRuleStatisticsPerLogicalRouter{}), fieldNameMap, validators) +} + +func PolicyNatRuleStatisticsPerLogicalRouterListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyNatRuleStatisticsPerLogicalRouterBindingType), reflect.TypeOf([]PolicyNatRuleStatisticsPerLogicalRouter{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat_rule_statistics_per_logical_router_list_result", fields, reflect.TypeOf(PolicyNatRuleStatisticsPerLogicalRouterListResult{}), fieldNameMap, validators) +} + +func PolicyNatRuleStatisticsPerTransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_sessions"] = "ActiveSessions" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["transport_node_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_path"] = "TransportNodePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_nat_rule_statistics_per_transport_node", fields, reflect.TypeOf(PolicyNatRuleStatisticsPerTransportNode{}), fieldNameMap, validators) +} + +func PolicyNonCompliantConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["affected_resources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyResourceReferenceBindingType), reflect.TypeOf([]PolicyResourceReference{}))) + fieldNameMap["affected_resources"] = "AffectedResources" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["non_compliance_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["non_compliance_code"] = "NonComplianceCode" + fields["reported_by"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyResourceReferenceBindingType)) + fieldNameMap["reported_by"] = "ReportedBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_non_compliant_config", fields, reflect.TypeOf(PolicyNonCompliantConfig{}), fieldNameMap, validators) +} + +func PolicyPimProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["rp_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rp_address"] = "RpAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_pim_profile", fields, reflect.TypeOf(PolicyPimProfile{}), fieldNameMap, validators) +} + +func PolicyRealizedResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["alarms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyAlarmResourceBindingType), reflect.TypeOf([]PolicyAlarmResource{}))) + fieldNameMap["alarms"] = "Alarms" + fields["intent_reference"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["intent_reference"] = "IntentReference" + fields["realization_api"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["realization_api"] = "RealizationApi" + fields["realization_specific_identifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["realization_specific_identifier"] = "RealizationSpecificIdentifier" + fields["runtime_error"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_error"] = "RuntimeError" + fields["runtime_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_status"] = "RuntimeStatus" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_realized_resource", fields, reflect.TypeOf(PolicyRealizedResource{}), fieldNameMap, validators) +} + +func PolicyRelatedApiErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["error_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_data"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["error_data"] = "ErrorData" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["module_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["module_name"] = "ModuleName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_related_api_error", fields, reflect.TypeOf(PolicyRelatedApiError{}), fieldNameMap, validators) +} + +func PolicyResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_resource", fields, reflect.TypeOf(PolicyResource{}), fieldNameMap, validators) +} + +func PolicyResourceReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_resource_reference", fields, reflect.TypeOf(PolicyResourceReference{}), fieldNameMap, validators) +} + +func PolicyResourceReferenceForEPBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_resource_reference_for_EP", fields, reflect.TypeOf(PolicyResourceReferenceForEP{}), fieldNameMap, validators) +} + +func PolicyResourceReferenceForEPListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyResourceReferenceForEPBindingType), reflect.TypeOf([]PolicyResourceReferenceForEP{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_resource_reference_for_EP_list_result", fields, reflect.TypeOf(PolicyResourceReferenceForEPListResult{}), fieldNameMap, validators) +} + +func PolicyResourceReferenceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyResourceReferenceBindingType), reflect.TypeOf([]PolicyResourceReference{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_resource_reference_list_result", fields, reflect.TypeOf(PolicyResourceReferenceListResult{}), fieldNameMap, validators) +} + +func PolicyRuntimeAlarmBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_details"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyApiErrorBindingType)) + fieldNameMap["error_details"] = "ErrorDetails" + fields["error_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_id"] = "ErrorId" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_runtime_alarm", fields, reflect.TypeOf(PolicyRuntimeAlarm{}), fieldNameMap, validators) +} + +func PolicyRuntimeInfoPerEPBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alarm"] = bindings.NewOptionalType(bindings.NewReferenceType(PolicyRuntimeAlarmBindingType)) + fieldNameMap["alarm"] = "Alarm" + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_runtime_info_per_EP", fields, reflect.TypeOf(PolicyRuntimeInfoPerEP{}), fieldNameMap, validators) +} + +func PolicyServiceChainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["failure_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_policy"] = "FailurePolicy" + fields["forward_path_service_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["forward_path_service_profiles"] = "ForwardPathServiceProfiles" + fields["path_selection_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path_selection_policy"] = "PathSelectionPolicy" + fields["reverse_path_service_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["reverse_path_service_profiles"] = "ReversePathServiceProfiles" + fields["service_segment_path"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["service_segment_path"] = "ServiceSegmentPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_service_chain", fields, reflect.TypeOf(PolicyServiceChain{}), fieldNameMap, validators) +} + +func PolicyServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["deployment_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_mode"] = "DeploymentMode" + fields["partner_service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["partner_service_name"] = "PartnerServiceName" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + fields["attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AttributeBindingType), reflect.TypeOf([]Attribute{}))) + fieldNameMap["attributes"] = "Attributes" + fields["compute_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_id"] = "ComputeId" + fields["context_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["context_id"] = "ContextId" + fields["deployment_spec_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_spec_name"] = "DeploymentSpecName" + fields["deployment_template_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_template_name"] = "DeploymentTemplateName" + fields["failure_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_policy"] = "FailurePolicy" + fields["primary_gateway_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["primary_gateway_address"] = "PrimaryGatewayAddress" + fields["primary_interface_mgmt_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["primary_interface_mgmt_ip"] = "PrimaryInterfaceMgmtIp" + fields["primary_interface_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["primary_interface_network"] = "PrimaryInterfaceNetwork" + fields["primary_portgroup_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["primary_portgroup_id"] = "PrimaryPortgroupId" + fields["primary_subnet_mask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["primary_subnet_mask"] = "PrimarySubnetMask" + fields["secondary_gateway_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secondary_gateway_address"] = "SecondaryGatewayAddress" + fields["secondary_interface_mgmt_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secondary_interface_mgmt_ip"] = "SecondaryInterfaceMgmtIp" + fields["secondary_interface_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secondary_interface_network"] = "SecondaryInterfaceNetwork" + fields["secondary_portgroup_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secondary_portgroup_id"] = "SecondaryPortgroupId" + fields["secondary_subnet_mask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secondary_subnet_mask"] = "SecondarySubnetMask" + fields["storage_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["storage_id"] = "StorageId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_service_instance", fields, reflect.TypeOf(PolicyServiceInstance{}), fieldNameMap, validators) +} + +func PolicyServiceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AttributeBindingType), reflect.TypeOf([]Attribute{}))) + fieldNameMap["attributes"] = "Attributes" + fields["redirection_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirection_action"] = "RedirectionAction" + fields["vendor_template_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vendor_template_key"] = "VendorTemplateKey" + fields["vendor_template_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vendor_template_name"] = "VendorTemplateName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_service_profile", fields, reflect.TypeOf(PolicyServiceProfile{}), fieldNameMap, validators) +} + +func PolicySubAttributesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["datatype"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["datatype"] = "Datatype" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_sub_attributes", fields, reflect.TypeOf(PolicySubAttributes{}), fieldNameMap, validators) +} + +func PolicyTimeIntervalValueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["end_interval"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["end_interval"] = "EndInterval" + fields["start_interval"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start_interval"] = "StartInterval" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_time_interval_value", fields, reflect.TypeOf(PolicyTimeIntervalValue{}), fieldNameMap, validators) +} + +func PolicyTransportZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["nsx_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsx_id"] = "NsxId" + fields["tz_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tz_type"] = "TzType" + fields["uplink_teaming_policy_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_teaming_policy_names"] = "UplinkTeamingPolicyNames" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_transport_zone", fields, reflect.TypeOf(PolicyTransportZone{}), fieldNameMap, validators) +} + +func PolicyTransportZoneListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyTransportZoneBindingType), reflect.TypeOf([]PolicyTransportZone{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_transport_zone_list_result", fields, reflect.TypeOf(PolicyTransportZoneListResult{}), fieldNameMap, validators) +} + +func PolicyUrlCategorizationConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["context_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["context_profiles"] = "ContextProfiles" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["update_frequency"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["update_frequency"] = "UpdateFrequency" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.policy_url_categorization_config", fields, reflect.TypeOf(PolicyUrlCategorizationConfig{}), fieldNameMap, validators) +} + +func PoolMemberSettingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port"] = "Port" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.pool_member_setting", fields, reflect.TypeOf(PoolMemberSetting{}), fieldNameMap, validators) +} + +func PortAddressBindingEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["vlan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan_id"] = "VlanId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_address_binding_entry", fields, reflect.TypeOf(PortAddressBindingEntry{}), fieldNameMap, validators) +} + +func PortAttachmentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocate_addresses"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["allocate_addresses"] = "AllocateAddresses" + fields["app_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["app_id"] = "AppId" + fields["context_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["context_id"] = "ContextId" + fields["context_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["context_type"] = "ContextType" + fields["hyperbus_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hyperbus_mode"] = "HyperbusMode" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["traffic_tag"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["traffic_tag"] = "TrafficTag" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_attachment", fields, reflect.TypeOf(PortAttachment{}), fieldNameMap, validators) +} + +func PortDiscoveryProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ip_discovery_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_discovery_profile_path"] = "IpDiscoveryProfilePath" + fields["mac_discovery_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_discovery_profile_path"] = "MacDiscoveryProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_discovery_profile_binding_map", fields, reflect.TypeOf(PortDiscoveryProfileBindingMap{}), fieldNameMap, validators) +} + +func PortDiscoveryProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortDiscoveryProfileBindingMapBindingType), reflect.TypeOf([]PortDiscoveryProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_discovery_profile_binding_map_list_result", fields, reflect.TypeOf(PortDiscoveryProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func PortMirroringProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["destination_group"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_group"] = "DestinationGroup" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["encapsulation_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["encapsulation_type"] = "EncapsulationType" + fields["erspan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["erspan_id"] = "ErspanId" + fields["gre_key"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["gre_key"] = "GreKey" + fields["profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_type"] = "ProfileType" + fields["snap_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["snap_length"] = "SnapLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_mirroring_profile", fields, reflect.TypeOf(PortMirroringProfile{}), fieldNameMap, validators) +} + +func PortMirroringProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortMirroringProfileBindingType), reflect.TypeOf([]PortMirroringProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_mirroring_profile_list_result", fields, reflect.TypeOf(PortMirroringProfileListResult{}), fieldNameMap, validators) +} + +func PortMonitoringProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ipfix_l2_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipfix_l2_profile_path"] = "IpfixL2ProfilePath" + fields["port_mirroring_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port_mirroring_profile_path"] = "PortMirroringProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_monitoring_profile_binding_map", fields, reflect.TypeOf(PortMonitoringProfileBindingMap{}), fieldNameMap, validators) +} + +func PortMonitoringProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortMonitoringProfileBindingMapBindingType), reflect.TypeOf([]PortMonitoringProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_monitoring_profile_binding_map_list_result", fields, reflect.TypeOf(PortMonitoringProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func PortQosProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["qos_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["qos_profile_path"] = "QosProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_qos_profile_binding_map", fields, reflect.TypeOf(PortQosProfileBindingMap{}), fieldNameMap, validators) +} + +func PortQosProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortQosProfileBindingMapBindingType), reflect.TypeOf([]PortQosProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_qos_profile_binding_map_list_result", fields, reflect.TypeOf(PortQosProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func PortSecurityProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["segment_security_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_security_profile_path"] = "SegmentSecurityProfilePath" + fields["spoofguard_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spoofguard_profile_path"] = "SpoofguardProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_security_profile_binding_map", fields, reflect.TypeOf(PortSecurityProfileBindingMap{}), fieldNameMap, validators) +} + +func PortSecurityProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortSecurityProfileBindingMapBindingType), reflect.TypeOf([]PortSecurityProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.port_security_profile_binding_map_list_result", fields, reflect.TypeOf(PortSecurityProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func PrefixEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["ge"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ge"] = "Ge" + fields["le"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["le"] = "Le" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.prefix_entry", fields, reflect.TypeOf(PrefixEntry{}), fieldNameMap, validators) +} + +func PrefixListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["prefixes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PrefixEntryBindingType), reflect.TypeOf([]PrefixEntry{}))) + fieldNameMap["prefixes"] = "Prefixes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.prefix_list", fields, reflect.TypeOf(PrefixList{}), fieldNameMap, validators) +} + +func PrefixListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PrefixListBindingType), reflect.TypeOf([]PrefixList{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.prefix_list_result", fields, reflect.TypeOf(PrefixListResult{}), fieldNameMap, validators) +} + +func ProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_path"] = "ProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.profile_binding_map", fields, reflect.TypeOf(ProfileBindingMap{}), fieldNameMap, validators) +} + +func PropertyItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["heading"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["heading"] = "Heading" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["render_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RenderConfigurationBindingType), reflect.TypeOf([]RenderConfiguration{}))) + fieldNameMap["render_configuration"] = "RenderConfiguration" + fields["separator"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["separator"] = "Separator" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.property_item", fields, reflect.TypeOf(PropertyItem{}), fieldNameMap, validators) +} + +func QosBaseRateLimiterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.qos_base_rate_limiter", fields, reflect.TypeOf(QosBaseRateLimiter{}), fieldNameMap, validators) +} + +func QosDscpBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.qos_dscp", fields, reflect.TypeOf(QosDscp{}), fieldNameMap, validators) +} + +func QosProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["class_of_service"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["class_of_service"] = "ClassOfService" + fields["dscp"] = bindings.NewOptionalType(bindings.NewReferenceType(QosDscpBindingType)) + fieldNameMap["dscp"] = "Dscp" + fields["shaper_configurations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(QosBaseRateLimiterBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["shaper_configurations"] = "ShaperConfigurations" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.qos_profile", fields, reflect.TypeOf(QosProfile{}), fieldNameMap, validators) +} + +func QosProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.qos_profile_binding_map", fields, reflect.TypeOf(QosProfileBindingMap{}), fieldNameMap, validators) +} + +func QosProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(QosProfileBindingType), reflect.TypeOf([]QosProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.qos_profile_list_result", fields, reflect.TypeOf(QosProfileListResult{}), fieldNameMap, validators) +} + +func RAConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["hop_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hop_limit"] = "HopLimit" + fields["prefix_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_lifetime"] = "PrefixLifetime" + fields["prefix_preferred_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_preferred_time"] = "PrefixPreferredTime" + fields["ra_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ra_interval"] = "RaInterval" + fields["router_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["router_lifetime"] = "RouterLifetime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.RA_config", fields, reflect.TypeOf(RAConfig{}), fieldNameMap, validators) +} + +func RaDNSConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_server"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_server"] = "DnsServer" + fields["dns_server_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dns_server_lifetime"] = "DnsServerLifetime" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_name"] = "DomainName" + fields["domain_name_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["domain_name_lifetime"] = "DomainNameLifetime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ra_DNS_config", fields, reflect.TypeOf(RaDNSConfig{}), fieldNameMap, validators) +} + +func ReactionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ActionBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["actions"] = "Actions" + fields["events"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EventBindingType), reflect.TypeOf([]Event{}))) + fieldNameMap["events"] = "Events" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.reaction", fields, reflect.TypeOf(Reaction{}), fieldNameMap, validators) +} + +func RealizedVirtualMachineBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["alarms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyAlarmResourceBindingType), reflect.TypeOf([]PolicyAlarmResource{}))) + fieldNameMap["alarms"] = "Alarms" + fields["intent_reference"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["intent_reference"] = "IntentReference" + fields["realization_api"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["realization_api"] = "RealizationApi" + fields["realization_specific_identifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["realization_specific_identifier"] = "RealizationSpecificIdentifier" + fields["runtime_error"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_error"] = "RuntimeError" + fields["runtime_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_status"] = "RuntimeStatus" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["compute_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["compute_ids"] = "ComputeIds" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["local_id_on_host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_id_on_host"] = "LocalIdOnHost" + fields["power_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["power_state"] = "PowerState" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.realized_virtual_machine", fields, reflect.TypeOf(RealizedVirtualMachine{}), fieldNameMap, validators) +} + +func RealizedVirtualMachineListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RealizedVirtualMachineBindingType), reflect.TypeOf([]RealizedVirtualMachine{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.realized_virtual_machine_list_result", fields, reflect.TypeOf(RealizedVirtualMachineListResult{}), fieldNameMap, validators) +} + +func RedirectionPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["internal_sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["internal_sequence_number"] = "InternalSequenceNumber" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["scheduler_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheduler_path"] = "SchedulerPath" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + fields["north_south"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["north_south"] = "NorthSouth" + fields["redirect_to"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["redirect_to"] = "RedirectTo" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RedirectionRuleBindingType), reflect.TypeOf([]RedirectionRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.redirection_policy", fields, reflect.TypeOf(RedirectionPolicy{}), fieldNameMap, validators) +} + +func RedirectionRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["destination_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_groups"] = "DestinationGroups" + fields["destinations_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destinations_excluded"] = "DestinationsExcluded" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["profiles"] = "Profiles" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_id"] = "RuleId" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["service_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["service_entries"] = "ServiceEntries" + fields["services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["services"] = "Services" + fields["source_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_groups"] = "SourceGroups" + fields["sources_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sources_excluded"] = "SourcesExcluded" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.redirection_rule", fields, reflect.TypeOf(RedirectionRule{}), fieldNameMap, validators) +} + +func RegistrationTokenBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["roles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["roles"] = "Roles" + fields["token"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["token"] = "Token" + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user"] = "User" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.registration_token", fields, reflect.TypeOf(RegistrationToken{}), fieldNameMap, validators) +} + +func RelatedApiErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["error_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_data"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["error_data"] = "ErrorData" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["module_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["module_name"] = "ModuleName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.related_api_error", fields, reflect.TypeOf(RelatedApiError{}), fieldNameMap, validators) +} + +func RelatedAttributeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attribute"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute"] = "Attribute" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.related_attribute", fields, reflect.TypeOf(RelatedAttribute{}), fieldNameMap, validators) +} + +func RelatedAttributeConditionalExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewReferenceType(ConditionalValueConstraintExpressionBindingType)) + fieldNameMap["condition"] = "Condition" + fields["related_attribute"] = bindings.NewOptionalType(bindings.NewReferenceType(RelatedAttributeBindingType)) + fieldNameMap["related_attribute"] = "RelatedAttribute" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.related_attribute_conditional_expression", fields, reflect.TypeOf(RelatedAttributeConditionalExpression{}), fieldNameMap, validators) +} + +func RemoteFileServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["directory_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["directory_path"] = "DirectoryPath" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["protocol"] = bindings.NewOptionalType(bindings.NewReferenceType(FileTransferProtocolBindingType)) + fieldNameMap["protocol"] = "Protocol" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.remote_file_server", fields, reflect.TypeOf(RemoteFileServer{}), fieldNameMap, validators) +} + +func RemoteServerFingerprintBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["ssh_fingerprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssh_fingerprint"] = "SshFingerprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.remote_server_fingerprint", fields, reflect.TypeOf(RemoteServerFingerprint{}), fieldNameMap, validators) +} + +func RemoteServerFingerprintRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.remote_server_fingerprint_request", fields, reflect.TypeOf(RemoteServerFingerprintRequest{}), fieldNameMap, validators) +} + +func RenderConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["color"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["color"] = "Color" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["display_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_value"] = "DisplayValue" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.render_configuration", fields, reflect.TypeOf(RenderConfiguration{}), fieldNameMap, validators) +} + +func ResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource", fields, reflect.TypeOf(Resource{}), fieldNameMap, validators) +} + +func ResourceFieldPointerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["field_pointer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field_pointer"] = "FieldPointer" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource_field_pointer", fields, reflect.TypeOf(ResourceFieldPointer{}), fieldNameMap, validators) +} + +func ResourceInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["resource_ids"] = "ResourceIds" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource_info", fields, reflect.TypeOf(ResourceInfo{}), fieldNameMap, validators) +} + +func ResourceInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PolicyFineTuningResourceInfoBindingType), reflect.TypeOf([]PolicyFineTuningResourceInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource_info_list_result", fields, reflect.TypeOf(ResourceInfoListResult{}), fieldNameMap, validators) +} + +func ResourceLinkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["href"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["href"] = "Href" + fields["rel"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rel"] = "Rel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource_link", fields, reflect.TypeOf(ResourceLink{}), fieldNameMap, validators) +} + +func ResourceOperationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["operation_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["operation_types"] = "OperationTypes" + fields["resource_pointer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_pointer"] = "ResourcePointer" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource_operation", fields, reflect.TypeOf(ResourceOperation{}), fieldNameMap, validators) +} + +func ResourceReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource_reference", fields, reflect.TypeOf(ResourceReference{}), fieldNameMap, validators) +} + +func ResourceTagStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["resource_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_display_name"] = "ResourceDisplayName" + fields["resource_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_id"] = "ResourceId" + fields["tag_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag_status"] = "TagStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource_tag_status", fields, reflect.TypeOf(ResourceTagStatus{}), fieldNameMap, validators) +} + +func ResourceTypeTagStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_tag_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceTagStatusBindingType), reflect.TypeOf([]ResourceTagStatus{}))) + fieldNameMap["resource_tag_status"] = "ResourceTagStatus" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.resource_type_tag_status", fields, reflect.TypeOf(ResourceTypeTagStatus{}), fieldNameMap, validators) +} + +func RestoreConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["passphrase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passphrase"] = "Passphrase" + fields["remote_file_server"] = bindings.NewOptionalType(bindings.NewReferenceType(RemoteFileServerBindingType)) + fieldNameMap["remote_file_server"] = "RemoteFileServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.restore_configuration", fields, reflect.TypeOf(RestoreConfiguration{}), fieldNameMap, validators) +} + +func RestoreStepBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["status"] = bindings.NewOptionalType(bindings.NewReferenceType(PerStepRestoreStatusBindingType)) + fieldNameMap["status"] = "Status" + fields["step_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["step_number"] = "StepNumber" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.restore_step", fields, reflect.TypeOf(RestoreStep{}), fieldNameMap, validators) +} + +func RevisionedResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.revisioned_resource", fields, reflect.TypeOf(RevisionedResource{}), fieldNameMap, validators) +} + +func RoleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role"] = "Role" + fields["role_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role_display_name"] = "RoleDisplayName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.role", fields, reflect.TypeOf(Role{}), fieldNameMap, validators) +} + +func RoleBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["roles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoleBindingType), reflect.TypeOf([]Role{}))) + fieldNameMap["roles"] = "Roles" + fields["stale"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["stale"] = "Stale" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.role_binding", fields, reflect.TypeOf(RoleBinding{}), fieldNameMap, validators) +} + +func RoleBindingListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoleBindingBindingType), reflect.TypeOf([]RoleBinding{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.role_binding_list_result", fields, reflect.TypeOf(RoleBindingListResult{}), fieldNameMap, validators) +} + +func RoleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoleBindingType), reflect.TypeOf([]Role{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.role_list_result", fields, reflect.TypeOf(RoleListResult{}), fieldNameMap, validators) +} + +func RoleWithFeaturesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["features"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FeaturePermissionBindingType), reflect.TypeOf([]FeaturePermission{}))) + fieldNameMap["features"] = "Features" + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role"] = "Role" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.role_with_features", fields, reflect.TypeOf(RoleWithFeatures{}), fieldNameMap, validators) +} + +func RoleWithFeaturesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoleWithFeaturesBindingType), reflect.TypeOf([]RoleWithFeatures{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.role_with_features_list_result", fields, reflect.TypeOf(RoleWithFeaturesListResult{}), fieldNameMap, validators) +} + +func RouteAdvertisementRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["prefix_operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["prefix_operator"] = "PrefixOperator" + fields["route_advertisement_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["route_advertisement_types"] = "RouteAdvertisementTypes" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["subnets"] = "Subnets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.route_advertisement_rule", fields, reflect.TypeOf(RouteAdvertisementRule{}), fieldNameMap, validators) +} + +func RouteAggregationEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["prefix"] = "Prefix" + fields["summary_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["summary_only"] = "SummaryOnly" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.route_aggregation_entry", fields, reflect.TypeOf(RouteAggregationEntry{}), fieldNameMap, validators) +} + +func RouteBasedIPSecVpnSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["force_whitelisting"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["force_whitelisting"] = "ForceWhitelisting" + fields["tunnel_interfaces"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVpnTunnelInterfaceBindingType), reflect.TypeOf([]IPSecVpnTunnelInterface{}))) + fieldNameMap["tunnel_interfaces"] = "TunnelInterfaces" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["authentication_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["authentication_mode"] = "AuthenticationMode" + fields["compliance_suite"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compliance_suite"] = "ComplianceSuite" + fields["connection_initiation_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_initiation_mode"] = "ConnectionInitiationMode" + fields["dpd_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dpd_profile_path"] = "DpdProfilePath" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ike_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_profile_path"] = "IkeProfilePath" + fields["local_endpoint_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_endpoint_path"] = "LocalEndpointPath" + fields["peer_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_address"] = "PeerAddress" + fields["peer_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_id"] = "PeerId" + fields["psk"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["psk"] = "Psk" + fields["tcp_mss_clamping"] = bindings.NewOptionalType(bindings.NewReferenceType(TcpMaximumSegmentSizeClampingBindingType)) + fieldNameMap["tcp_mss_clamping"] = "TcpMssClamping" + fields["tunnel_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_profile_path"] = "TunnelProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.route_based_IP_sec_vpn_session", fields, reflect.TypeOf(RouteBasedIPSecVpnSession{}), fieldNameMap, validators) +} + +func RouteBasedL3VpnSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["default_rule_logging"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["default_rule_logging"] = "DefaultRuleLogging" + fields["force_whitelisting"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["force_whitelisting"] = "ForceWhitelisting" + fields["routing_config_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["routing_config_path"] = "RoutingConfigPath" + fields["tunnel_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TunnelSubnetBindingType), reflect.TypeOf([]TunnelSubnet{}))) + fieldNameMap["tunnel_subnets"] = "TunnelSubnets" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.route_based_l3_vpn_session", fields, reflect.TypeOf(RouteBasedL3VpnSession{}), fieldNameMap, validators) +} + +func RouteDetailsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["as_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["as_path"] = "AsPath" + fields["local_pref"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["local_pref"] = "LocalPref" + fields["med"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["med"] = "Med" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.route_details", fields, reflect.TypeOf(RouteDetails{}), fieldNameMap, validators) +} + +func RouteMapEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["community_list_matches"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CommunityMatchCriteriaBindingType), reflect.TypeOf([]CommunityMatchCriteria{}))) + fieldNameMap["community_list_matches"] = "CommunityListMatches" + fields["prefix_list_matches"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["prefix_list_matches"] = "PrefixListMatches" + fields["set"] = bindings.NewOptionalType(bindings.NewReferenceType(RouteMapEntrySetBindingType)) + fieldNameMap["set"] = "Set" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.route_map_entry", fields, reflect.TypeOf(RouteMapEntry{}), fieldNameMap, validators) +} + +func RouteMapEntrySetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["as_path_prepend"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["as_path_prepend"] = "AsPathPrepend" + fields["community"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["community"] = "Community" + fields["local_preference"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["local_preference"] = "LocalPreference" + fields["med"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["med"] = "Med" + fields["prefer_global_v6_next_hop"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["prefer_global_v6_next_hop"] = "PreferGlobalV6NextHop" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.route_map_entry_set", fields, reflect.TypeOf(RouteMapEntrySet{}), fieldNameMap, validators) +} + +func RouterNexthopBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_distance"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["admin_distance"] = "AdminDistance" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.router_nexthop", fields, reflect.TypeOf(RouterNexthop{}), fieldNameMap, validators) +} + +func RoutesPerTransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["routes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RouteDetailsBindingType), reflect.TypeOf([]RouteDetails{}))) + fieldNameMap["routes"] = "Routes" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.routes_per_transport_node", fields, reflect.TypeOf(RoutesPerTransportNode{}), fieldNameMap, validators) +} + +func RoutingEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_distance"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["admin_distance"] = "AdminDistance" + fields["interface"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface"] = "_Interface" + fields["lr_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_id"] = "LrComponentId" + fields["lr_component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_type"] = "LrComponentType" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["route_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_type"] = "RouteType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.routing_entry", fields, reflect.TypeOf(RoutingEntry{}), fieldNameMap, validators) +} + +func RoutingTableBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["count"] = "Count" + fields["edge_node"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_node"] = "EdgeNode" + fields["route_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoutingEntryBindingType), reflect.TypeOf([]RoutingEntry{}))) + fieldNameMap["route_entries"] = "RouteEntries" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.routing_table", fields, reflect.TypeOf(RoutingTable{}), fieldNameMap, validators) +} + +func RoutingTableListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoutingTableBindingType), reflect.TypeOf([]RoutingTable{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.routing_table_list_result", fields, reflect.TypeOf(RoutingTableListResult{}), fieldNameMap, validators) +} + +func RowListFieldBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.row_list_field", fields, reflect.TypeOf(RowListField{}), fieldNameMap, validators) +} + +func RuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["destination_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_groups"] = "DestinationGroups" + fields["destinations_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destinations_excluded"] = "DestinationsExcluded" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["profiles"] = "Profiles" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_id"] = "RuleId" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["service_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["service_entries"] = "ServiceEntries" + fields["services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["services"] = "Services" + fields["source_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_groups"] = "SourceGroups" + fields["sources_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sources_excluded"] = "SourcesExcluded" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.rule", fields, reflect.TypeOf(Rule{}), fieldNameMap, validators) +} + +func RuleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RuleBindingType), reflect.TypeOf([]Rule{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.rule_list_result", fields, reflect.TypeOf(RuleListResult{}), fieldNameMap, validators) +} + +func RuleStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["byte_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["byte_count"] = "ByteCount" + fields["hit_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hit_count"] = "HitCount" + fields["internal_rule_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["internal_rule_id"] = "InternalRuleId" + fields["lr_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_path"] = "LrPath" + fields["max_popularity_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_popularity_index"] = "MaxPopularityIndex" + fields["max_session_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_session_count"] = "MaxSessionCount" + fields["packet_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packet_count"] = "PacketCount" + fields["popularity_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["popularity_index"] = "PopularityIndex" + fields["rule"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rule"] = "Rule" + fields["session_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["session_count"] = "SessionCount" + fields["total_session_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_session_count"] = "TotalSessionCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.rule_statistics", fields, reflect.TypeOf(RuleStatistics{}), fieldNameMap, validators) +} + +func RuleStatisticsForEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point"] = "EnforcementPoint" + fields["statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(RuleStatisticsBindingType)) + fieldNameMap["statistics"] = "Statistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.rule_statistics_for_enforcement_point", fields, reflect.TypeOf(RuleStatisticsForEnforcementPoint{}), fieldNameMap, validators) +} + +func RuleStatisticsListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RuleStatisticsForEnforcementPointBindingType), reflect.TypeOf([]RuleStatisticsForEnforcementPoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.rule_statistics_list_result", fields, reflect.TypeOf(RuleStatisticsListResult{}), fieldNameMap, validators) +} + +func SearchResponseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType(nil, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.search_response", fields, reflect.TypeOf(SearchResponse{}), fieldNameMap, validators) +} + +func SecurityPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["internal_sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["internal_sequence_number"] = "InternalSequenceNumber" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["scheduler_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheduler_path"] = "SchedulerPath" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["sequence_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_number"] = "SequenceNumber" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + fields["connectivity_strategy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity_strategy"] = "ConnectivityStrategy" + fields["default_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["default_rule_id"] = "DefaultRuleId" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RuleBindingType), reflect.TypeOf([]Rule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.security_policy", fields, reflect.TypeOf(SecurityPolicy{}), fieldNameMap, validators) +} + +func SecurityPolicyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SecurityPolicyBindingType), reflect.TypeOf([]SecurityPolicy{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.security_policy_list_result", fields, reflect.TypeOf(SecurityPolicyListResult{}), fieldNameMap, validators) +} + +func SecurityPolicyStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["internal_section_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["internal_section_id"] = "InternalSectionId" + fields["lr_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_path"] = "LrPath" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RuleStatisticsBindingType), reflect.TypeOf([]RuleStatistics{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.security_policy_statistics", fields, reflect.TypeOf(SecurityPolicyStatistics{}), fieldNameMap, validators) +} + +func SecurityPolicyStatisticsForEnforcementPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point"] = "EnforcementPoint" + fields["statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(SecurityPolicyStatisticsBindingType)) + fieldNameMap["statistics"] = "Statistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.security_policy_statistics_for_enforcement_point", fields, reflect.TypeOf(SecurityPolicyStatisticsForEnforcementPoint{}), fieldNameMap, validators) +} + +func SecurityPolicyStatisticsListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SecurityPolicyStatisticsForEnforcementPointBindingType), reflect.TypeOf([]SecurityPolicyStatisticsForEnforcementPoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.security_policy_statistics_list_result", fields, reflect.TypeOf(SecurityPolicyStatisticsListResult{}), fieldNameMap, validators) +} + +func SecurityProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.security_profile_binding_map", fields, reflect.TypeOf(SecurityProfileBindingMap{}), fieldNameMap, validators) +} + +func SegmentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["address_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortAddressBindingEntryBindingType), reflect.TypeOf([]PortAddressBindingEntry{}))) + fieldNameMap["address_bindings"] = "AddressBindings" + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["advanced_config"] = bindings.NewOptionalType(bindings.NewReferenceType(SegmentAdvancedConfigBindingType)) + fieldNameMap["advanced_config"] = "AdvancedConfig" + fields["bridge_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BridgeProfileConfigBindingType), reflect.TypeOf([]BridgeProfileConfig{}))) + fieldNameMap["bridge_profiles"] = "BridgeProfiles" + fields["connectivity_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity_path"] = "ConnectivityPath" + fields["dhcp_config_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_config_path"] = "DhcpConfigPath" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["extra_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentExtraConfigBindingType), reflect.TypeOf([]SegmentExtraConfig{}))) + fieldNameMap["extra_configs"] = "ExtraConfigs" + fields["federation_config"] = bindings.NewOptionalType(bindings.NewReferenceType(FederationConnectivityConfigBindingType)) + fieldNameMap["federation_config"] = "FederationConfig" + fields["l2_extension"] = bindings.NewOptionalType(bindings.NewReferenceType(L2ExtensionBindingType)) + fieldNameMap["l2_extension"] = "L2Extension" + fields["ls_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ls_id"] = "LsId" + fields["mac_pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_pool_id"] = "MacPoolId" + fields["metadata_proxy_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["metadata_proxy_paths"] = "MetadataProxyPaths" + fields["overlay_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["overlay_id"] = "OverlayId" + fields["replication_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["replication_mode"] = "ReplicationMode" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentSubnetBindingType), reflect.TypeOf([]SegmentSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["transport_zone_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_zone_path"] = "TransportZonePath" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["vlan_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["vlan_ids"] = "VlanIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment", fields, reflect.TypeOf(Segment{}), fieldNameMap, validators) +} + +func SegmentAdvancedConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connectivity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity"] = "Connectivity" + fields["address_pool_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["address_pool_paths"] = "AddressPoolPaths" + fields["hybrid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["hybrid"] = "Hybrid" + fields["local_egress"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["local_egress"] = "LocalEgress" + fields["local_egress_routing_policies"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LocalEgressRoutingEntryBindingType), reflect.TypeOf([]LocalEgressRoutingEntry{}))) + fieldNameMap["local_egress_routing_policies"] = "LocalEgressRoutingPolicies" + fields["multicast"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["multicast"] = "Multicast" + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_advanced_config", fields, reflect.TypeOf(SegmentAdvancedConfig{}), fieldNameMap, validators) +} + +func SegmentConfigurationStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["segment_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_path"] = "SegmentPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_configuration_state", fields, reflect.TypeOf(SegmentConfigurationState{}), fieldNameMap, validators) +} + +func SegmentDhcpConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_servers"] = "DnsServers" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_address"] = "ServerAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_dhcp_config", fields, reflect.TypeOf(SegmentDhcpConfig{}), fieldNameMap, validators) +} + +func SegmentDhcpV4ConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["options"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpV4OptionsBindingType)) + fieldNameMap["options"] = "Options" + fields["dns_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_servers"] = "DnsServers" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_address"] = "ServerAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_dhcp_v4_config", fields, reflect.TypeOf(SegmentDhcpV4Config{}), fieldNameMap, validators) +} + +func SegmentDhcpV6ConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + fields["excluded_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["excluded_ranges"] = "ExcludedRanges" + fields["options"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpV6OptionsBindingType)) + fieldNameMap["options"] = "Options" + fields["preferred_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["preferred_time"] = "PreferredTime" + fields["sntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sntp_servers"] = "SntpServers" + fields["dns_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_servers"] = "DnsServers" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_address"] = "ServerAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_dhcp_v6_config", fields, reflect.TypeOf(SegmentDhcpV6Config{}), fieldNameMap, validators) +} + +func SegmentDiscoveryProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ip_discovery_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_discovery_profile_path"] = "IpDiscoveryProfilePath" + fields["mac_discovery_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_discovery_profile_path"] = "MacDiscoveryProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_discovery_profile_binding_map", fields, reflect.TypeOf(SegmentDiscoveryProfileBindingMap{}), fieldNameMap, validators) +} + +func SegmentDiscoveryProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentDiscoveryProfileBindingMapBindingType), reflect.TypeOf([]SegmentDiscoveryProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_discovery_profile_binding_map_list_result", fields, reflect.TypeOf(SegmentDiscoveryProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func SegmentExtraConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_pair"] = bindings.NewOptionalType(bindings.NewReferenceType(KeyValuePairBindingType)) + fieldNameMap["config_pair"] = "ConfigPair" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_extra_config", fields, reflect.TypeOf(SegmentExtraConfig{}), fieldNameMap, validators) +} + +func SegmentListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentBindingType), reflect.TypeOf([]Segment{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_list_result", fields, reflect.TypeOf(SegmentListResult{}), fieldNameMap, validators) +} + +func SegmentMonitoringProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ipfix_l2_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipfix_l2_profile_path"] = "IpfixL2ProfilePath" + fields["port_mirroring_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port_mirroring_profile_path"] = "PortMirroringProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_monitoring_profile_binding_map", fields, reflect.TypeOf(SegmentMonitoringProfileBindingMap{}), fieldNameMap, validators) +} + +func SegmentMonitoringProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentMonitoringProfileBindingMapBindingType), reflect.TypeOf([]SegmentMonitoringProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_monitoring_profile_binding_map_list_result", fields, reflect.TypeOf(SegmentMonitoringProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func SegmentPortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["address_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortAddressBindingEntryBindingType), reflect.TypeOf([]PortAddressBindingEntry{}))) + fieldNameMap["address_bindings"] = "AddressBindings" + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["attachment"] = bindings.NewOptionalType(bindings.NewReferenceType(PortAttachmentBindingType)) + fieldNameMap["attachment"] = "Attachment" + fields["extra_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentExtraConfigBindingType), reflect.TypeOf([]SegmentExtraConfig{}))) + fieldNameMap["extra_configs"] = "ExtraConfigs" + fields["ignored_address_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortAddressBindingEntryBindingType), reflect.TypeOf([]PortAddressBindingEntry{}))) + fieldNameMap["ignored_address_bindings"] = "IgnoredAddressBindings" + fields["init_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["init_state"] = "InitState" + fields["source_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_site_id"] = "SourceSiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_port", fields, reflect.TypeOf(SegmentPort{}), fieldNameMap, validators) +} + +func SegmentPortListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentPortBindingType), reflect.TypeOf([]SegmentPort{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_port_list_result", fields, reflect.TypeOf(SegmentPortListResult{}), fieldNameMap, validators) +} + +func SegmentPortStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_port_id"] = "LogicalPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_port_statistics", fields, reflect.TypeOf(SegmentPortStatistics{}), fieldNameMap, validators) +} + +func SegmentQosProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["qos_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["qos_profile_path"] = "QosProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_qos_profile_binding_map", fields, reflect.TypeOf(SegmentQosProfileBindingMap{}), fieldNameMap, validators) +} + +func SegmentQosProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentQosProfileBindingMapBindingType), reflect.TypeOf([]SegmentQosProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_qos_profile_binding_map_list_result", fields, reflect.TypeOf(SegmentQosProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func SegmentSecurityProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["bpdu_filter_allow"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["bpdu_filter_allow"] = "BpduFilterAllow" + fields["bpdu_filter_enable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["bpdu_filter_enable"] = "BpduFilterEnable" + fields["dhcp_client_block_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dhcp_client_block_enabled"] = "DhcpClientBlockEnabled" + fields["dhcp_client_block_v6_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dhcp_client_block_v6_enabled"] = "DhcpClientBlockV6Enabled" + fields["dhcp_server_block_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dhcp_server_block_enabled"] = "DhcpServerBlockEnabled" + fields["dhcp_server_block_v6_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dhcp_server_block_v6_enabled"] = "DhcpServerBlockV6Enabled" + fields["non_ip_traffic_block_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["non_ip_traffic_block_enabled"] = "NonIpTrafficBlockEnabled" + fields["ra_guard_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ra_guard_enabled"] = "RaGuardEnabled" + fields["rate_limits"] = bindings.NewOptionalType(bindings.NewReferenceType(TrafficRateLimitsBindingType)) + fieldNameMap["rate_limits"] = "RateLimits" + fields["rate_limits_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rate_limits_enabled"] = "RateLimitsEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_security_profile", fields, reflect.TypeOf(SegmentSecurityProfile{}), fieldNameMap, validators) +} + +func SegmentSecurityProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["segment_security_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_security_profile_path"] = "SegmentSecurityProfilePath" + fields["spoofguard_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spoofguard_profile_path"] = "SpoofguardProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_security_profile_binding_map", fields, reflect.TypeOf(SegmentSecurityProfileBindingMap{}), fieldNameMap, validators) +} + +func SegmentSecurityProfileBindingMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentSecurityProfileBindingMapBindingType), reflect.TypeOf([]SegmentSecurityProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_security_profile_binding_map_list_result", fields, reflect.TypeOf(SegmentSecurityProfileBindingMapListResult{}), fieldNameMap, validators) +} + +func SegmentSecurityProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SegmentSecurityProfileBindingType), reflect.TypeOf([]SegmentSecurityProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_security_profile_list_result", fields, reflect.TypeOf(SegmentSecurityProfileListResult{}), fieldNameMap, validators) +} + +func SegmentStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_statistics", fields, reflect.TypeOf(SegmentStatistics{}), fieldNameMap, validators) +} + +func SegmentSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_config"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(SegmentDhcpConfigBindingType),}, bindings.REST)) + fieldNameMap["dhcp_config"] = "DhcpConfig" + fields["dhcp_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dhcp_ranges"] = "DhcpRanges" + fields["gateway_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_address"] = "GatewayAddress" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.segment_subnet", fields, reflect.TypeOf(SegmentSubnet{}), fieldNameMap, validators) +} + +func SelectableResourceReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["selected"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["selected"] = "Selected" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.selectable_resource_reference", fields, reflect.TypeOf(SelectableResourceReference{}), fieldNameMap, validators) +} + +func SelfResourceLinkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["href"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["href"] = "Href" + fields["rel"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rel"] = "Rel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.self_resource_link", fields, reflect.TypeOf(SelfResourceLink{}), fieldNameMap, validators) +} + +func ServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["service_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["service_entries"] = "ServiceEntries" + fields["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_type"] = "ServiceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service", fields, reflect.TypeOf(Service{}), fieldNameMap, validators) +} + +func ServiceEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service_entry", fields, reflect.TypeOf(ServiceEntry{}), fieldNameMap, validators) +} + +func ServiceEntryListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ServiceEntryBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service_entry_list_result", fields, reflect.TypeOf(ServiceEntryListResult{}), fieldNameMap, validators) +} + +func ServiceInstanceEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_interface_path"] = "ServiceInterfacePath" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["target_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPInfoBindingType), reflect.TypeOf([]IPInfo{}))) + fieldNameMap["target_ips"] = "TargetIps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service_instance_endpoint", fields, reflect.TypeOf(ServiceInstanceEndpoint{}), fieldNameMap, validators) +} + +func ServiceInterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceSubnetBindingType), reflect.TypeOf([]InterfaceSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service_interface", fields, reflect.TypeOf(ServiceInterface{}), fieldNameMap, validators) +} + +func ServiceInterfaceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceInterfaceBindingType), reflect.TypeOf([]ServiceInterface{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service_interface_list_result", fields, reflect.TypeOf(ServiceInterfaceListResult{}), fieldNameMap, validators) +} + +func ServiceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingType), reflect.TypeOf([]Service{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service_list_result", fields, reflect.TypeOf(ServiceListResult{}), fieldNameMap, validators) +} + +func ServiceReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["partner_service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["partner_service_name"] = "PartnerServiceName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service_reference", fields, reflect.TypeOf(ServiceReference{}), fieldNameMap, validators) +} + +func ServiceSegmentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["lr_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["lr_paths"] = "LrPaths" + fields["transport_zone_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_zone_path"] = "TransportZonePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.service_segment", fields, reflect.TypeOf(ServiceSegment{}), fieldNameMap, validators) +} + +func SessionTimerProfileBindingListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SessionTimerProfileBindingMapBindingType), reflect.TypeOf([]SessionTimerProfileBindingMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.session_timer_profile_binding_list_result", fields, reflect.TypeOf(SessionTimerProfileBindingListResult{}), fieldNameMap, validators) +} + +func SessionTimerProfileBindingMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_path"] = "ProfilePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.session_timer_profile_binding_map", fields, reflect.TypeOf(SessionTimerProfileBindingMap{}), fieldNameMap, validators) +} + +func SetFieldsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["field_settings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FieldSettingBindingType), reflect.TypeOf([]FieldSetting{}))) + fieldNameMap["field_settings"] = "FieldSettings" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.set_fields", fields, reflect.TypeOf(SetFields{}), fieldNameMap, validators) +} + +func SiteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["fail_if_rtep_misconfigured"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["fail_if_rtep_misconfigured"] = "FailIfRtepMisconfigured" + fields["fail_if_rtt_exceeded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["fail_if_rtt_exceeded"] = "FailIfRttExceeded" + fields["federation_config"] = bindings.NewOptionalType(bindings.NewReferenceType(GmFederationSiteConfigBindingType)) + fieldNameMap["federation_config"] = "FederationConfig" + fields["maximum_rtt"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["maximum_rtt"] = "MaximumRtt" + fields["site_connection_info"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SiteNodeConnectionInfoBindingType), reflect.TypeOf([]SiteNodeConnectionInfo{}))) + fieldNameMap["site_connection_info"] = "SiteConnectionInfo" + fields["site_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["site_number"] = "SiteNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.site", fields, reflect.TypeOf(Site{}), fieldNameMap, validators) +} + +func SiteAllocationIndexForEdgeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["index"] = "Index" + fields["target_resource_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_resource_path"] = "TargetResourcePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.site_allocation_index_for_edge", fields, reflect.TypeOf(SiteAllocationIndexForEdge{}), fieldNameMap, validators) +} + +func SiteFederationConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rtep_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["rtep_ips"] = "RtepIps" + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + fields["site_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["site_index"] = "SiteIndex" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.site_federation_config", fields, reflect.TypeOf(SiteFederationConfig{}), fieldNameMap, validators) +} + +func SiteListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SiteBindingType), reflect.TypeOf([]Site{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.site_list_result", fields, reflect.TypeOf(SiteListResult{}), fieldNameMap, validators) +} + +func SiteNodeConnectionInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.site_node_connection_info", fields, reflect.TypeOf(SiteNodeConnectionInfo{}), fieldNameMap, validators) +} + +func SourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.source", fields, reflect.TypeOf(Source{}), fieldNameMap, validators) +} + +func SourceFieldEvaluationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["expected"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["expected"] = "Expected" + fields["field_pointer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field_pointer"] = "FieldPointer" + fields["operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operator"] = "Operator" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.source_field_evaluation", fields, reflect.TypeOf(SourceFieldEvaluation{}), fieldNameMap, validators) +} + +func SpanBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["sites"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SpanSiteInfoBindingType), reflect.TypeOf([]SpanSiteInfo{}))) + fieldNameMap["sites"] = "Sites" + fields["span_leader"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["span_leader"] = "SpanLeader" + fields["span_resource"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["span_resource"] = "SpanResource" + fields["span_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["span_resource_type"] = "SpanResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.span", fields, reflect.TypeOf(Span{}), fieldNameMap, validators) +} + +func SpanSiteInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.span_site_info", fields, reflect.TypeOf(SpanSiteInfo{}), fieldNameMap, validators) +} + +func SpoofGuardProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["address_binding_whitelist"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["address_binding_whitelist"] = "AddressBindingWhitelist" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.spoof_guard_profile", fields, reflect.TypeOf(SpoofGuardProfile{}), fieldNameMap, validators) +} + +func SpoofGuardProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SpoofGuardProfileBindingType), reflect.TypeOf([]SpoofGuardProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.spoof_guard_profile_list_result", fields, reflect.TypeOf(SpoofGuardProfileListResult{}), fieldNameMap, validators) +} + +func SslTrustObjectDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["key_algo"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key_algo"] = "KeyAlgo" + fields["passphrase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passphrase"] = "Passphrase" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + fields["private_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["private_key"] = "PrivateKey" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.ssl_trust_object_data", fields, reflect.TypeOf(SslTrustObjectData{}), fieldNameMap, validators) +} + +func StandaloneHostIdfwConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["idfw_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["idfw_enabled"] = "IdfwEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.standalone_host_idfw_configuration", fields, reflect.TypeOf(StandaloneHostIdfwConfiguration{}), fieldNameMap, validators) +} + +func StatItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + fields["total"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["total"] = "Total" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.stat_item", fields, reflect.TypeOf(StatItem{}), fieldNameMap, validators) +} + +func StaticARPConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.static_ARP_config", fields, reflect.TypeOf(StaticARPConfig{}), fieldNameMap, validators) +} + +func StaticFilterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.static_filter", fields, reflect.TypeOf(StaticFilter{}), fieldNameMap, validators) +} + +func StaticRouteBfdPeerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["bfd_profile_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bfd_profile_path"] = "BfdProfilePath" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["peer_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_address"] = "PeerAddress" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["scope"] = "Scope" + fields["source_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_addresses"] = "SourceAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.static_route_bfd_peer", fields, reflect.TypeOf(StaticRouteBfdPeer{}), fieldNameMap, validators) +} + +func StaticRouteBfdPeerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StaticRouteBfdPeerBindingType), reflect.TypeOf([]StaticRouteBfdPeer{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.static_route_bfd_peer_list_result", fields, reflect.TypeOf(StaticRouteBfdPeerListResult{}), fieldNameMap, validators) +} + +func StaticRoutesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enabled_on_secondary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled_on_secondary"] = "EnabledOnSecondary" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hops"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RouterNexthopBindingType), reflect.TypeOf([]RouterNexthop{}))) + fieldNameMap["next_hops"] = "NextHops" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.static_routes", fields, reflect.TypeOf(StaticRoutes{}), fieldNameMap, validators) +} + +func StaticRoutesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StaticRoutesBindingType), reflect.TypeOf([]StaticRoutes{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.static_routes_list_result", fields, reflect.TypeOf(StaticRoutesListResult{}), fieldNameMap, validators) +} + +func StatsConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["sections"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DonutSectionBindingType), reflect.TypeOf([]DonutSection{}))) + fieldNameMap["sections"] = "Sections" + fields["stat"] = bindings.NewOptionalType(bindings.NewReferenceType(StatItemBindingType)) + fieldNameMap["stat"] = "Stat" + fields["sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_type"] = "SubType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.stats_configuration", fields, reflect.TypeOf(StatsConfiguration{}), fieldNameMap, validators) +} + +func TagBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope"] = "Scope" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tag", fields, reflect.TypeOf(Tag{}), fieldNameMap, validators) +} + +func TagBulkOperationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["apply_to"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceInfoBindingType), reflect.TypeOf([]ResourceInfo{}))) + fieldNameMap["apply_to"] = "ApplyTo" + fields["remove_from"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceInfoBindingType), reflect.TypeOf([]ResourceInfo{}))) + fieldNameMap["remove_from"] = "RemoveFrom" + fields["tag"] = bindings.NewOptionalType(bindings.NewReferenceType(TagBindingType)) + fieldNameMap["tag"] = "Tag" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tag_bulk_operation", fields, reflect.TypeOf(TagBulkOperation{}), fieldNameMap, validators) +} + +func TagBulkOperationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["apply_to"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceTypeTagStatusBindingType), reflect.TypeOf([]ResourceTypeTagStatus{}))) + fieldNameMap["apply_to"] = "ApplyTo" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["remove_from"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceTypeTagStatusBindingType), reflect.TypeOf([]ResourceTypeTagStatus{}))) + fieldNameMap["remove_from"] = "RemoveFrom" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["tag"] = bindings.NewOptionalType(bindings.NewReferenceType(TagBindingType)) + fieldNameMap["tag"] = "Tag" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tag_bulk_operation_status", fields, reflect.TypeOf(TagBulkOperationStatus{}), fieldNameMap, validators) +} + +func TagInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope"] = "Scope" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fields["tagged_objects_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tagged_objects_count"] = "TaggedObjectsCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tag_info", fields, reflect.TypeOf(TagInfo{}), fieldNameMap, validators) +} + +func TagInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagInfoBindingType), reflect.TypeOf([]TagInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tag_info_list_result", fields, reflect.TypeOf(TagInfoListResult{}), fieldNameMap, validators) +} + +func TcpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dst_port"] = "DstPort" + fields["src_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["src_port"] = "SrcPort" + fields["tcp_flags"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_flags"] = "TcpFlags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tcp_header", fields, reflect.TypeOf(TcpHeader{}), fieldNameMap, validators) +} + +func TcpMaximumSegmentSizeClampingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["max_segment_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_segment_size"] = "MaxSegmentSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tcp_maximum_segment_size_clamping", fields, reflect.TypeOf(TcpMaximumSegmentSizeClamping{}), fieldNameMap, validators) +} + +func TcpPolicyLbMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tcp_policy_lb_monitor_profile", fields, reflect.TypeOf(TcpPolicyLbMonitorProfile{}), fieldNameMap, validators) +} + +func TcpPolicyLbVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lb_persistence_profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + fields["ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ports"] = "Ports" + fields["router_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_path"] = "RouterPath" + fields["traffic_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traffic_source"] = "TrafficSource" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tcp_policy_lb_virtual_server", fields, reflect.TypeOf(TcpPolicyLbVirtualServer{}), fieldNameMap, validators) +} + +func Tier0BindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["default_rule_logging"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["default_rule_logging"] = "DefaultRuleLogging" + fields["dhcp_config_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dhcp_config_paths"] = "DhcpConfigPaths" + fields["disable_firewall"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disable_firewall"] = "DisableFirewall" + fields["failover_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failover_mode"] = "FailoverMode" + fields["federation_config"] = bindings.NewOptionalType(bindings.NewReferenceType(FederationGatewayConfigBindingType)) + fieldNameMap["federation_config"] = "FederationConfig" + fields["force_whitelisting"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["force_whitelisting"] = "ForceWhitelisting" + fields["ha_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ha_mode"] = "HaMode" + fields["internal_transit_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["internal_transit_subnets"] = "InternalTransitSubnets" + fields["intersite_config"] = bindings.NewOptionalType(bindings.NewReferenceType(IntersiteGatewayConfigBindingType)) + fieldNameMap["intersite_config"] = "IntersiteConfig" + fields["ipv6_profile_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ipv6_profile_paths"] = "Ipv6ProfilePaths" + fields["rd_admin_field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rd_admin_field"] = "RdAdminField" + fields["transit_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transit_subnets"] = "TransitSubnets" + fields["vrf_config"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier0VrfConfigBindingType)) + fieldNameMap["vrf_config"] = "VrfConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0", fields, reflect.TypeOf(Tier0{}), fieldNameMap, validators) +} + +func Tier0DeploymentMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enforcement_point"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point"] = "EnforcementPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_deployment_map", fields, reflect.TypeOf(Tier0DeploymentMap{}), fieldNameMap, validators) +} + +func Tier0DeploymentMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Tier0DeploymentMapBindingType), reflect.TypeOf([]Tier0DeploymentMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_deployment_map_list_result", fields, reflect.TypeOf(Tier0DeploymentMapListResult{}), fieldNameMap, validators) +} + +func Tier0GatewayStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["ipv6_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPv6StatusBindingType), reflect.TypeOf([]IPv6Status{}))) + fieldNameMap["ipv6_status"] = "Ipv6Status" + fields["tier0_state"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterStateBindingType)) + fieldNameMap["tier0_state"] = "Tier0State" + fields["tier0_status"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterStatusBindingType)) + fieldNameMap["tier0_status"] = "Tier0Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_gateway_state", fields, reflect.TypeOf(Tier0GatewayState{}), fieldNameMap, validators) +} + +func Tier0HaVipConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["external_interface_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["external_interface_paths"] = "ExternalInterfacePaths" + fields["vip_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceSubnetBindingType), reflect.TypeOf([]InterfaceSubnet{}))) + fieldNameMap["vip_subnets"] = "VipSubnets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_ha_vip_config", fields, reflect.TypeOf(Tier0HaVipConfig{}), fieldNameMap, validators) +} + +func Tier0InterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceSubnetBindingType), reflect.TypeOf([]InterfaceSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["access_vlan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["access_vlan_id"] = "AccessVlanId" + fields["edge_cluster_member_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["edge_cluster_member_index"] = "EdgeClusterMemberIndex" + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_path"] = "EdgePath" + fields["ipv6_profile_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ipv6_profile_paths"] = "Ipv6ProfilePaths" + fields["ls_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ls_id"] = "LsId" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + fields["multicast"] = bindings.NewOptionalType(bindings.NewReferenceType(Tier0InterfacePimConfigBindingType)) + fieldNameMap["multicast"] = "Multicast" + fields["segment_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_path"] = "SegmentPath" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["urpf_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["urpf_mode"] = "UrpfMode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_interface", fields, reflect.TypeOf(Tier0Interface{}), fieldNameMap, validators) +} + +func Tier0InterfaceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Tier0InterfaceBindingType), reflect.TypeOf([]Tier0Interface{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_interface_list_result", fields, reflect.TypeOf(Tier0InterfaceListResult{}), fieldNameMap, validators) +} + +func Tier0InterfacePimConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_interface_pim_config", fields, reflect.TypeOf(Tier0InterfacePimConfig{}), fieldNameMap, validators) +} + +func Tier0ListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Tier0BindingType), reflect.TypeOf([]Tier0{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_list_result", fields, reflect.TypeOf(Tier0ListResult{}), fieldNameMap, validators) +} + +func Tier0RouteMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RouteMapEntryBindingType), reflect.TypeOf([]RouteMapEntry{}))) + fieldNameMap["entries"] = "Entries" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_route_map", fields, reflect.TypeOf(Tier0RouteMap{}), fieldNameMap, validators) +} + +func Tier0RouteMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Tier0RouteMapBindingType), reflect.TypeOf([]Tier0RouteMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_route_map_list_result", fields, reflect.TypeOf(Tier0RouteMapListResult{}), fieldNameMap, validators) +} + +func Tier0RouteRedistributionConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bgp_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["bgp_enabled"] = "BgpEnabled" + fields["redistribution_rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Tier0RouteRedistributionRuleBindingType), reflect.TypeOf([]Tier0RouteRedistributionRule{}))) + fieldNameMap["redistribution_rules"] = "RedistributionRules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_route_redistribution_config", fields, reflect.TypeOf(Tier0RouteRedistributionConfig{}), fieldNameMap, validators) +} + +func Tier0RouteRedistributionRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["route_map_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_map_path"] = "RouteMapPath" + fields["route_redistribution_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["route_redistribution_types"] = "RouteRedistributionTypes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_route_redistribution_rule", fields, reflect.TypeOf(Tier0RouteRedistributionRule{}), fieldNameMap, validators) +} + +func Tier0VrfConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["evpn_transit_vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["evpn_transit_vni"] = "EvpnTransitVni" + fields["route_distinguisher"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_distinguisher"] = "RouteDistinguisher" + fields["route_targets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VrfRouteTargetsBindingType), reflect.TypeOf([]VrfRouteTargets{}))) + fieldNameMap["route_targets"] = "RouteTargets" + fields["tier0_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_path"] = "Tier0Path" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier0_vrf_config", fields, reflect.TypeOf(Tier0VrfConfig{}), fieldNameMap, validators) +} + +func Tier1BindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["default_rule_logging"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["default_rule_logging"] = "DefaultRuleLogging" + fields["dhcp_config_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dhcp_config_paths"] = "DhcpConfigPaths" + fields["disable_firewall"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disable_firewall"] = "DisableFirewall" + fields["enable_standby_relocation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_standby_relocation"] = "EnableStandbyRelocation" + fields["failover_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failover_mode"] = "FailoverMode" + fields["federation_config"] = bindings.NewOptionalType(bindings.NewReferenceType(FederationGatewayConfigBindingType)) + fieldNameMap["federation_config"] = "FederationConfig" + fields["force_whitelisting"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["force_whitelisting"] = "ForceWhitelisting" + fields["intersite_config"] = bindings.NewOptionalType(bindings.NewReferenceType(IntersiteGatewayConfigBindingType)) + fieldNameMap["intersite_config"] = "IntersiteConfig" + fields["ipv6_profile_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ipv6_profile_paths"] = "Ipv6ProfilePaths" + fields["pool_allocation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pool_allocation"] = "PoolAllocation" + fields["qos_profile"] = bindings.NewOptionalType(bindings.NewReferenceType(GatewayQosProfileConfigBindingType)) + fieldNameMap["qos_profile"] = "QosProfile" + fields["route_advertisement_rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RouteAdvertisementRuleBindingType), reflect.TypeOf([]RouteAdvertisementRule{}))) + fieldNameMap["route_advertisement_rules"] = "RouteAdvertisementRules" + fields["route_advertisement_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["route_advertisement_types"] = "RouteAdvertisementTypes" + fields["tier0_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tier0_path"] = "Tier0Path" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier1", fields, reflect.TypeOf(Tier1{}), fieldNameMap, validators) +} + +func Tier1DeploymentMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["enforcement_point"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point"] = "EnforcementPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier1_deployment_map", fields, reflect.TypeOf(Tier1DeploymentMap{}), fieldNameMap, validators) +} + +func Tier1GatewayStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforcement_point_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforcement_point_path"] = "EnforcementPointPath" + fields["ipv6_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPv6StatusBindingType), reflect.TypeOf([]IPv6Status{}))) + fieldNameMap["ipv6_status"] = "Ipv6Status" + fields["tier1_state"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterStateBindingType)) + fieldNameMap["tier1_state"] = "Tier1State" + fields["tier1_status"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterStatusBindingType)) + fieldNameMap["tier1_status"] = "Tier1Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier1_gateway_state", fields, reflect.TypeOf(Tier1GatewayState{}), fieldNameMap, validators) +} + +func Tier1InterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceSubnetBindingType), reflect.TypeOf([]InterfaceSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["ipv6_profile_paths"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ipv6_profile_paths"] = "Ipv6ProfilePaths" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + fields["segment_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_path"] = "SegmentPath" + fields["urpf_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["urpf_mode"] = "UrpfMode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier1_interface", fields, reflect.TypeOf(Tier1Interface{}), fieldNameMap, validators) +} + +func Tier1InterfaceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Tier1InterfaceBindingType), reflect.TypeOf([]Tier1Interface{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier1_interface_list_result", fields, reflect.TypeOf(Tier1InterfaceListResult{}), fieldNameMap, validators) +} + +func Tier1ListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Tier1BindingType), reflect.TypeOf([]Tier1{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tier1_list_result", fields, reflect.TypeOf(Tier1ListResult{}), fieldNameMap, validators) +} + +func TlsCertificateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(X509CertificateBindingType), reflect.TypeOf([]X509Certificate{}))) + fieldNameMap["details"] = "Details" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tls_certificate", fields, reflect.TypeOf(TlsCertificate{}), fieldNameMap, validators) +} + +func TlsCertificateListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TlsCertificateBindingType), reflect.TypeOf([]TlsCertificate{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tls_certificate_list", fields, reflect.TypeOf(TlsCertificateList{}), fieldNameMap, validators) +} + +func TlsCrlBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["details"] = bindings.NewOptionalType(bindings.NewReferenceType(X509CrlBindingType)) + fieldNameMap["details"] = "Details" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tls_crl", fields, reflect.TypeOf(TlsCrl{}), fieldNameMap, validators) +} + +func TlsCrlListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TlsCrlBindingType), reflect.TypeOf([]TlsCrl{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tls_crl_list_result", fields, reflect.TypeOf(TlsCrlListResult{}), fieldNameMap, validators) +} + +func TlsListenerCertificateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate"] = bindings.NewOptionalType(bindings.NewReferenceType(X509CertificateBindingType)) + fieldNameMap["certificate"] = "Certificate" + fields["result"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["result"] = "Result" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tls_listener_certificate", fields, reflect.TypeOf(TlsListenerCertificate{}), fieldNameMap, validators) +} + +func TlsTrustDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["key_algo"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key_algo"] = "KeyAlgo" + fields["passphrase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passphrase"] = "Passphrase" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + fields["private_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["private_key"] = "PrivateKey" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tls_trust_data", fields, reflect.TypeOf(TlsTrustData{}), fieldNameMap, validators) +} + +func TooltipBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["heading"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["heading"] = "Heading" + fields["text"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["text"] = "Text" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tooltip", fields, reflect.TypeOf(Tooltip{}), fieldNameMap, validators) +} + +func TraceflowConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["is_transient"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_transient"] = "IsTransient" + fields["packet"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(PacketDataBindingType),}, bindings.REST)) + fieldNameMap["packet"] = "Packet" + fields["segment_port_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_port_path"] = "SegmentPortPath" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.traceflow_config", fields, reflect.TypeOf(TraceflowConfig{}), fieldNameMap, validators) +} + +func TrafficRateLimitsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_broadcast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_broadcast"] = "RxBroadcast" + fields["rx_multicast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_multicast"] = "RxMulticast" + fields["tx_broadcast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_broadcast"] = "TxBroadcast" + fields["tx_multicast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_multicast"] = "TxMulticast" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.traffic_rate_limits", fields, reflect.TypeOf(TrafficRateLimits{}), fieldNameMap, validators) +} + +func TransportNodeSpanEnforcedStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enforced_status_per_transport_node"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EnforcedStatusPerTransportNodeBindingType), reflect.TypeOf([]EnforcedStatusPerTransportNode{}))) + fieldNameMap["enforced_status_per_transport_node"] = "EnforcedStatusPerTransportNode" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.transport_node_span_enforced_status", fields, reflect.TypeOf(TransportNodeSpanEnforcedStatus{}), fieldNameMap, validators) +} + +func TransportProtocolHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpHeaderBindingType)) + fieldNameMap["dhcp_header"] = "DhcpHeader" + fields["dhcpv6_header"] = bindings.NewOptionalType(bindings.NewReferenceType(Dhcpv6HeaderBindingType)) + fieldNameMap["dhcpv6_header"] = "Dhcpv6Header" + fields["dns_header"] = bindings.NewOptionalType(bindings.NewReferenceType(DnsHeaderBindingType)) + fieldNameMap["dns_header"] = "DnsHeader" + fields["icmp_echo_request_header"] = bindings.NewOptionalType(bindings.NewReferenceType(IcmpEchoRequestHeaderBindingType)) + fieldNameMap["icmp_echo_request_header"] = "IcmpEchoRequestHeader" + fields["ndp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(NdpHeaderBindingType)) + fieldNameMap["ndp_header"] = "NdpHeader" + fields["tcp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(TcpHeaderBindingType)) + fieldNameMap["tcp_header"] = "TcpHeader" + fields["udp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(UdpHeaderBindingType)) + fieldNameMap["udp_header"] = "UdpHeader" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.transport_protocol_header", fields, reflect.TypeOf(TransportProtocolHeader{}), fieldNameMap, validators) +} + +func TunnelInterfaceIPSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tunnel_interface_IP_subnet", fields, reflect.TypeOf(TunnelInterfaceIPSubnet{}), fieldNameMap, validators) +} + +func TunnelSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.tunnel_subnet", fields, reflect.TypeOf(TunnelSubnet{}), fieldNameMap, validators) +} + +func UdpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dst_port"] = "DstPort" + fields["src_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["src_port"] = "SrcPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.udp_header", fields, reflect.TypeOf(UdpHeader{}), fieldNameMap, validators) +} + +func UdpPolicyLbMonitorProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["receive"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["receive"] = "Receive" + fields["send"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["send"] = "Send" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.udp_policy_lb_monitor_profile", fields, reflect.TypeOf(UdpPolicyLbMonitorProfile{}), fieldNameMap, validators) +} + +func UdpPolicyLbVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lb_persistence_profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + fields["ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ports"] = "Ports" + fields["router_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_path"] = "RouterPath" + fields["traffic_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traffic_source"] = "TrafficSource" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.udp_policy_lb_virtual_server", fields, reflect.TypeOf(UdpPolicyLbVirtualServer{}), fieldNameMap, validators) +} + +func UnaryOperationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["operand"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceFieldPointerBindingType)) + fieldNameMap["operand"] = "Operand" + fields["operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operator"] = "Operator" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.unary_operation", fields, reflect.TypeOf(UnaryOperation{}), fieldNameMap, validators) +} + +func UnaryOperationBasedInjectionValueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["initial_value"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceFieldPointerBindingType)) + fieldNameMap["initial_value"] = "InitialValue" + fields["operation"] = bindings.NewOptionalType(bindings.NewReferenceType(UnaryOperationBindingType)) + fieldNameMap["operation"] = "Operation" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.unary_operation_based_injection_value", fields, reflect.TypeOf(UnaryOperationBasedInjectionValue{}), fieldNameMap, validators) +} + +func UrlAliasBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["query"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.url_alias", fields, reflect.TypeOf(UrlAlias{}), fieldNameMap, validators) +} + +func UserInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["roles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxRoleBindingType), reflect.TypeOf([]NsxRole{}))) + fieldNameMap["roles"] = "Roles" + fields["user_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_name"] = "UserName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.user_info", fields, reflect.TypeOf(UserInfo{}), fieldNameMap, validators) +} + +func ValueConstraintExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operator"] = "Operator" + fields["values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["values"] = "Values" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.value_constraint_expression", fields, reflect.TypeOf(ValueConstraintExpression{}), fieldNameMap, validators) +} + +func VersionListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["acceptable_versions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["acceptable_versions"] = "AcceptableVersions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.version_list", fields, reflect.TypeOf(VersionList{}), fieldNameMap, validators) +} + +func VidmInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.vidm_info", fields, reflect.TypeOf(VidmInfo{}), fieldNameMap, validators) +} + +func VidmInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VidmInfoBindingType), reflect.TypeOf([]VidmInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.vidm_info_list_result", fields, reflect.TypeOf(VidmInfoListResult{}), fieldNameMap, validators) +} + +func ViewBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["exclude_roles"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["exclude_roles"] = "ExcludeRoles" + fields["include_roles"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["include_roles"] = "IncludeRoles" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + fields["widgets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetItemBindingType), reflect.TypeOf([]WidgetItem{}))) + fieldNameMap["widgets"] = "Widgets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.view", fields, reflect.TypeOf(View{}), fieldNameMap, validators) +} + +func ViewListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["views"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ViewBindingType), reflect.TypeOf([]View{}))) + fieldNameMap["views"] = "Views" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.view_list", fields, reflect.TypeOf(ViewList{}), fieldNameMap, validators) +} + +func VirtualEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["service_names"] = "ServiceNames" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["target_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPInfoBindingType), reflect.TypeOf([]IPInfo{}))) + fieldNameMap["target_ips"] = "TargetIps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.virtual_endpoint", fields, reflect.TypeOf(VirtualEndpoint{}), fieldNameMap, validators) +} + +func VirtualMachineBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["compute_ids"] = "ComputeIds" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["guest_info"] = bindings.NewOptionalType(bindings.NewReferenceType(GuestInfoBindingType)) + fieldNameMap["guest_info"] = "GuestInfo" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["local_id_on_host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_id_on_host"] = "LocalIdOnHost" + fields["power_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["power_state"] = "PowerState" + fields["source"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["source"] = "Source" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.virtual_machine", fields, reflect.TypeOf(VirtualMachine{}), fieldNameMap, validators) +} + +func VirtualNetworkInterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["device_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_key"] = "DeviceKey" + fields["device_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_name"] = "DeviceName" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["ip_address_info"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpAddressInfoBindingType), reflect.TypeOf([]IpAddressInfo{}))) + fieldNameMap["ip_address_info"] = "IpAddressInfo" + fields["lport_attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_attachment_id"] = "LportAttachmentId" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["owner_vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["owner_vm_id"] = "OwnerVmId" + fields["owner_vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["owner_vm_type"] = "OwnerVmType" + fields["vm_local_id_on_host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_local_id_on_host"] = "VmLocalIdOnHost" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.virtual_network_interface", fields, reflect.TypeOf(VirtualNetworkInterface{}), fieldNameMap, validators) +} + +func VirtualNetworkInterfaceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VirtualNetworkInterfaceBindingType), reflect.TypeOf([]VirtualNetworkInterface{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.virtual_network_interface_list_result", fields, reflect.TypeOf(VirtualNetworkInterfaceListResult{}), fieldNameMap, validators) +} + +func VirtualPortgroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.virtual_portgroup", fields, reflect.TypeOf(VirtualPortgroup{}), fieldNameMap, validators) +} + +func VirtualSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.virtual_switch", fields, reflect.TypeOf(VirtualSwitch{}), fieldNameMap, validators) +} + +func VmToolsInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["file_agent_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_agent_version"] = "FileAgentVersion" + fields["host_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_local_id"] = "HostLocalId" + fields["network_agent_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_agent_version"] = "NetworkAgentVersion" + fields["source"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["source"] = "Source" + fields["tools_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tools_version"] = "ToolsVersion" + fields["vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_type"] = "VmType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.vm_tools_info", fields, reflect.TypeOf(VmToolsInfo{}), fieldNameMap, validators) +} + +func VniPoolConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["end"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end"] = "End" + fields["start"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start"] = "Start" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.vni_pool_config", fields, reflect.TypeOf(VniPoolConfig{}), fieldNameMap, validators) +} + +func VrfRouteTargetsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["parent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_path"] = "ParentPath" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + fields["relative_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relative_path"] = "RelativePath" + fields["unique_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unique_id"] = "UniqueId" + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ChildPolicyConfigResourceBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["children"] = "Children" + fields["marked_for_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["marked_for_delete"] = "MarkedForDelete" + fields["overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["overridden"] = "Overridden" + fields["address_family"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address_family"] = "AddressFamily" + fields["export_route_targets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["export_route_targets"] = "ExportRouteTargets" + fields["import_route_targets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["import_route_targets"] = "ImportRouteTargets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.vrf_route_targets", fields, reflect.TypeOf(VrfRouteTargets{}), fieldNameMap, validators) +} + +func WeeklyBackupScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["days_of_week"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["days_of_week"] = "DaysOfWeek" + fields["hour_of_day"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hour_of_day"] = "HourOfDay" + fields["minute_of_day"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["minute_of_day"] = "MinuteOfDay" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.weekly_backup_schedule", fields, reflect.TypeOf(WeeklyBackupSchedule{}), fieldNameMap, validators) +} + +func WidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.widget_configuration", fields, reflect.TypeOf(WidgetConfiguration{}), fieldNameMap, validators) +} + +func WidgetConfigurationListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["widgetconfigurations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(WidgetConfigurationBindingType),}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["widgetconfigurations"] = "Widgetconfigurations" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.widget_configuration_list", fields, reflect.TypeOf(WidgetConfigurationList{}), fieldNameMap, validators) +} + +func WidgetItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alignment"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alignment"] = "Alignment" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["separator"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["separator"] = "Separator" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + fields["widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["widget_id"] = "WidgetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.widget_item", fields, reflect.TypeOf(WidgetItem{}), fieldNameMap, validators) +} + +func X509CertificateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dsa_public_key_g"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dsa_public_key_g"] = "DsaPublicKeyg" + fields["dsa_public_key_p"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dsa_public_key_p"] = "DsaPublicKeyp" + fields["dsa_public_key_q"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dsa_public_key_q"] = "DsaPublicKeyq" + fields["dsa_public_key_y"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dsa_public_key_y"] = "DsaPublicKeyy" + fields["ecdsa_curve_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_curve_name"] = "EcdsaCurveName" + fields["ecdsa_ec_field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_ec_field"] = "EcdsaEcField" + fields["ecdsa_ec_field_f2mks"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["ecdsa_ec_field_f2mks"] = "EcdsaEcFieldF2mks" + fields["ecdsa_ec_field_f2mm"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ecdsa_ec_field_f2mm"] = "EcdsaEcFieldF2mm" + fields["ecdsa_ec_field_f2mrp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_ec_field_f2mrp"] = "EcdsaEcFieldF2mrp" + fields["ecdsa_ec_field_f2pp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_ec_field_f2pp"] = "EcdsaEcFieldF2pp" + fields["ecdsa_public_key_a"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_a"] = "EcdsaPublicKeya" + fields["ecdsa_public_key_b"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_b"] = "EcdsaPublicKeyb" + fields["ecdsa_public_key_cofactor"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ecdsa_public_key_cofactor"] = "EcdsaPublicKeyCofactor" + fields["ecdsa_public_key_generator_x"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_generator_x"] = "EcdsaPublicKeyGeneratorx" + fields["ecdsa_public_key_generator_y"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_generator_y"] = "EcdsaPublicKeyGeneratory" + fields["ecdsa_public_key_order"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_order"] = "EcdsaPublicKeyOrder" + fields["ecdsa_public_key_seed"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ecdsa_public_key_seed"] = "EcdsaPublicKeySeed" + fields["is_ca"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_ca"] = "IsCa" + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["issuer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer"] = "Issuer" + fields["issuer_cn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer_cn"] = "IssuerCn" + fields["not_after"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["not_after"] = "NotAfter" + fields["not_before"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["not_before"] = "NotBefore" + fields["public_key_algo"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["public_key_algo"] = "PublicKeyAlgo" + fields["public_key_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["public_key_length"] = "PublicKeyLength" + fields["rsa_public_key_exponent"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rsa_public_key_exponent"] = "RsaPublicKeyExponent" + fields["rsa_public_key_modulus"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rsa_public_key_modulus"] = "RsaPublicKeyModulus" + fields["serial_number"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["serial_number"] = "SerialNumber" + fields["signature"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["signature"] = "Signature" + fields["signature_algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["signature_algorithm"] = "SignatureAlgorithm" + fields["subject"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subject"] = "Subject" + fields["subject_cn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subject_cn"] = "SubjectCn" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.x509_certificate", fields, reflect.TypeOf(X509Certificate{}), fieldNameMap, validators) +} + +func X509CrlBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(X509CrlEntryBindingType), reflect.TypeOf([]X509CrlEntry{}))) + fieldNameMap["crl_entries"] = "CrlEntries" + fields["issuer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer"] = "Issuer" + fields["next_update"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_update"] = "NextUpdate" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.x509_crl", fields, reflect.TypeOf(X509Crl{}), fieldNameMap, validators) +} + +func X509CrlEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["revocation_date"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["revocation_date"] = "RevocationDate" + fields["serial_number"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["serial_number"] = "SerialNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx_global_policy.model.x509_crl_entry", fields, reflect.TypeOf(X509CrlEntry{}), fieldNameMap, validators) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DefaultDslClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DefaultDslClient.go new file mode 100644 index 000000000..36f2eed1a --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DefaultDslClient.go @@ -0,0 +1,182 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Dsl + * Functions that implement the generated DslClient interface + */ + + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultDslClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultDslClient(connector client.Connector) *DefaultDslClient { + interfaceName := "com.vmware.nsx_global_policy.search.dsl" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + dIface := DefaultDslClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + dIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + dIface.methodNameToDefMap["list"] = dIface.listMethodDefinition() + return &dIface +} + +func (dIface *DefaultDslClient) List(queryParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SearchResponse, error) { + typeConverter := dIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(dIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(dslListInputType(), typeConverter) + sv.AddStructField("Query", queryParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SearchResponse + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dslListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := dIface.connector.NewExecutionContext() + methodResult := dIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SearchResponse + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dslListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SearchResponse), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (dIface *DefaultDslClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := dIface.connector.GetApiProvider().Invoke(dIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (dIface *DefaultDslClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(dIface.interfaceName) + typeConverter := dIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(dslListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(dslListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDslClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDslClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + dIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDslClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDslClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDslClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDslClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + dIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultDslClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DefaultQueryClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DefaultQueryClient.go new file mode 100644 index 000000000..b9c9c8d1d --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DefaultQueryClient.go @@ -0,0 +1,182 @@ + +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Client stubs for service: Query + * Functions that implement the generated QueryClient interface + */ + + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +type DefaultQueryClient struct { + interfaceName string + interfaceDefinition core.InterfaceDefinition + methodIdentifiers []core.MethodIdentifier + methodNameToDefMap map[string]*core.MethodDefinition + errorBindingMap map[string]bindings.BindingType + interfaceIdentifier core.InterfaceIdentifier + connector client.Connector +} + +func NewDefaultQueryClient(connector client.Connector) *DefaultQueryClient { + interfaceName := "com.vmware.nsx_global_policy.search.query" + interfaceIdentifier := core.NewInterfaceIdentifier(interfaceName) + methodIdentifiers := []core.MethodIdentifier{ + core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorBindingMap := make(map[string]bindings.BindingType) + errorBindingMap[errors.AlreadyExists{}.Error()] = errors.AlreadyExistsBindingType() + errorBindingMap[errors.AlreadyInDesiredState{}.Error()] = errors.AlreadyInDesiredStateBindingType() + errorBindingMap[errors.Canceled{}.Error()] = errors.CanceledBindingType() + errorBindingMap[errors.ConcurrentChange{}.Error()] = errors.ConcurrentChangeBindingType() + errorBindingMap[errors.Error{}.Error()] = errors.ErrorBindingType() + errorBindingMap[errors.FeatureInUse{}.Error()] = errors.FeatureInUseBindingType() + errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errorBindingMap[errors.InvalidArgument{}.Error()] = errors.InvalidArgumentBindingType() + errorBindingMap[errors.InvalidElementConfiguration{}.Error()] = errors.InvalidElementConfigurationBindingType() + errorBindingMap[errors.InvalidElementType{}.Error()] = errors.InvalidElementTypeBindingType() + errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errorBindingMap[errors.NotAllowedInCurrentState{}.Error()] = errors.NotAllowedInCurrentStateBindingType() + errorBindingMap[errors.OperationNotFound{}.Error()] = errors.OperationNotFoundBindingType() + errorBindingMap[errors.ResourceBusy{}.Error()] = errors.ResourceBusyBindingType() + errorBindingMap[errors.ResourceInUse{}.Error()] = errors.ResourceInUseBindingType() + errorBindingMap[errors.ResourceInaccessible{}.Error()] = errors.ResourceInaccessibleBindingType() + errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errorBindingMap[errors.TimedOut{}.Error()] = errors.TimedOutBindingType() + errorBindingMap[errors.UnableToAllocateResource{}.Error()] = errors.UnableToAllocateResourceBindingType() + errorBindingMap[errors.Unauthenticated{}.Error()] = errors.UnauthenticatedBindingType() + errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errorBindingMap[errors.UnexpectedInput{}.Error()] = errors.UnexpectedInputBindingType() + errorBindingMap[errors.Unsupported{}.Error()] = errors.UnsupportedBindingType() + errorBindingMap[errors.UnverifiedPeer{}.Error()] = errors.UnverifiedPeerBindingType() + + + qIface := DefaultQueryClient{interfaceName: interfaceName, methodIdentifiers: methodIdentifiers, interfaceDefinition: interfaceDefinition, errorBindingMap: errorBindingMap, interfaceIdentifier: interfaceIdentifier, connector: connector} + qIface.methodNameToDefMap = make(map[string]*core.MethodDefinition) + qIface.methodNameToDefMap["list"] = qIface.listMethodDefinition() + return &qIface +} + +func (qIface *DefaultQueryClient) List(queryParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SearchResponse, error) { + typeConverter := qIface.connector.TypeConverter() + methodIdentifier := core.NewMethodIdentifier(qIface.interfaceIdentifier, "list") + sv := bindings.NewStructValueBuilder(queryListInputType(), typeConverter) + sv.AddStructField("Query", queryParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SearchResponse + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := queryListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + qIface.connector.SetConnectionMetadata(connectionMetadata) + executionContext := qIface.connector.NewExecutionContext() + methodResult := qIface.Invoke(executionContext, methodIdentifier, inputDataValue) + var emptyOutput model.SearchResponse + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), queryListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SearchResponse), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), qIface.errorBindingMap[methodResult.Error().Name()]) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + + +func (qIface *DefaultQueryClient) Invoke(ctx *core.ExecutionContext, methodId core.MethodIdentifier, inputDataValue data.DataValue) core.MethodResult { + methodResult := qIface.connector.GetApiProvider().Invoke(qIface.interfaceName, methodId.Name(), inputDataValue, ctx) + return methodResult +} + + +func (qIface *DefaultQueryClient) listMethodDefinition() *core.MethodDefinition { + interfaceIdentifier := core.NewInterfaceIdentifier(qIface.interfaceName) + typeConverter := qIface.connector.TypeConverter() + + input, inputError := typeConverter.ConvertToDataDefinition(queryListInputType()) + output, outputError := typeConverter.ConvertToDataDefinition(queryListOutputType()) + if inputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQueryClient.list method's input - %s", + bindings.VAPIerrorsToError(inputError).Error()) + return nil + } + if outputError != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQueryClient.list method's output - %s", + bindings.VAPIerrorsToError(outputError).Error()) + return nil + } + methodIdentifier := core.NewMethodIdentifier(interfaceIdentifier, "list") + errorDefinitions := make([]data.ErrorDefinition, 0) + qIface.errorBindingMap[errors.InvalidRequest{}.Error()] = errors.InvalidRequestBindingType() + errDef1, errError1 := typeConverter.ConvertToDataDefinition(errors.InvalidRequestBindingType()) + if errError1 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQueryClient.list method's errors.InvalidRequest error - %s", + bindings.VAPIerrorsToError(errError1).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef1.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.Unauthorized{}.Error()] = errors.UnauthorizedBindingType() + errDef2, errError2 := typeConverter.ConvertToDataDefinition(errors.UnauthorizedBindingType()) + if errError2 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQueryClient.list method's errors.Unauthorized error - %s", + bindings.VAPIerrorsToError(errError2).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef2.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.ServiceUnavailable{}.Error()] = errors.ServiceUnavailableBindingType() + errDef3, errError3 := typeConverter.ConvertToDataDefinition(errors.ServiceUnavailableBindingType()) + if errError3 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQueryClient.list method's errors.ServiceUnavailable error - %s", + bindings.VAPIerrorsToError(errError3).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef3.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.InternalServerError{}.Error()] = errors.InternalServerErrorBindingType() + errDef4, errError4 := typeConverter.ConvertToDataDefinition(errors.InternalServerErrorBindingType()) + if errError4 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQueryClient.list method's errors.InternalServerError error - %s", + bindings.VAPIerrorsToError(errError4).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef4.(data.ErrorDefinition)) + qIface.errorBindingMap[errors.NotFound{}.Error()] = errors.NotFoundBindingType() + errDef5, errError5 := typeConverter.ConvertToDataDefinition(errors.NotFoundBindingType()) + if errError5 != nil { + log.Errorf("Error in ConvertToDataDefinition for DefaultQueryClient.list method's errors.NotFound error - %s", + bindings.VAPIerrorsToError(errError5).Error()) + return nil + } + errorDefinitions = append(errorDefinitions, errDef5.(data.ErrorDefinition)) + + methodDefinition := core.NewMethodDefinition(methodIdentifier, input, output, errorDefinitions) + return &methodDefinition +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DslClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DslClient.go new file mode 100644 index 000000000..059c1ff54 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DslClient.go @@ -0,0 +1,34 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Dsl + * Used by client-side stubs. + */ + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type DslClient interface { + + // DSL (Domain Specific Language) search API + // + // @param queryParam Search query (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SearchResponse + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(queryParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SearchResponse, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DslTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DslTypes.go new file mode 100644 index 000000000..8abc5ac88 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/DslTypes.go @@ -0,0 +1,106 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Dsl. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package search + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func dslListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["query"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dslListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SearchResponseBindingType) +} + +func dslListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["query"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["query"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["query"] = "query" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/search/dsl", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/QueryClient.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/QueryClient.go new file mode 100644 index 000000000..1e2d6e17c --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/QueryClient.go @@ -0,0 +1,34 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Interface file for service: Query + * Used by client-side stubs. + */ + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" +) + +type QueryClient interface { + + // Full text search API + // + // @param queryParam Search query (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx_global_policy.model.SearchResponse + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(queryParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SearchResponse, error) +} diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/QueryTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/QueryTypes.go new file mode 100644 index 000000000..b603b1aee --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/QueryTypes.go @@ -0,0 +1,106 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for service: Query. + * Includes binding types of a structures and enumerations defined in the service. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package search + +import ( + "reflect" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" +) + + + + + +func queryListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["query"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func queryListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SearchResponseBindingType) +} + +func queryListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["query"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["query"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["query"] = "query" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/global-manager/api/v1/search/query", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400,"com.vmware.vapi.std.errors.unauthorized": 403,"com.vmware.vapi.std.errors.service_unavailable": 503,"com.vmware.vapi.std.errors.internal_server_error": 500,"com.vmware.vapi.std.errors.not_found": 404}) +} + + diff --git a/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/SearchPackageTypes.go b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/SearchPackageTypes.go new file mode 100644 index 000000000..3c88a57d5 --- /dev/null +++ b/vendor/github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search/SearchPackageTypes.go @@ -0,0 +1,19 @@ +/* Copyright © 2019 VMware, Inc. All Rights Reserved. + SPDX-License-Identifier: BSD-2-Clause */ + +// Code generated. DO NOT EDIT. + +/* + * Data type definitions file for package: com.vmware.nsx_global_policy.search. + * Includes binding types of a top level structures and enumerations. + * Shared by client-side stubs and server-side skeletons to ensure type + * compatibility. + */ + +package search + + + + + + diff --git a/vendor/github.com/zclconf/go-cty/cty/capsule.go b/vendor/github.com/zclconf/go-cty/cty/capsule.go index d273d1483..2fdc15eae 100644 --- a/vendor/github.com/zclconf/go-cty/cty/capsule.go +++ b/vendor/github.com/zclconf/go-cty/cty/capsule.go @@ -9,6 +9,7 @@ type capsuleType struct { typeImplSigil Name string GoType reflect.Type + Ops *CapsuleOps } func (t *capsuleType) Equals(other Type) bool { @@ -24,10 +25,22 @@ func (t *capsuleType) FriendlyName(mode friendlyTypeNameMode) string { } func (t *capsuleType) GoString() string { - // To get a useful representation of our native type requires some - // shenanigans. - victimVal := reflect.Zero(t.GoType) - return fmt.Sprintf("cty.Capsule(%q, reflect.TypeOf(%#v))", t.Name, victimVal.Interface()) + impl := t.Ops.TypeGoString + if impl == nil { + // To get a useful representation of our native type requires some + // shenanigans. + victimVal := reflect.Zero(t.GoType) + if t.Ops == noCapsuleOps { + return fmt.Sprintf("cty.Capsule(%q, reflect.TypeOf(%#v))", t.Name, victimVal.Interface()) + } else { + // Including the operations in the output will make this _very_ long, + // so in practice any capsule type with ops ought to provide a + // TypeGoString function to override this with something more + // reasonable. + return fmt.Sprintf("cty.CapsuleWithOps(%q, reflect.TypeOf(%#v), %#v)", t.Name, victimVal.Interface(), t.Ops) + } + } + return impl(t.GoType) } // Capsule creates a new Capsule type. @@ -47,8 +60,11 @@ func (t *capsuleType) GoString() string { // use the same native type. // // Each capsule-typed value contains a pointer to a value of the given native -// type. A capsule-typed value supports no operations except equality, and -// equality is implemented by pointer identity of the encapsulated pointer. +// type. A capsule-typed value by default supports no operations except +// equality, and equality is implemented by pointer identity of the +// encapsulated pointer. A capsule type can optionally have its own +// implementations of certain operations if it is created with CapsuleWithOps +// instead of Capsule. // // The given name is used as the new type's "friendly name". This can be any // string in principle, but will usually be a short, all-lowercase name aimed @@ -65,6 +81,29 @@ func Capsule(name string, nativeType reflect.Type) Type { &capsuleType{ Name: name, GoType: nativeType, + Ops: noCapsuleOps, + }, + } +} + +// CapsuleWithOps is like Capsule except the caller may provide an object +// representing some overloaded operation implementations to associate with +// the given capsule type. +// +// All of the other caveats and restrictions for capsule types still apply, but +// overloaded operations can potentially help a capsule type participate better +// in cty operations. +func CapsuleWithOps(name string, nativeType reflect.Type, ops *CapsuleOps) Type { + // Copy the operations to make sure the caller can't modify them after + // we're constructed. + ourOps := *ops + ourOps.assertValid() + + return Type{ + &capsuleType{ + Name: name, + GoType: nativeType, + Ops: &ourOps, }, } } diff --git a/vendor/github.com/zclconf/go-cty/cty/capsule_ops.go b/vendor/github.com/zclconf/go-cty/cty/capsule_ops.go new file mode 100644 index 000000000..3ff6855ec --- /dev/null +++ b/vendor/github.com/zclconf/go-cty/cty/capsule_ops.go @@ -0,0 +1,132 @@ +package cty + +import ( + "reflect" +) + +// CapsuleOps represents a set of overloaded operations for a capsule type. +// +// Each field is a reference to a function that can either be nil or can be +// set to an implementation of the corresponding operation. If an operation +// function is nil then it isn't supported for the given capsule type. +type CapsuleOps struct { + // GoString provides the GoString implementation for values of the + // corresponding type. Conventionally this should return a string + // representation of an expression that would produce an equivalent + // value. + GoString func(val interface{}) string + + // TypeGoString provides the GoString implementation for the corresponding + // capsule type itself. + TypeGoString func(goTy reflect.Type) string + + // Equals provides the implementation of the Equals operation. This is + // called only with known, non-null values of the corresponding type, + // but if the corresponding type is a compound type then it must be + // ready to detect and handle nested unknown or null values, usually + // by recursively calling Value.Equals on those nested values. + // + // The result value must always be of type cty.Bool, or the Equals + // operation will panic. + // + // If RawEquals is set without also setting Equals, the RawEquals + // implementation will be used as a fallback implementation. That fallback + // is appropriate only for leaf types that do not contain any nested + // cty.Value that would need to distinguish Equals vs. RawEquals for their + // own equality. + // + // If RawEquals is nil then Equals must also be nil, selecting the default + // pointer-identity comparison instead. + Equals func(a, b interface{}) Value + + // RawEquals provides the implementation of the RawEquals operation. + // This is called only with known, non-null values of the corresponding + // type, but if the corresponding type is a compound type then it must be + // ready to detect and handle nested unknown or null values, usually + // by recursively calling Value.RawEquals on those nested values. + // + // If RawEquals is nil, values of the corresponding type are compared by + // pointer identity of the encapsulated value. + RawEquals func(a, b interface{}) bool + + // ConversionFrom can provide conversions from the corresponding type to + // some other type when values of the corresponding type are used with + // the "convert" package. (The main cty package does not use this operation.) + // + // This function itself returns a function, allowing it to switch its + // behavior depending on the given source type. Return nil to indicate + // that no such conversion is available. + ConversionFrom func(src Type) func(interface{}, Path) (Value, error) + + // ConversionTo can provide conversions to the corresponding type from + // some other type when values of the corresponding type are used with + // the "convert" package. (The main cty package does not use this operation.) + // + // This function itself returns a function, allowing it to switch its + // behavior depending on the given destination type. Return nil to indicate + // that no such conversion is available. + ConversionTo func(dst Type) func(Value, Path) (interface{}, error) + + // ExtensionData is an extension point for applications that wish to + // create their own extension features using capsule types. + // + // The key argument is any value that can be compared with Go's == + // operator, but should be of a named type in a package belonging to the + // application defining the key. An ExtensionData implementation must + // check to see if the given key is familar to it, and if so return a + // suitable value for the key. + // + // If the given key is unrecognized, the ExtensionData function must + // return a nil interface. (Importantly, not an interface containing a nil + // pointer of some other type.) + // The common implementation of ExtensionData is a single switch statement + // over "key" which has a default case returning nil. + // + // The meaning of any given key is entirely up to the application that + // defines it. Applications consuming ExtensionData from capsule types + // should do so defensively: if the result of ExtensionData is not valid, + // prefer to ignore it or gracefully produce an error rather than causing + // a panic. + ExtensionData func(key interface{}) interface{} +} + +// noCapsuleOps is a pointer to a CapsuleOps with no functions set, which +// is used as the default operations value when a type is created using +// the Capsule function. +var noCapsuleOps = &CapsuleOps{} + +func (ops *CapsuleOps) assertValid() { + if ops.RawEquals == nil && ops.Equals != nil { + panic("Equals cannot be set without RawEquals") + } +} + +// CapsuleOps returns a pointer to the CapsuleOps value for a capsule type, +// or panics if the receiver is not a capsule type. +// +// The caller must not modify the CapsuleOps. +func (ty Type) CapsuleOps() *CapsuleOps { + if !ty.IsCapsuleType() { + panic("not a capsule-typed value") + } + + return ty.typeImpl.(*capsuleType).Ops +} + +// CapsuleExtensionData is a convenience interface to the ExtensionData +// function that can be optionally implemented for a capsule type. It will +// check to see if the underlying type implements ExtensionData and call it +// if so. If not, it will return nil to indicate that the given key is not +// supported. +// +// See the documentation for CapsuleOps.ExtensionData for more information +// on the purpose of and usage of this mechanism. +// +// If CapsuleExtensionData is called on a non-capsule type then it will panic. +func (ty Type) CapsuleExtensionData(key interface{}) interface{} { + ops := ty.CapsuleOps() + if ops.ExtensionData == nil { + return nil + } + return ops.ExtensionData(key) +} diff --git a/vendor/github.com/zclconf/go-cty/cty/convert/conversion.go b/vendor/github.com/zclconf/go-cty/cty/convert/conversion.go index f9aacb4ee..ee35e9de7 100644 --- a/vendor/github.com/zclconf/go-cty/cty/convert/conversion.go +++ b/vendor/github.com/zclconf/go-cty/cty/convert/conversion.go @@ -16,7 +16,19 @@ func getConversion(in cty.Type, out cty.Type, unsafe bool) conversion { // Wrap the conversion in some standard checks that we don't want to // have to repeat in every conversion function. - return func(in cty.Value, path cty.Path) (cty.Value, error) { + var ret conversion + ret = func(in cty.Value, path cty.Path) (cty.Value, error) { + if in.IsMarked() { + // We must unmark during the conversion and then re-apply the + // same marks to the result. + in, inMarks := in.Unmark() + v, err := ret(in, path) + if v != cty.NilVal { + v = v.WithMarks(inMarks) + } + return v, err + } + if out == cty.DynamicPseudoType { // Conversion to DynamicPseudoType always just passes through verbatim. return in, nil @@ -33,6 +45,8 @@ func getConversion(in cty.Type, out cty.Type, unsafe bool) conversion { return conv(in, path) } + + return ret } func getConversionKnown(in cty.Type, out cty.Type, unsafe bool) conversion { @@ -124,6 +138,30 @@ func getConversionKnown(in cty.Type, out cty.Type, unsafe bool) conversion { outEty := out.ElementType() return conversionObjectToMap(in, outEty, unsafe) + case in.IsCapsuleType() || out.IsCapsuleType(): + if !unsafe { + // Capsule types can only participate in "unsafe" conversions, + // because we don't know enough about their conversion behaviors + // to be sure that they will always be safe. + return nil + } + if in.Equals(out) { + // conversion to self is never allowed + return nil + } + if out.IsCapsuleType() { + if fn := out.CapsuleOps().ConversionTo; fn != nil { + return conversionToCapsule(in, out, fn) + } + } + if in.IsCapsuleType() { + if fn := in.CapsuleOps().ConversionFrom; fn != nil { + return conversionFromCapsule(in, out, fn) + } + } + // No conversion operation is available, then. + return nil + default: return nil diff --git a/vendor/github.com/zclconf/go-cty/cty/convert/conversion_capsule.go b/vendor/github.com/zclconf/go-cty/cty/convert/conversion_capsule.go new file mode 100644 index 000000000..ded4079d4 --- /dev/null +++ b/vendor/github.com/zclconf/go-cty/cty/convert/conversion_capsule.go @@ -0,0 +1,31 @@ +package convert + +import ( + "github.com/zclconf/go-cty/cty" +) + +func conversionToCapsule(inTy, outTy cty.Type, fn func(inTy cty.Type) func(cty.Value, cty.Path) (interface{}, error)) conversion { + rawConv := fn(inTy) + if rawConv == nil { + return nil + } + + return func(in cty.Value, path cty.Path) (cty.Value, error) { + rawV, err := rawConv(in, path) + if err != nil { + return cty.NilVal, err + } + return cty.CapsuleVal(outTy, rawV), nil + } +} + +func conversionFromCapsule(inTy, outTy cty.Type, fn func(outTy cty.Type) func(interface{}, cty.Path) (cty.Value, error)) conversion { + rawConv := fn(outTy) + if rawConv == nil { + return nil + } + + return func(in cty.Value, path cty.Path) (cty.Value, error) { + return rawConv(in.EncapsulatedValue(), path) + } +} diff --git a/vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go b/vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go index e0dbf491e..0d6fae964 100644 --- a/vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go +++ b/vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go @@ -1,6 +1,8 @@ package convert import ( + "strings" + "github.com/zclconf/go-cty/cty" ) @@ -41,7 +43,14 @@ var primitiveConversionsUnsafe = map[cty.Type]map[cty.Type]conversion{ case "false", "0": return cty.False, nil default: - return cty.NilVal, path.NewErrorf("a bool is required") + switch strings.ToLower(val.AsString()) { + case "true": + return cty.NilVal, path.NewErrorf("a bool is required; to convert from string, use lowercase \"true\"") + case "false": + return cty.NilVal, path.NewErrorf("a bool is required; to convert from string, use lowercase \"false\"") + default: + return cty.NilVal, path.NewErrorf("a bool is required") + } } }, }, diff --git a/vendor/github.com/zclconf/go-cty/cty/element_iterator.go b/vendor/github.com/zclconf/go-cty/cty/element_iterator.go index 0bf84c774..9e4fff66f 100644 --- a/vendor/github.com/zclconf/go-cty/cty/element_iterator.go +++ b/vendor/github.com/zclconf/go-cty/cty/element_iterator.go @@ -23,6 +23,8 @@ type ElementIterator interface { func canElementIterator(val Value) bool { switch { + case val.IsMarked(): + return false case val.ty.IsListType(): return true case val.ty.IsMapType(): @@ -39,6 +41,7 @@ func canElementIterator(val Value) bool { } func elementIterator(val Value) ElementIterator { + val.assertUnmarked() switch { case val.ty.IsListType(): return &listElementIterator{ diff --git a/vendor/github.com/zclconf/go-cty/cty/function/argument.go b/vendor/github.com/zclconf/go-cty/cty/function/argument.go index bfd30157e..5a26c275f 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/argument.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/argument.go @@ -47,4 +47,24 @@ type Parameter struct { // values are not, thus improving the type-check accuracy of derived // values. AllowDynamicType bool + + // If AllowMarked is set then marked values may be passed into this + // argument's slot in the implementation function. If not set, any + // marked value will be unmarked before calling and then the markings + // from that value will be applied automatically to the function result, + // ensuring that the marks get propagated in a simplistic way even if + // a function is unable to handle them. + // + // For any argument whose parameter has AllowMarked set, it's the + // function implementation's responsibility to Unmark the given value + // and propagate the marks appropriatedly to the result in order to + // avoid losing the marks. Application-specific functions might use + // special rules to selectively propagate particular marks. + // + // The automatic unmarking of values applies only to the main + // implementation function. In an application that uses marked values, + // the Type implementation for a function must always be prepared to accept + // marked values, which is easy to achieve by consulting only the type + // and ignoring the value itself. + AllowMarked bool } diff --git a/vendor/github.com/zclconf/go-cty/cty/function/function.go b/vendor/github.com/zclconf/go-cty/cty/function/function.go index 9e8bf3376..efd882725 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/function.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/function.go @@ -142,6 +142,21 @@ func (f Function) ReturnTypeForValues(args []cty.Value) (ty cty.Type, err error) for i, spec := range f.spec.Params { val := posArgs[i] + if val.IsMarked() && !spec.AllowMarked { + // During type checking we just unmark values and discard their + // marks, under the assumption that during actual execution of + // the function we'll do similarly and then re-apply the marks + // afterwards. Note that this does mean that a function that + // inspects values (rather than just types) in its Type + // implementation can potentially fail to take into account marks, + // unless it specifically opts in to seeing them. + unmarked, _ := val.Unmark() + newArgs := make([]cty.Value, len(args)) + copy(newArgs, args) + newArgs[i] = unmarked + args = newArgs + } + if val.IsNull() && !spec.AllowNull { return cty.Type{}, NewArgErrorf(i, "argument must not be null") } @@ -168,6 +183,15 @@ func (f Function) ReturnTypeForValues(args []cty.Value) (ty cty.Type, err error) for i, val := range varArgs { realI := i + len(posArgs) + if val.IsMarked() && !spec.AllowMarked { + // See the similar block in the loop above for what's going on here. + unmarked, _ := val.Unmark() + newArgs := make([]cty.Value, len(args)) + copy(newArgs, args) + newArgs[realI] = unmarked + args = newArgs + } + if val.IsNull() && !spec.AllowNull { return cty.Type{}, NewArgErrorf(realI, "argument must not be null") } @@ -208,9 +232,10 @@ func (f Function) Call(args []cty.Value) (val cty.Value, err error) { // Type checking already dealt with most situations relating to our // parameter specification, but we still need to deal with unknown - // values. + // values and marked values. posArgs := args[:len(f.spec.Params)] varArgs := args[len(f.spec.Params):] + var resultMarks []cty.ValueMarks for i, spec := range f.spec.Params { val := posArgs[i] @@ -218,14 +243,37 @@ func (f Function) Call(args []cty.Value) (val cty.Value, err error) { if !val.IsKnown() && !spec.AllowUnknown { return cty.UnknownVal(expectedType), nil } + + if val.IsMarked() && !spec.AllowMarked { + unwrappedVal, marks := val.Unmark() + // In order to avoid additional overhead on applications that + // are not using marked values, we copy the given args only + // if we encounter a marked value we need to unmark. However, + // as a consequence we end up doing redundant copying if multiple + // marked values need to be unwrapped. That seems okay because + // argument lists are generally small. + newArgs := make([]cty.Value, len(args)) + copy(newArgs, args) + newArgs[i] = unwrappedVal + resultMarks = append(resultMarks, marks) + args = newArgs + } } if f.spec.VarParam != nil { spec := f.spec.VarParam - for _, val := range varArgs { + for i, val := range varArgs { if !val.IsKnown() && !spec.AllowUnknown { return cty.UnknownVal(expectedType), nil } + if val.IsMarked() && !spec.AllowMarked { + unwrappedVal, marks := val.Unmark() + newArgs := make([]cty.Value, len(args)) + copy(newArgs, args) + newArgs[len(posArgs)+i] = unwrappedVal + resultMarks = append(resultMarks, marks) + args = newArgs + } } } @@ -244,6 +292,9 @@ func (f Function) Call(args []cty.Value) (val cty.Value, err error) { if err != nil { return cty.NilVal, err } + if len(resultMarks) > 0 { + retVal = retVal.WithMarks(resultMarks...) + } } // Returned value must conform to what the Type function expected, to diff --git a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/bool.go b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/bool.go index a473d0ec3..4f1ecc8d9 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/bool.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/bool.go @@ -11,6 +11,7 @@ var NotFunc = function.New(&function.Spec{ Name: "val", Type: cty.Bool, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Bool), @@ -25,11 +26,13 @@ var AndFunc = function.New(&function.Spec{ Name: "a", Type: cty.Bool, AllowDynamicType: true, + AllowMarked: true, }, { Name: "b", Type: cty.Bool, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Bool), @@ -44,11 +47,13 @@ var OrFunc = function.New(&function.Spec{ Name: "a", Type: cty.Bool, AllowDynamicType: true, + AllowMarked: true, }, { Name: "b", Type: cty.Bool, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Bool), diff --git a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go index 664790b46..834e9b6fc 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go @@ -80,6 +80,7 @@ var FormatListFunc = function.New(&function.Spec{ lenChooser := -1 iterators := make([]cty.ElementIterator, len(args)) singleVals := make([]cty.Value, len(args)) + unknowns := make([]bool, len(args)) for i, arg := range args { argTy := arg.Type() switch { @@ -87,7 +88,8 @@ var FormatListFunc = function.New(&function.Spec{ if !argTy.IsTupleType() && !arg.IsKnown() { // We can't iterate this one at all yet then, so we can't // yet produce a result. - return cty.UnknownVal(retType), nil + unknowns[i] = true + continue } thisLen := arg.LengthInt() if iterLen == -1 { @@ -103,12 +105,26 @@ var FormatListFunc = function.New(&function.Spec{ ) } } + if !arg.IsKnown() { + // We allowed an unknown tuple value to fall through in + // our initial check above so that we'd be able to run + // the above error checks against it, but we still can't + // iterate it if the checks pass. + unknowns[i] = true + continue + } iterators[i] = arg.ElementIterator() default: singleVals[i] = arg } } + for _, isUnk := range unknowns { + if isUnk { + return cty.UnknownVal(retType), nil + } + } + if iterLen == 0 { // If our sequences are all empty then our result must be empty. return cty.ListValEmpty(cty.String), nil diff --git a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go index bd9b2e51b..480305e83 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go @@ -14,6 +14,7 @@ var AbsoluteFunc = function.New(&function.Spec{ Name: "num", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Number), @@ -196,11 +197,13 @@ var GreaterThanFunc = function.New(&function.Spec{ Name: "a", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, { Name: "b", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Bool), @@ -215,11 +218,13 @@ var GreaterThanOrEqualToFunc = function.New(&function.Spec{ Name: "a", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, { Name: "b", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Bool), @@ -234,11 +239,13 @@ var LessThanFunc = function.New(&function.Spec{ Name: "a", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, { Name: "b", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Bool), @@ -253,11 +260,13 @@ var LessThanOrEqualToFunc = function.New(&function.Spec{ Name: "a", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, { Name: "b", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Bool), @@ -272,6 +281,7 @@ var NegateFunc = function.New(&function.Spec{ Name: "num", Type: cty.Number, AllowDynamicType: true, + AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Number), diff --git a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string.go b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string.go index d7c89fa82..12e9dbc3d 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string.go @@ -3,10 +3,10 @@ package stdlib import ( "strings" + "github.com/apparentlymart/go-textseg/textseg" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/gocty" - "github.com/apparentlymart/go-textseg/textseg" ) var UpperFunc = function.New(&function.Spec{ diff --git a/vendor/github.com/zclconf/go-cty/cty/gob.go b/vendor/github.com/zclconf/go-cty/cty/gob.go index a77dace27..a0961b8a0 100644 --- a/vendor/github.com/zclconf/go-cty/cty/gob.go +++ b/vendor/github.com/zclconf/go-cty/cty/gob.go @@ -3,8 +3,11 @@ package cty import ( "bytes" "encoding/gob" + "errors" "fmt" "math/big" + + "github.com/zclconf/go-cty/cty/set" ) // GobEncode is an implementation of the gob.GobEncoder interface, which @@ -13,6 +16,10 @@ import ( // Currently it is not possible to represent values of capsule types in gob, // because the types themselves cannot be represented. func (val Value) GobEncode() ([]byte, error) { + if val.IsMarked() { + return nil, errors.New("value is marked") + } + buf := &bytes.Buffer{} enc := gob.NewEncoder(buf) @@ -46,11 +53,12 @@ func (val *Value) GobDecode(buf []byte) error { return fmt.Errorf("unsupported cty.Value encoding version %d; only 0 is supported", gv.Version) } - // big.Float seems to, for some reason, lose its "pointerness" when we - // round-trip it, so we'll fix that here. - if bf, ok := gv.V.(big.Float); ok { - gv.V = &bf - } + // Because big.Float.GobEncode is implemented with a pointer reciever, + // gob encoding of an interface{} containing a *big.Float value does not + // round-trip correctly, emerging instead as a non-pointer big.Float. + // The rest of cty expects all number values to be represented by + // *big.Float, so we'll fix that up here. + gv.V = gobDecodeFixNumberPtr(gv.V, gv.Ty) val.ty = gv.Ty val.v = gv.V @@ -123,3 +131,74 @@ type gobType struct { type gobCapsuleTypeImpl struct { } + +// goDecodeFixNumberPtr fixes an unfortunate quirk of round-tripping cty.Number +// values through gob: the big.Float.GobEncode method is implemented on a +// pointer receiver, and so it loses the "pointer-ness" of the value on +// encode, causing the values to emerge the other end as big.Float rather than +// *big.Float as we expect elsewhere in cty. +// +// The implementation of gobDecodeFixNumberPtr mutates the given raw value +// during its work, and may either return the same value mutated or a new +// value. Callers must no longer use whatever value they pass as "raw" after +// this function is called. +func gobDecodeFixNumberPtr(raw interface{}, ty Type) interface{} { + // Unfortunately we need to work recursively here because number values + // might be embedded in structural or collection type values. + + switch { + case ty.Equals(Number): + if bf, ok := raw.(big.Float); ok { + return &bf // wrap in pointer + } + case ty.IsMapType() && ty.ElementType().Equals(Number): + if m, ok := raw.(map[string]interface{}); ok { + for k, v := range m { + m[k] = gobDecodeFixNumberPtr(v, ty.ElementType()) + } + } + case ty.IsListType() && ty.ElementType().Equals(Number): + if s, ok := raw.([]interface{}); ok { + for i, v := range s { + s[i] = gobDecodeFixNumberPtr(v, ty.ElementType()) + } + } + case ty.IsSetType() && ty.ElementType().Equals(Number): + if s, ok := raw.(set.Set); ok { + newS := set.NewSet(s.Rules()) + for it := s.Iterator(); it.Next(); { + newV := gobDecodeFixNumberPtr(it.Value(), ty.ElementType()) + newS.Add(newV) + } + return newS + } + case ty.IsObjectType(): + if m, ok := raw.(map[string]interface{}); ok { + for k, v := range m { + aty := ty.AttributeType(k) + m[k] = gobDecodeFixNumberPtr(v, aty) + } + } + case ty.IsTupleType(): + if s, ok := raw.([]interface{}); ok { + for i, v := range s { + ety := ty.TupleElementType(i) + s[i] = gobDecodeFixNumberPtr(v, ety) + } + } + } + + return raw +} + +// gobDecodeFixNumberPtrVal is a helper wrapper around gobDecodeFixNumberPtr +// that works with already-constructed values. This is primarily for testing, +// to fix up intentionally-invalid number values for the parts of the test +// code that need them to be valid, such as calling GoString on them. +func gobDecodeFixNumberPtrVal(v Value) Value { + raw := gobDecodeFixNumberPtr(v.v, v.ty) + return Value{ + v: raw, + ty: v.ty, + } +} diff --git a/vendor/github.com/zclconf/go-cty/cty/json/marshal.go b/vendor/github.com/zclconf/go-cty/cty/json/marshal.go index f7bea1a2f..75e02577b 100644 --- a/vendor/github.com/zclconf/go-cty/cty/json/marshal.go +++ b/vendor/github.com/zclconf/go-cty/cty/json/marshal.go @@ -9,6 +9,10 @@ import ( ) func marshal(val cty.Value, t cty.Type, path cty.Path, b *bytes.Buffer) error { + if val.IsMarked() { + return path.NewErrorf("value has marks, so it cannot be seralized") + } + // If we're going to decode as DynamicPseudoType then we need to save // dynamic type information to recover the real type. if t == cty.DynamicPseudoType && val.Type() != cty.DynamicPseudoType { diff --git a/vendor/github.com/zclconf/go-cty/cty/marks.go b/vendor/github.com/zclconf/go-cty/cty/marks.go new file mode 100644 index 000000000..3898e4553 --- /dev/null +++ b/vendor/github.com/zclconf/go-cty/cty/marks.go @@ -0,0 +1,296 @@ +package cty + +import ( + "fmt" + "strings" +) + +// marker is an internal wrapper type used to add special "marks" to values. +// +// A "mark" is an annotation that can be used to represent additional +// characteristics of values that propagate through operation methods to +// result values. However, a marked value cannot be used with integration +// methods normally associated with its type, in order to ensure that +// calling applications don't inadvertently drop marks as they round-trip +// values out of cty and back in again. +// +// Marked values are created only explicitly by the calling application, so +// an application that never marks a value does not need to worry about +// encountering marked values. +type marker struct { + realV interface{} + marks ValueMarks +} + +// ValueMarks is a map, representing a set, of "mark" values associated with +// a Value. See Value.Mark for more information on the usage of mark values. +type ValueMarks map[interface{}]struct{} + +// NewValueMarks constructs a new ValueMarks set with the given mark values. +func NewValueMarks(marks ...interface{}) ValueMarks { + if len(marks) == 0 { + return nil + } + ret := make(ValueMarks, len(marks)) + for _, v := range marks { + ret[v] = struct{}{} + } + return ret +} + +// Equal returns true if the receiver and the given ValueMarks both contain +// the same marks. +func (m ValueMarks) Equal(o ValueMarks) bool { + if len(m) != len(o) { + return false + } + for v := range m { + if _, ok := o[v]; !ok { + return false + } + } + return true +} + +func (m ValueMarks) GoString() string { + var s strings.Builder + s.WriteString("cty.NewValueMarks(") + i := 0 + for mv := range m { + if i != 0 { + s.WriteString(", ") + } + s.WriteString(fmt.Sprintf("%#v", mv)) + i++ + } + s.WriteString(")") + return s.String() +} + +// IsMarked returns true if and only if the receiving value carries at least +// one mark. A marked value cannot be used directly with integration methods +// without explicitly unmarking it (and retrieving the markings) first. +func (val Value) IsMarked() bool { + _, ok := val.v.(marker) + return ok +} + +// HasMark returns true if and only if the receiving value has the given mark. +func (val Value) HasMark(mark interface{}) bool { + if mr, ok := val.v.(marker); ok { + _, ok := mr.marks[mark] + return ok + } + return false +} + +// ContainsMarked returns true if the receiving value or any value within it +// is marked. +// +// This operation is relatively expensive. If you only need a shallow result, +// use IsMarked instead. +func (val Value) ContainsMarked() bool { + ret := false + Walk(val, func(_ Path, v Value) (bool, error) { + if v.IsMarked() { + ret = true + return false, nil + } + return true, nil + }) + return ret +} + +func (val Value) assertUnmarked() { + if val.IsMarked() { + panic("value is marked, so must be unmarked first") + } +} + +// Marks returns a map (representing a set) of all of the mark values +// associated with the receiving value, without changing the marks. Returns nil +// if the value is not marked at all. +func (val Value) Marks() ValueMarks { + if mr, ok := val.v.(marker); ok { + // copy so that the caller can't mutate our internals + ret := make(ValueMarks, len(mr.marks)) + for k, v := range mr.marks { + ret[k] = v + } + return ret + } + return nil +} + +// HasSameMarks returns true if an only if the receiver and the given other +// value have identical marks. +func (val Value) HasSameMarks(other Value) bool { + vm, vmOK := val.v.(marker) + om, omOK := other.v.(marker) + if vmOK != omOK { + return false + } + if vmOK { + return vm.marks.Equal(om.marks) + } + return true +} + +// Mark returns a new value that as the same type and underlying value as +// the receiver but that also carries the given value as a "mark". +// +// Marks are used to carry additional application-specific characteristics +// associated with values. A marked value can be used with operation methods, +// in which case the marks are propagated to the operation results. A marked +// value _cannot_ be used with integration methods, so callers of those +// must derive an unmarked value using Unmark (and thus explicitly handle +// the markings) before calling the integration methods. +// +// The mark value can be any value that would be valid to use as a map key. +// The mark value should be of a named type in order to use the type itself +// as a namespace for markings. That type can be unexported if desired, in +// order to ensure that the mark can only be handled through the defining +// package's own functions. +// +// An application that never calls this method does not need to worry about +// handling marked values. +func (val Value) Mark(mark interface{}) Value { + var newMarker marker + newMarker.realV = val.v + if mr, ok := val.v.(marker); ok { + // It's already a marker, so we'll retain existing marks. + newMarker.marks = make(ValueMarks, len(mr.marks)+1) + for k, v := range mr.marks { + newMarker.marks[k] = v + } + } else { + // It's not a marker yet, so we're creating the first mark. + newMarker.marks = make(ValueMarks, 1) + } + newMarker.marks[mark] = struct{}{} + return Value{ + ty: val.ty, + v: newMarker, + } +} + +// Unmark separates the marks of the receiving value from the value itself, +// removing a new unmarked value and a map (representing a set) of the marks. +// +// If the receiver isn't marked, Unmark returns it verbatim along with a nil +// map of marks. +func (val Value) Unmark() (Value, ValueMarks) { + if !val.IsMarked() { + return val, nil + } + mr := val.v.(marker) + marks := val.Marks() // copy so that the caller can't mutate our internals + return Value{ + ty: val.ty, + v: mr.realV, + }, marks +} + +// UnmarkDeep is similar to Unmark, but it works with an entire nested structure +// rather than just the given value directly. +// +// The result is guaranteed to contain no nested values that are marked, and +// the returned marks set includes the superset of all of the marks encountered +// during the operation. +func (val Value) UnmarkDeep() (Value, ValueMarks) { + marks := make(ValueMarks) + ret, _ := Transform(val, func(_ Path, v Value) (Value, error) { + unmarkedV, valueMarks := v.Unmark() + for m, s := range valueMarks { + marks[m] = s + } + return unmarkedV, nil + }) + return ret, marks +} + +func (val Value) unmarkForce() Value { + unw, _ := val.Unmark() + return unw +} + +// WithMarks returns a new value that has the same type and underlying value +// as the receiver and also has the marks from the given maps (representing +// sets). +func (val Value) WithMarks(marks ...ValueMarks) Value { + if len(marks) == 0 { + return val + } + ownMarks := val.Marks() + markCount := len(ownMarks) + for _, s := range marks { + markCount += len(s) + } + if markCount == 0 { + return val + } + newMarks := make(ValueMarks, markCount) + for m := range ownMarks { + newMarks[m] = struct{}{} + } + for _, s := range marks { + for m := range s { + newMarks[m] = struct{}{} + } + } + v := val.v + if mr, ok := v.(marker); ok { + v = mr.realV + } + return Value{ + ty: val.ty, + v: marker{ + realV: v, + marks: newMarks, + }, + } +} + +// WithSameMarks returns a new value that has the same type and underlying +// value as the receiver and also has the marks from the given source values. +// +// Use this if you are implementing your own higher-level operations against +// cty using the integration methods, to re-introduce the marks from the +// source values of the operation. +func (val Value) WithSameMarks(srcs ...Value) Value { + if len(srcs) == 0 { + return val + } + ownMarks := val.Marks() + markCount := len(ownMarks) + for _, sv := range srcs { + if mr, ok := sv.v.(marker); ok { + markCount += len(mr.marks) + } + } + if markCount == 0 { + return val + } + newMarks := make(ValueMarks, markCount) + for m := range ownMarks { + newMarks[m] = struct{}{} + } + for _, sv := range srcs { + if mr, ok := sv.v.(marker); ok { + for m := range mr.marks { + newMarks[m] = struct{}{} + } + } + } + v := val.v + if mr, ok := v.(marker); ok { + v = mr.realV + } + return Value{ + ty: val.ty, + v: marker{ + realV: v, + marks: newMarks, + }, + } +} diff --git a/vendor/github.com/zclconf/go-cty/cty/msgpack/marshal.go b/vendor/github.com/zclconf/go-cty/cty/msgpack/marshal.go index 87b096ca4..51c75aa8d 100644 --- a/vendor/github.com/zclconf/go-cty/cty/msgpack/marshal.go +++ b/vendor/github.com/zclconf/go-cty/cty/msgpack/marshal.go @@ -41,6 +41,10 @@ func Marshal(val cty.Value, ty cty.Type) ([]byte, error) { } func marshal(val cty.Value, ty cty.Type, path cty.Path, enc *msgpack.Encoder) error { + if val.IsMarked() { + return path.NewErrorf("value has marks, so it cannot be seralized") + } + // If we're going to decode as DynamicPseudoType then we need to save // dynamic type information to recover the real type. if ty == cty.DynamicPseudoType && val.Type() != cty.DynamicPseudoType { diff --git a/vendor/github.com/zclconf/go-cty/cty/set_helper.go b/vendor/github.com/zclconf/go-cty/cty/set_helper.go index a88ddaffb..962bb5295 100644 --- a/vendor/github.com/zclconf/go-cty/cty/set_helper.go +++ b/vendor/github.com/zclconf/go-cty/cty/set_helper.go @@ -119,7 +119,13 @@ func (s ValueSet) SymmetricDifference(other ValueSet) ValueSet { } // requireElementType panics if the given value is not of the set's element type. +// +// It also panics if the given value is marked, because marked values cannot +// be stored in sets. func (s ValueSet) requireElementType(v Value) { + if v.IsMarked() { + panic("cannot store marked value directly in a set (make the set itself unknown instead)") + } if !v.Type().Equals(s.ElementType()) { panic(fmt.Errorf("attempt to use %#v value with set of %#v", v.Type(), s.ElementType())) } diff --git a/vendor/github.com/zclconf/go-cty/cty/set_internals.go b/vendor/github.com/zclconf/go-cty/cty/set_internals.go index 3fd4fb2df..e7e1d3337 100644 --- a/vendor/github.com/zclconf/go-cty/cty/set_internals.go +++ b/vendor/github.com/zclconf/go-cty/cty/set_internals.go @@ -32,7 +32,10 @@ var _ set.OrderedRules = setRules{} // This function is not safe to use for security-related applications, since // the hash used is not strong enough. func (val Value) Hash() int { - hashBytes := makeSetHashBytes(val) + hashBytes, marks := makeSetHashBytes(val) + if len(marks) > 0 { + panic("can't take hash of value that has marks or has embedded values that have marks") + } return int(crc32.ChecksumIEEE(hashBytes)) } @@ -110,19 +113,20 @@ func (r setRules) Less(v1, v2 interface{}) bool { // default consistent-but-undefined ordering then. This situation is // not considered a compatibility constraint; callers should rely only // on the ordering rules for primitive values. - v1h := makeSetHashBytes(v1v) - v2h := makeSetHashBytes(v2v) + v1h, _ := makeSetHashBytes(v1v) + v2h, _ := makeSetHashBytes(v2v) return bytes.Compare(v1h, v2h) < 0 } } -func makeSetHashBytes(val Value) []byte { +func makeSetHashBytes(val Value) ([]byte, ValueMarks) { var buf bytes.Buffer - appendSetHashBytes(val, &buf) - return buf.Bytes() + marks := make(ValueMarks) + appendSetHashBytes(val, &buf, marks) + return buf.Bytes(), marks } -func appendSetHashBytes(val Value, buf *bytes.Buffer) { +func appendSetHashBytes(val Value, buf *bytes.Buffer, marks ValueMarks) { // Exactly what bytes we generate here don't matter as long as the following // constraints hold: // - Unknown and null values all generate distinct strings from @@ -136,6 +140,19 @@ func appendSetHashBytes(val Value, buf *bytes.Buffer) { // the Equivalent function will still distinguish values, but set // performance will be best if we are able to produce a distinct string // for each distinct value, unknown values notwithstanding. + + // Marks aren't considered part of a value for equality-testing purposes, + // so we'll unmark our value before we work with it but we'll remember + // the marks in case the caller needs to re-apply them to a derived + // value. + if val.IsMarked() { + unmarkedVal, valMarks := val.Unmark() + for m := range valMarks { + marks[m] = struct{}{} + } + val = unmarkedVal + } + if !val.IsKnown() { buf.WriteRune('?') return @@ -147,6 +164,17 @@ func appendSetHashBytes(val Value, buf *bytes.Buffer) { switch val.ty { case Number: + // Due to an unfortunate quirk of gob encoding for big.Float, we end up + // with non-pointer values immediately after a gob round-trip, and + // we end up in here before we've had a chance to run + // gobDecodeFixNumberPtr on the inner values of a gob-encoded set, + // and so sadly we must make a special effort to handle that situation + // here just so that we can get far enough along to fix it up for + // everything else in this package. + if bf, ok := val.v.(big.Float); ok { + buf.WriteString(bf.String()) + return + } buf.WriteString(val.v.(*big.Float).String()) return case Bool: @@ -164,9 +192,9 @@ func appendSetHashBytes(val Value, buf *bytes.Buffer) { if val.ty.IsMapType() { buf.WriteRune('{') val.ForEachElement(func(keyVal, elementVal Value) bool { - appendSetHashBytes(keyVal, buf) + appendSetHashBytes(keyVal, buf, marks) buf.WriteRune(':') - appendSetHashBytes(elementVal, buf) + appendSetHashBytes(elementVal, buf, marks) buf.WriteRune(';') return false }) @@ -177,7 +205,7 @@ func appendSetHashBytes(val Value, buf *bytes.Buffer) { if val.ty.IsListType() || val.ty.IsSetType() { buf.WriteRune('[') val.ForEachElement(func(keyVal, elementVal Value) bool { - appendSetHashBytes(elementVal, buf) + appendSetHashBytes(elementVal, buf, marks) buf.WriteRune(';') return false }) @@ -193,7 +221,7 @@ func appendSetHashBytes(val Value, buf *bytes.Buffer) { } sort.Strings(attrNames) for _, attrName := range attrNames { - appendSetHashBytes(val.GetAttr(attrName), buf) + appendSetHashBytes(val.GetAttr(attrName), buf, marks) buf.WriteRune(';') } buf.WriteRune('>') @@ -203,7 +231,7 @@ func appendSetHashBytes(val Value, buf *bytes.Buffer) { if val.ty.IsTupleType() { buf.WriteRune('<') val.ForEachElement(func(keyVal, elementVal Value) bool { - appendSetHashBytes(elementVal, buf) + appendSetHashBytes(elementVal, buf, marks) buf.WriteRune(';') return false }) diff --git a/vendor/github.com/zclconf/go-cty/cty/value.go b/vendor/github.com/zclconf/go-cty/cty/value.go index 80cb8f76f..1025ba82e 100644 --- a/vendor/github.com/zclconf/go-cty/cty/value.go +++ b/vendor/github.com/zclconf/go-cty/cty/value.go @@ -45,6 +45,9 @@ func (val Value) Type() Type { // operating on other unknown values, and so an application that never // introduces Unknown values can be guaranteed to never receive any either. func (val Value) IsKnown() bool { + if val.IsMarked() { + return val.unmarkForce().IsKnown() + } return val.v != unknown } @@ -53,6 +56,9 @@ func (val Value) IsKnown() bool { // produces null, so an application that never introduces Null values can // be guaranteed to never receive any either. func (val Value) IsNull() bool { + if val.IsMarked() { + return val.unmarkForce().IsNull() + } return val.v == nil } @@ -74,6 +80,10 @@ var NilVal = Value{ // inside collections and structures to see if there are any nested unknown // values. func (val Value) IsWhollyKnown() bool { + if val.IsMarked() { + return val.unmarkForce().IsWhollyKnown() + } + if !val.IsKnown() { return false } diff --git a/vendor/github.com/zclconf/go-cty/cty/value_init.go b/vendor/github.com/zclconf/go-cty/cty/value_init.go index 3deeba3bd..2dafe17ae 100644 --- a/vendor/github.com/zclconf/go-cty/cty/value_init.go +++ b/vendor/github.com/zclconf/go-cty/cty/value_init.go @@ -240,8 +240,18 @@ func SetVal(vals []Value) Value { } elementType := DynamicPseudoType rawList := make([]interface{}, len(vals)) + var markSets []ValueMarks for i, val := range vals { + if unmarkedVal, marks := val.UnmarkDeep(); len(marks) > 0 { + val = unmarkedVal + markSets = append(markSets, marks) + } + if val.ContainsMarked() { + // FIXME: Allow this, but unmark the values and apply the + // marking to the set itself instead. + panic("set cannot contain marked values") + } if elementType == DynamicPseudoType { elementType = val.ty } else if val.ty != DynamicPseudoType && !elementType.Equals(val.ty) { @@ -259,7 +269,7 @@ func SetVal(vals []Value) Value { return Value{ ty: Set(elementType), v: rawVal, - } + }.WithMarks(markSets...) } // SetValFromValueSet returns a Value of set type based on an already-constructed diff --git a/vendor/github.com/zclconf/go-cty/cty/value_ops.go b/vendor/github.com/zclconf/go-cty/cty/value_ops.go index afd621cf4..35a644be4 100644 --- a/vendor/github.com/zclconf/go-cty/cty/value_ops.go +++ b/vendor/github.com/zclconf/go-cty/cty/value_ops.go @@ -11,6 +11,18 @@ import ( // GoString is an implementation of fmt.GoStringer that produces concise // source-like representations of values suitable for use in debug messages. func (val Value) GoString() string { + if val.IsMarked() { + unVal, marks := val.Unmark() + if len(marks) == 1 { + var mark interface{} + for m := range marks { + mark = m + } + return fmt.Sprintf("%#v.Mark(%#v)", unVal, mark) + } + return fmt.Sprintf("%#v.WithMarks(%#v)", unVal, marks) + } + if val == NilVal { return "cty.NilVal" } @@ -82,7 +94,11 @@ func (val Value) GoString() string { vals := val.AsValueMap() return fmt.Sprintf("cty.ObjectVal(%#v)", vals) case val.ty.IsCapsuleType(): - return fmt.Sprintf("cty.CapsuleVal(%#v, %#v)", val.ty, val.v) + impl := val.ty.CapsuleOps().GoString + if impl == nil { + return fmt.Sprintf("cty.CapsuleVal(%#v, %#v)", val.ty, val.v) + } + return impl(val.EncapsulatedValue()) } // Default exposes implementation details, so should actually cover @@ -101,6 +117,12 @@ func (val Value) GoString() string { // Use RawEquals to compare if two values are equal *ignoring* the // short-circuit rules and the exception for null values. func (val Value) Equals(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.Equals(other).WithMarks(valMarks, otherMarks) + } + // Start by handling Unknown values before considering types. // This needs to be done since Null values are always equal regardless of // type. @@ -288,10 +310,22 @@ func (val Value) Equals(other Value) Value { } } case ty.IsCapsuleType(): - // A capsule type's encapsulated value is a pointer to a value of its - // native type, so we can just compare these to get the identity test - // we need. - return BoolVal(val.v == other.v) + impl := val.ty.CapsuleOps().Equals + if impl == nil { + impl := val.ty.CapsuleOps().RawEquals + if impl == nil { + // A capsule type's encapsulated value is a pointer to a value of its + // native type, so we can just compare these to get the identity test + // we need. + return BoolVal(val.v == other.v) + } + return BoolVal(impl(val.v, other.v)) + } + ret := impl(val.v, other.v) + if !ret.Type().Equals(Bool) { + panic(fmt.Sprintf("Equals for %#v returned %#v, not cty.Bool", ty, ret.Type())) + } + return ret default: // should never happen @@ -314,6 +348,7 @@ func (val Value) NotEqual(other Value) Value { // or null values. For more robust handling with unknown value // short-circuiting, use val.Equals(cty.True). func (val Value) True() bool { + val.assertUnmarked() if val.ty != Bool { panic("not bool") } @@ -338,6 +373,13 @@ func (val Value) RawEquals(other Value) bool { if !val.ty.Equals(other.ty) { return false } + if !val.HasSameMarks(other) { + return false + } + // Since we've now checked the marks, we'll unmark for the rest of this... + val = val.unmarkForce() + other = other.unmarkForce() + if (!val.IsKnown()) && (!other.IsKnown()) { return true } @@ -448,10 +490,14 @@ func (val Value) RawEquals(other Value) bool { } return false case ty.IsCapsuleType(): - // A capsule type's encapsulated value is a pointer to a value of its - // native type, so we can just compare these to get the identity test - // we need. - return val.v == other.v + impl := val.ty.CapsuleOps().RawEquals + if impl == nil { + // A capsule type's encapsulated value is a pointer to a value of its + // native type, so we can just compare these to get the identity test + // we need. + return val.v == other.v + } + return impl(val.v, other.v) default: // should never happen @@ -462,6 +508,12 @@ func (val Value) RawEquals(other Value) bool { // Add returns the sum of the receiver and the given other value. Both values // must be numbers; this method will panic if not. func (val Value) Add(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.Add(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Number, Number, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Number) return *shortCircuit @@ -475,6 +527,12 @@ func (val Value) Add(other Value) Value { // Subtract returns receiver minus the given other value. Both values must be // numbers; this method will panic if not. func (val Value) Subtract(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.Subtract(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Number, Number, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Number) return *shortCircuit @@ -486,6 +544,11 @@ func (val Value) Subtract(other Value) Value { // Negate returns the numeric negative of the receiver, which must be a number. // This method will panic when given a value of any other type. func (val Value) Negate() Value { + if val.IsMarked() { + val, valMarks := val.Unmark() + return val.Negate().WithMarks(valMarks) + } + if shortCircuit := mustTypeCheck(Number, Number, val); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Number) return *shortCircuit @@ -498,6 +561,12 @@ func (val Value) Negate() Value { // Multiply returns the product of the receiver and the given other value. // Both values must be numbers; this method will panic if not. func (val Value) Multiply(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.Multiply(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Number, Number, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Number) return *shortCircuit @@ -520,6 +589,12 @@ func (val Value) Multiply(other Value) Value { // If both values are zero or infinity, this function will panic with // an instance of big.ErrNaN. func (val Value) Divide(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.Divide(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Number, Number, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Number) return *shortCircuit @@ -546,6 +621,12 @@ func (val Value) Divide(other Value) Value { // may wish to disallow such things outright or implement their own modulo // if they disagree with the interpretation used here. func (val Value) Modulo(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.Modulo(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Number, Number, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Number) return *shortCircuit @@ -576,6 +657,11 @@ func (val Value) Modulo(other Value) Value { // Absolute returns the absolute (signless) value of the receiver, which must // be a number or this method will panic. func (val Value) Absolute() Value { + if val.IsMarked() { + val, valMarks := val.Unmark() + return val.Absolute().WithMarks(valMarks) + } + if shortCircuit := mustTypeCheck(Number, Number, val); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Number) return *shortCircuit @@ -596,6 +682,11 @@ func (val Value) Absolute() Value { // This method may be called on a value whose type is DynamicPseudoType, // in which case the result will also be DynamicVal. func (val Value) GetAttr(name string) Value { + if val.IsMarked() { + val, valMarks := val.Unmark() + return val.GetAttr(name).WithMarks(valMarks) + } + if val.ty == DynamicPseudoType { return DynamicVal } @@ -638,6 +729,12 @@ func (val Value) GetAttr(name string) Value { // This method may be called on a value whose type is DynamicPseudoType, // in which case the result will also be the DynamicValue. func (val Value) Index(key Value) Value { + if val.IsMarked() || key.IsMarked() { + val, valMarks := val.Unmark() + key, keyMarks := key.Unmark() + return val.Index(key).WithMarks(valMarks, keyMarks) + } + if val.ty == DynamicPseudoType { return DynamicVal } @@ -733,6 +830,12 @@ func (val Value) Index(key Value) Value { // This method will panic if the receiver is not indexable, but does not // impose any panic-causing type constraints on the key. func (val Value) HasIndex(key Value) Value { + if val.IsMarked() || key.IsMarked() { + val, valMarks := val.Unmark() + key, keyMarks := key.Unmark() + return val.HasIndex(key).WithMarks(valMarks, keyMarks) + } + if val.ty == DynamicPseudoType { return UnknownVal(Bool) } @@ -810,6 +913,12 @@ func (val Value) HasIndex(key Value) Value { // // This method will panic if the receiver is not a set, or if it is a null set. func (val Value) HasElement(elem Value) Value { + if val.IsMarked() || elem.IsMarked() { + val, valMarks := val.Unmark() + elem, elemMarks := elem.Unmark() + return val.HasElement(elem).WithMarks(valMarks, elemMarks) + } + ty := val.Type() if !ty.IsSetType() { @@ -841,6 +950,11 @@ func (val Value) HasElement(elem Value) Value { // of a string, call AsString and take the length of the native Go string // that is returned. func (val Value) Length() Value { + if val.IsMarked() { + val, valMarks := val.Unmark() + return val.Length().WithMarks(valMarks) + } + if val.Type().IsTupleType() { // For tuples, we can return the length even if the value is not known. return NumberIntVal(int64(val.Type().Length())) @@ -859,6 +973,7 @@ func (val Value) Length() Value { // This is an integration method provided for the convenience of code bridging // into Go's type system. func (val Value) LengthInt() int { + val.assertUnmarked() if val.Type().IsTupleType() { // For tuples, we can return the length even if the value is not known. return val.Type().Length() @@ -915,6 +1030,7 @@ func (val Value) LengthInt() int { // ElementIterator is an integration method, so it cannot handle Unknown // values. This method will panic if the receiver is Unknown. func (val Value) ElementIterator() ElementIterator { + val.assertUnmarked() if !val.IsKnown() { panic("can't use ElementIterator on unknown value") } @@ -943,6 +1059,7 @@ func (val Value) CanIterateElements() bool { // ForEachElement is an integration method, so it cannot handle Unknown // values. This method will panic if the receiver is Unknown. func (val Value) ForEachElement(cb ElementCallback) bool { + val.assertUnmarked() it := val.ElementIterator() for it.Next() { key, val := it.Element() @@ -957,6 +1074,11 @@ func (val Value) ForEachElement(cb ElementCallback) bool { // Not returns the logical inverse of the receiver, which must be of type // Bool or this method will panic. func (val Value) Not() Value { + if val.IsMarked() { + val, valMarks := val.Unmark() + return val.Not().WithMarks(valMarks) + } + if shortCircuit := mustTypeCheck(Bool, Bool, val); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Bool) return *shortCircuit @@ -968,6 +1090,12 @@ func (val Value) Not() Value { // And returns the result of logical AND with the receiver and the other given // value, which must both be of type Bool or this method will panic. func (val Value) And(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.And(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Bool, Bool, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Bool) return *shortCircuit @@ -979,6 +1107,12 @@ func (val Value) And(other Value) Value { // Or returns the result of logical OR with the receiver and the other given // value, which must both be of type Bool or this method will panic. func (val Value) Or(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.Or(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Bool, Bool, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Bool) return *shortCircuit @@ -990,6 +1124,12 @@ func (val Value) Or(other Value) Value { // LessThan returns True if the receiver is less than the other given value, // which must both be numbers or this method will panic. func (val Value) LessThan(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.LessThan(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Number, Bool, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Bool) return *shortCircuit @@ -1001,6 +1141,12 @@ func (val Value) LessThan(other Value) Value { // GreaterThan returns True if the receiver is greater than the other given // value, which must both be numbers or this method will panic. func (val Value) GreaterThan(other Value) Value { + if val.IsMarked() || other.IsMarked() { + val, valMarks := val.Unmark() + other, otherMarks := other.Unmark() + return val.GreaterThan(other).WithMarks(valMarks, otherMarks) + } + if shortCircuit := mustTypeCheck(Number, Bool, val, other); shortCircuit != nil { shortCircuit = forceShortCircuitType(shortCircuit, Bool) return *shortCircuit @@ -1022,6 +1168,7 @@ func (val Value) GreaterThanOrEqualTo(other Value) Value { // AsString returns the native string from a non-null, non-unknown cty.String // value, or panics if called on any other value. func (val Value) AsString() string { + val.assertUnmarked() if val.ty != String { panic("not a string") } @@ -1041,6 +1188,7 @@ func (val Value) AsString() string { // For more convenient conversions to other native numeric types, use the // "gocty" package. func (val Value) AsBigFloat() *big.Float { + val.assertUnmarked() if val.ty != Number { panic("not a number") } @@ -1064,6 +1212,7 @@ func (val Value) AsBigFloat() *big.Float { // For more convenient conversions to slices of more specific types, use // the "gocty" package. func (val Value) AsValueSlice() []Value { + val.assertUnmarked() l := val.LengthInt() if l == 0 { return nil @@ -1084,6 +1233,7 @@ func (val Value) AsValueSlice() []Value { // For more convenient conversions to maps of more specific types, use // the "gocty" package. func (val Value) AsValueMap() map[string]Value { + val.assertUnmarked() l := val.LengthInt() if l == 0 { return nil @@ -1108,6 +1258,7 @@ func (val Value) AsValueMap() map[string]Value { // // The returned ValueSet can store only values of the receiver's element type. func (val Value) AsValueSet() ValueSet { + val.assertUnmarked() if !val.Type().IsCollectionType() { panic("not a collection type") } @@ -1130,6 +1281,7 @@ func (val Value) AsValueSet() ValueSet { // the value. Since cty considers values to be immutable, it is strongly // recommended to treat the encapsulated value itself as immutable too. func (val Value) EncapsulatedValue() interface{} { + val.assertUnmarked() if !val.Type().IsCapsuleType() { panic("not a capsule-typed value") } diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go index bf2f703ff..4f3526e1d 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go @@ -35,7 +35,9 @@ func init() { proto.RegisterExtension(E_Http) } -func init() { proto.RegisterFile("google/api/annotations.proto", fileDescriptor_c591c5aa9fb79aab) } +func init() { + proto.RegisterFile("google/api/annotations.proto", fileDescriptor_c591c5aa9fb79aab) +} var fileDescriptor_c591c5aa9fb79aab = []byte{ // 208 bytes of a gzipped FileDescriptorProto diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go index 867fc0c3f..9757593e9 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go @@ -55,7 +55,9 @@ func init() { proto.RegisterExtension(E_OauthScopes) } -func init() { proto.RegisterFile("google/api/client.proto", fileDescriptor_78f2c6f7c3a942c1) } +func init() { + proto.RegisterFile("google/api/client.proto", fileDescriptor_78f2c6f7c3a942c1) +} var fileDescriptor_78f2c6f7c3a942c1 = []byte{ // 262 bytes of a gzipped FileDescriptorProto diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go index 31f87dd00..6e67a93fe 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go @@ -96,7 +96,9 @@ func init() { proto.RegisterExtension(E_FieldBehavior) } -func init() { proto.RegisterFile("google/api/field_behavior.proto", fileDescriptor_4648f18fd5079967) } +func init() { + proto.RegisterFile("google/api/field_behavior.proto", fileDescriptor_4648f18fd5079967) +} var fileDescriptor_4648f18fd5079967 = []byte{ // 303 bytes of a gzipped FileDescriptorProto diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go index a63870374..6ed6f3c91 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go @@ -599,7 +599,9 @@ func init() { proto.RegisterType((*CustomHttpPattern)(nil), "google.api.CustomHttpPattern") } -func init() { proto.RegisterFile("google/api/http.proto", fileDescriptor_ff9994be407cdcc9) } +func init() { + proto.RegisterFile("google/api/http.proto", fileDescriptor_ff9994be407cdcc9) +} var fileDescriptor_ff9994be407cdcc9 = []byte{ // 419 bytes of a gzipped FileDescriptorProto diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go index af057b90b..d1d8eb54a 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go @@ -66,30 +66,106 @@ func (ResourceDescriptor_History) EnumDescriptor() ([]byte, []int) { // // Example: // -// message Topic { -// // Indicates this message defines a resource schema. -// // Declares the resource type in the format of {service}/{kind}. -// // For Kubernetes resources, the format is {api group}/{kind}. -// option (google.api.resource) = { -// type: "pubsub.googleapis.com/Topic" -// pattern: "projects/{project}/topics/{topic}" -// }; -// } +// message Topic { +// // Indicates this message defines a resource schema. +// // Declares the resource type in the format of {service}/{kind}. +// // For Kubernetes resources, the format is {api group}/{kind}. +// option (google.api.resource) = { +// type: "pubsub.googleapis.com/Topic" +// name_descriptor: { +// pattern: "projects/{project}/topics/{topic}" +// parent_type: "cloudresourcemanager.googleapis.com/Project" +// parent_name_extractor: "projects/{project}" +// } +// }; +// } +// +// The ResourceDescriptor Yaml config will look like: +// +// resources: +// - type: "pubsub.googleapis.com/Topic" +// name_descriptor: +// - pattern: "projects/{project}/topics/{topic}" +// parent_type: "cloudresourcemanager.googleapis.com/Project" +// parent_name_extractor: "projects/{project}" // // Sometimes, resources have multiple patterns, typically because they can // live under multiple parents. // // Example: // -// message LogEntry { -// option (google.api.resource) = { -// type: "logging.googleapis.com/LogEntry" -// pattern: "projects/{project}/logs/{log}" -// pattern: "organizations/{organization}/logs/{log}" -// pattern: "folders/{folder}/logs/{log}" -// pattern: "billingAccounts/{billing_account}/logs/{log}" -// }; -// } +// message LogEntry { +// option (google.api.resource) = { +// type: "logging.googleapis.com/LogEntry" +// name_descriptor: { +// pattern: "projects/{project}/logs/{log}" +// parent_type: "cloudresourcemanager.googleapis.com/Project" +// parent_name_extractor: "projects/{project}" +// } +// name_descriptor: { +// pattern: "folders/{folder}/logs/{log}" +// parent_type: "cloudresourcemanager.googleapis.com/Folder" +// parent_name_extractor: "folders/{folder}" +// } +// name_descriptor: { +// pattern: "organizations/{organization}/logs/{log}" +// parent_type: "cloudresourcemanager.googleapis.com/Organization" +// parent_name_extractor: "organizations/{organization}" +// } +// name_descriptor: { +// pattern: "billingAccounts/{billing_account}/logs/{log}" +// parent_type: "billing.googleapis.com/BillingAccount" +// parent_name_extractor: "billingAccounts/{billing_account}" +// } +// }; +// } +// +// The ResourceDescriptor Yaml config will look like: +// +// resources: +// - type: 'logging.googleapis.com/LogEntry' +// name_descriptor: +// - pattern: "projects/{project}/logs/{log}" +// parent_type: "cloudresourcemanager.googleapis.com/Project" +// parent_name_extractor: "projects/{project}" +// - pattern: "folders/{folder}/logs/{log}" +// parent_type: "cloudresourcemanager.googleapis.com/Folder" +// parent_name_extractor: "folders/{folder}" +// - pattern: "organizations/{organization}/logs/{log}" +// parent_type: "cloudresourcemanager.googleapis.com/Organization" +// parent_name_extractor: "organizations/{organization}" +// - pattern: "billingAccounts/{billing_account}/logs/{log}" +// parent_type: "billing.googleapis.com/BillingAccount" +// parent_name_extractor: "billingAccounts/{billing_account}" +// +// For flexible resources, the resource name doesn't contain parent names, but +// the resource itself has parents for policy evaluation. +// +// Example: +// +// message Shelf { +// option (google.api.resource) = { +// type: "library.googleapis.com/Shelf" +// name_descriptor: { +// pattern: "shelves/{shelf}" +// parent_type: "cloudresourcemanager.googleapis.com/Project" +// } +// name_descriptor: { +// pattern: "shelves/{shelf}" +// parent_type: "cloudresourcemanager.googleapis.com/Folder" +// } +// }; +// } +// +// The ResourceDescriptor Yaml config will look like: +// +// resources: +// - type: 'library.googleapis.com/Shelf' +// name_descriptor: +// - pattern: "shelves/{shelf}" +// parent_type: "cloudresourcemanager.googleapis.com/Project" +// - pattern: "shelves/{shelf}" +// parent_type: "cloudresourcemanager.googleapis.com/Folder" type ResourceDescriptor struct { // The resource type. It must be in the format of // {service_name}/{resource_type_kind}. The `resource_type_kind` must be @@ -102,11 +178,20 @@ type ResourceDescriptor struct { // should use PascalCase (UpperCamelCase). The maximum number of // characters allowed for the `resource_type_kind` is 100. Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Optional. The valid resource name pattern(s) for this resource type. + // Optional. The relative resource name pattern associated with this resource + // type. The DNS prefix of the full resource name shouldn't be specified here. + // + // The path pattern must follow the syntax, which aligns with HTTP binding + // syntax: + // + // Template = Segment { "/" Segment } ; + // Segment = LITERAL | Variable ; + // Variable = "{" LITERAL "}" ; // // Examples: - // - "projects/{project}/topics/{topic}" - // - "projects/{project}/knowledgeBases/{knowledge_base}" + // + // - "projects/{project}/topics/{topic}" + // - "projects/{project}/knowledgeBases/{knowledge_base}" // // The components in braces correspond to the IDs for each resource in the // hierarchy. It is expected that, if multiple patterns are provided, @@ -119,21 +204,31 @@ type ResourceDescriptor struct { // Optional. The historical or future-looking state of the resource pattern. // // Example: - // // The InspectTemplate message originally only supported resource - // // names with organization, and project was added later. - // message InspectTemplate { - // option (google.api.resource) = { - // type: "dlp.googleapis.com/InspectTemplate" - // pattern: - // "organizations/{organization}/inspectTemplates/{inspect_template}" - // pattern: "projects/{project}/inspectTemplates/{inspect_template}" - // history: ORIGINALLY_SINGLE_PATTERN - // }; - // } - History ResourceDescriptor_History `protobuf:"varint,4,opt,name=history,proto3,enum=google.api.ResourceDescriptor_History" json:"history,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // + // // The InspectTemplate message originally only supported resource + // // names with organization, and project was added later. + // message InspectTemplate { + // option (google.api.resource) = { + // type: "dlp.googleapis.com/InspectTemplate" + // pattern: + // "organizations/{organization}/inspectTemplates/{inspect_template}" + // pattern: "projects/{project}/inspectTemplates/{inspect_template}" + // history: ORIGINALLY_SINGLE_PATTERN + // }; + // } + History ResourceDescriptor_History `protobuf:"varint,4,opt,name=history,proto3,enum=google.api.ResourceDescriptor_History" json:"history,omitempty"` + // The plural name used in the resource name, such as 'projects' for + // the name of 'projects/{project}'. It is the same concept of the `plural` + // field in k8s CRD spec + // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + Plural string `protobuf:"bytes,5,opt,name=plural,proto3" json:"plural,omitempty"` + // The same concept of the `singular` field in k8s CRD spec + // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + // Such as "project" for the `resourcemanager.googleapis.com/Project` type. + Singular string `protobuf:"bytes,6,opt,name=singular,proto3" json:"singular,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ResourceDescriptor) Reset() { *m = ResourceDescriptor{} } @@ -189,21 +284,36 @@ func (m *ResourceDescriptor) GetHistory() ResourceDescriptor_History { return ResourceDescriptor_HISTORY_UNSPECIFIED } -// Defines a proto annotation that describes a field that refers to a resource. +func (m *ResourceDescriptor) GetPlural() string { + if m != nil { + return m.Plural + } + return "" +} + +func (m *ResourceDescriptor) GetSingular() string { + if m != nil { + return m.Singular + } + return "" +} + +// Defines a proto annotation that describes a string field that refers to +// an API resource. type ResourceReference struct { // The resource type that the annotated field references. // // Example: // - // message Subscription { - // string topic = 2 [(google.api.resource_reference) = { - // type = "pubsub.googleapis.com/Topic" - // }]; - // } + // message Subscription { + // string topic = 2 [(google.api.resource_reference) = { + // type: "pubsub.googleapis.com/Topic" + // }]; + // } Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // The resource type of a child collection that the annotated field - // references. This is useful for `parent` fields where a resource has more - // than one possible type of parent. + // references. This is useful for annotating the `parent` field that + // doesn't have a fixed resource type. // // Example: // @@ -266,6 +376,15 @@ var E_ResourceReference = &proto.ExtensionDesc{ Filename: "google/api/resource.proto", } +var E_ResourceDefinition = &proto.ExtensionDesc{ + ExtendedType: (*descriptor.FileOptions)(nil), + ExtensionType: ([]*ResourceDescriptor)(nil), + Field: 1053, + Name: "google.api.resource_definition", + Tag: "bytes,1053,rep,name=resource_definition", + Filename: "google/api/resource.proto", +} + var E_Resource = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*ResourceDescriptor)(nil), @@ -280,38 +399,45 @@ func init() { proto.RegisterType((*ResourceDescriptor)(nil), "google.api.ResourceDescriptor") proto.RegisterType((*ResourceReference)(nil), "google.api.ResourceReference") proto.RegisterExtension(E_ResourceReference) + proto.RegisterExtension(E_ResourceDefinition) proto.RegisterExtension(E_Resource) } -func init() { proto.RegisterFile("google/api/resource.proto", fileDescriptor_465e9122405d1bb5) } +func init() { + proto.RegisterFile("google/api/resource.proto", fileDescriptor_465e9122405d1bb5) +} var fileDescriptor_465e9122405d1bb5 = []byte{ - // 430 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x41, 0x6f, 0xd3, 0x30, - 0x18, 0x25, 0x59, 0x45, 0xd7, 0x0f, 0x31, 0x6d, 0x06, 0x89, 0x0c, 0x29, 0x10, 0xf5, 0x80, 0x7a, - 0x4a, 0xa4, 0x71, 0x1b, 0x17, 0x3a, 0x96, 0x76, 0x91, 0xba, 0x36, 0x72, 0xd3, 0xc3, 0x00, 0x29, - 0xf2, 0xd2, 0xaf, 0x59, 0xa4, 0xcc, 0xb6, 0x9c, 0xec, 0xd0, 0x1b, 0x7f, 0x04, 0x21, 0xf1, 0x2b, - 0x39, 0xa2, 0x3a, 0x71, 0x98, 0xd8, 0xb4, 0x9b, 0xf3, 0xde, 0xfb, 0xbe, 0xf7, 0xfc, 0x1c, 0x38, - 0xce, 0x85, 0xc8, 0x4b, 0x0c, 0x98, 0x2c, 0x02, 0x85, 0x95, 0xb8, 0x53, 0x19, 0xfa, 0x52, 0x89, - 0x5a, 0x10, 0x68, 0x28, 0x9f, 0xc9, 0xe2, 0xad, 0xd7, 0xca, 0x34, 0x73, 0x7d, 0xb7, 0x09, 0xd6, - 0x58, 0x65, 0xaa, 0x90, 0xb5, 0x50, 0x8d, 0x7a, 0xf8, 0xc3, 0x06, 0x42, 0xdb, 0x05, 0xe7, 0x1d, - 0x49, 0x08, 0xf4, 0xea, 0xad, 0x44, 0xc7, 0xf2, 0xac, 0xd1, 0x80, 0xea, 0x33, 0x71, 0xa0, 0x2f, - 0x59, 0x5d, 0xa3, 0xe2, 0x8e, 0xed, 0xed, 0x8d, 0x06, 0xd4, 0x7c, 0x12, 0x17, 0x80, 0xb3, 0x5b, - 0x4c, 0x37, 0x05, 0x96, 0x6b, 0x67, 0x4f, 0xcf, 0x0c, 0x76, 0xc8, 0x64, 0x07, 0x90, 0xcf, 0xd0, - 0xbf, 0x29, 0xaa, 0x5a, 0xa8, 0xad, 0xd3, 0xf3, 0xac, 0xd1, 0xc1, 0xc9, 0x07, 0xff, 0x5f, 0x46, - 0xff, 0xa1, 0xbb, 0x7f, 0xd1, 0xa8, 0xa9, 0x19, 0x1b, 0x7e, 0x83, 0x7e, 0x8b, 0x91, 0x37, 0xf0, - 0xea, 0x22, 0x5a, 0x26, 0x0b, 0x7a, 0x95, 0xae, 0xe6, 0xcb, 0x38, 0xfc, 0x12, 0x4d, 0xa2, 0xf0, - 0xfc, 0xf0, 0x19, 0x71, 0xe1, 0x78, 0x41, 0xa3, 0x69, 0x34, 0x1f, 0xcf, 0x66, 0x57, 0xe9, 0x32, - 0x9a, 0x4f, 0x67, 0x61, 0x1a, 0x8f, 0x93, 0x24, 0xa4, 0xf3, 0x43, 0x8b, 0x38, 0xf0, 0x7a, 0xb2, - 0x4a, 0x56, 0x34, 0x4c, 0x2f, 0x57, 0xb3, 0x24, 0xea, 0x18, 0x7b, 0x38, 0x81, 0x23, 0x93, 0x81, - 0xe2, 0x06, 0x15, 0xf2, 0x0c, 0x1f, 0x2d, 0xc0, 0x05, 0xc8, 0x6e, 0x8a, 0x72, 0x9d, 0x6a, 0xc6, - 0x6e, 0xae, 0xa9, 0x91, 0x64, 0x2b, 0xf1, 0xb4, 0x04, 0x62, 0x9e, 0x22, 0x55, 0xdd, 0x22, 0xd7, - 0xdc, 0xd5, 0xbc, 0x81, 0xaf, 0x4b, 0x59, 0xc8, 0xba, 0x10, 0xbc, 0x72, 0x7e, 0xed, 0x7b, 0xd6, - 0xe8, 0xc5, 0x89, 0xfb, 0x58, 0x23, 0x5d, 0x1a, 0x7a, 0xa4, 0xfe, 0x87, 0x4e, 0xbf, 0xc3, 0xbe, - 0x01, 0xc9, 0xfb, 0x07, 0x1e, 0x97, 0x58, 0x55, 0x2c, 0x47, 0xe3, 0xf2, 0xb3, 0x71, 0x79, 0xf7, - 0x74, 0xef, 0xb4, 0xdb, 0x78, 0xc6, 0xe1, 0x20, 0x13, 0xb7, 0xf7, 0xe4, 0x67, 0x2f, 0x8d, 0x3e, - 0xde, 0x79, 0xc4, 0xd6, 0xd7, 0x71, 0x4b, 0xe6, 0xa2, 0x64, 0x3c, 0xf7, 0x85, 0xca, 0x83, 0x1c, - 0xb9, 0x4e, 0x10, 0x34, 0x14, 0x93, 0x45, 0xa5, 0xff, 0x50, 0xc6, 0xb9, 0xa8, 0x99, 0x8e, 0xf2, - 0xe9, 0xde, 0xf9, 0x8f, 0x65, 0xfd, 0xb6, 0x7b, 0xd3, 0x71, 0x1c, 0x5d, 0x3f, 0xd7, 0x73, 0x1f, - 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x1e, 0x07, 0x80, 0xd8, 0x02, 0x00, 0x00, + // 490 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xfd, 0x9c, 0xe4, 0xcb, 0xcf, 0xad, 0xa8, 0xda, 0x29, 0x02, 0xb7, 0x22, 0x60, 0x65, 0x81, + 0xb2, 0xb2, 0xa5, 0xb0, 0x0b, 0x1b, 0x52, 0xe2, 0xa4, 0x96, 0xd2, 0xc4, 0x9a, 0x38, 0x8b, 0x02, + 0x92, 0x35, 0x75, 0x26, 0xee, 0x48, 0xee, 0xcc, 0x68, 0xec, 0x2c, 0xf2, 0x30, 0x08, 0x89, 0x67, + 0xe0, 0xe1, 0x58, 0xa2, 0x8c, 0x7f, 0x88, 0x68, 0x84, 0xd8, 0xcd, 0xbd, 0xe7, 0xde, 0x73, 0x8e, + 0xcf, 0x95, 0xe1, 0x32, 0x16, 0x22, 0x4e, 0xa8, 0x43, 0x24, 0x73, 0x14, 0x4d, 0xc5, 0x56, 0x45, + 0xd4, 0x96, 0x4a, 0x64, 0x02, 0x41, 0x0e, 0xd9, 0x44, 0xb2, 0x2b, 0xab, 0x18, 0xd3, 0xc8, 0xfd, + 0x76, 0xe3, 0xac, 0x69, 0x1a, 0x29, 0x26, 0x33, 0xa1, 0xf2, 0xe9, 0xde, 0x8f, 0x1a, 0x20, 0x5c, + 0x10, 0x8c, 0x2b, 0x10, 0x21, 0x68, 0x64, 0x3b, 0x49, 0x4d, 0xc3, 0x32, 0xfa, 0x1d, 0xac, 0xdf, + 0xc8, 0x84, 0x96, 0x24, 0x59, 0x46, 0x15, 0x37, 0x6b, 0x56, 0xbd, 0xdf, 0xc1, 0x65, 0x89, 0xba, + 0x00, 0x9c, 0x3c, 0xd2, 0x70, 0xc3, 0x68, 0xb2, 0x36, 0xeb, 0x7a, 0xa7, 0xb3, 0xef, 0x4c, 0xf6, + 0x0d, 0xf4, 0x01, 0x5a, 0x0f, 0x2c, 0xcd, 0x84, 0xda, 0x99, 0x0d, 0xcb, 0xe8, 0x9f, 0x0e, 0xde, + 0xda, 0xbf, 0x3d, 0xda, 0x4f, 0xd5, 0xed, 0x9b, 0x7c, 0x1a, 0x97, 0x6b, 0xe8, 0x05, 0x34, 0x65, + 0xb2, 0x55, 0x24, 0x31, 0xff, 0xd7, 0xe4, 0x45, 0x85, 0xae, 0xa0, 0x9d, 0x32, 0x1e, 0x6f, 0x13, + 0xa2, 0xcc, 0xa6, 0x46, 0xaa, 0xba, 0xf7, 0x19, 0x5a, 0x05, 0x0f, 0x7a, 0x09, 0x17, 0x37, 0xde, + 0x32, 0x58, 0xe0, 0xbb, 0x70, 0x35, 0x5f, 0xfa, 0xee, 0x47, 0x6f, 0xe2, 0xb9, 0xe3, 0xb3, 0xff, + 0x50, 0x17, 0x2e, 0x17, 0xd8, 0x9b, 0x7a, 0xf3, 0xd1, 0x6c, 0x76, 0x17, 0x2e, 0xbd, 0xf9, 0x74, + 0xe6, 0x86, 0xfe, 0x28, 0x08, 0x5c, 0x3c, 0x3f, 0x33, 0x90, 0x09, 0xcf, 0x27, 0xab, 0x60, 0x85, + 0xdd, 0xf0, 0x76, 0x35, 0x0b, 0xbc, 0x0a, 0xa9, 0xf5, 0x26, 0x70, 0x5e, 0xfa, 0xc6, 0x74, 0x43, + 0x15, 0xe5, 0x11, 0x3d, 0x1a, 0x5a, 0x17, 0x20, 0x7a, 0x60, 0xc9, 0x3a, 0xd4, 0x48, 0x2d, 0x8f, + 0x46, 0x77, 0x82, 0x9d, 0xa4, 0xc3, 0x04, 0x50, 0x79, 0xbe, 0x50, 0x55, 0x44, 0xdd, 0x32, 0x9f, + 0xf2, 0x6e, 0xb6, 0x0e, 0x72, 0x21, 0x33, 0x26, 0x78, 0x6a, 0x7e, 0x6b, 0x5b, 0x46, 0xff, 0x64, + 0xd0, 0x3d, 0x96, 0x62, 0xe5, 0x06, 0x9f, 0xab, 0x3f, 0x5b, 0x43, 0x0e, 0x17, 0x95, 0xda, 0x9a, + 0x6e, 0x18, 0x67, 0x7b, 0x42, 0xf4, 0xea, 0x88, 0x5c, 0x42, 0x4b, 0xb5, 0xaf, 0x6d, 0xab, 0xde, + 0x3f, 0x19, 0xbc, 0xfe, 0xfb, 0xcd, 0x70, 0xf5, 0x1d, 0xe3, 0x8a, 0x78, 0xf8, 0x05, 0xda, 0x65, + 0x17, 0xbd, 0x79, 0x22, 0x72, 0x4b, 0xd3, 0x94, 0xc4, 0x87, 0x3a, 0xc6, 0x3f, 0xe8, 0x54, 0x8c, + 0xd7, 0x1c, 0x4e, 0x23, 0xf1, 0x78, 0x30, 0x7e, 0xfd, 0xac, 0x9c, 0xf7, 0xf7, 0x1a, 0xbe, 0xf1, + 0x69, 0x54, 0x80, 0xb1, 0x48, 0x08, 0x8f, 0x6d, 0xa1, 0x62, 0x27, 0xa6, 0x5c, 0x3b, 0x70, 0x72, + 0x88, 0x48, 0x96, 0xea, 0xbf, 0x88, 0x70, 0x2e, 0x32, 0xa2, 0xad, 0xbc, 0x3f, 0x78, 0xff, 0x34, + 0x8c, 0xef, 0xb5, 0xc6, 0x74, 0xe4, 0x7b, 0xf7, 0x4d, 0xbd, 0xf7, 0xee, 0x57, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x75, 0x12, 0x53, 0xef, 0x7c, 0x03, 0x00, 0x00, } diff --git a/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go b/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go index 0499510d7..9950ac2d3 100644 --- a/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go @@ -11,6 +11,8 @@ import ( proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" ) // Reference imports to suppress errors if they are not otherwise used. @@ -233,49 +235,54 @@ func init() { proto.RegisterType((*TestIamPermissionsResponse)(nil), "google.iam.v1.TestIamPermissionsResponse") } -func init() { proto.RegisterFile("google/iam/v1/iam_policy.proto", fileDescriptor_d2728eb97d748a32) } +func init() { + proto.RegisterFile("google/iam/v1/iam_policy.proto", fileDescriptor_d2728eb97d748a32) +} var fileDescriptor_d2728eb97d748a32 = []byte{ - // 465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0x8a, 0x13, 0x31, - 0x1c, 0x27, 0x5d, 0x58, 0x6d, 0x56, 0x05, 0xa7, 0x88, 0x35, 0x2b, 0xb5, 0x44, 0x0f, 0x6d, 0xa1, - 0x19, 0xbb, 0x9e, 0xac, 0x28, 0xec, 0x7a, 0x18, 0xe6, 0x20, 0x96, 0x51, 0x16, 0x94, 0x82, 0xc6, - 0x31, 0x0c, 0x81, 0xc9, 0x24, 0x4e, 0xd2, 0x05, 0x11, 0x2f, 0x1e, 0x7c, 0x01, 0x6f, 0x3e, 0x82, - 0x67, 0x9f, 0x62, 0xaf, 0xbe, 0x82, 0x0f, 0xe1, 0x51, 0x66, 0x92, 0xee, 0xce, 0x47, 0x95, 0x0a, - 0x9e, 0x4a, 0xf3, 0xfb, 0xfa, 0x7f, 0xcc, 0x1f, 0x0e, 0x12, 0x29, 0x93, 0x94, 0xf9, 0x9c, 0x0a, - 0xff, 0x64, 0x56, 0xfc, 0xbc, 0x52, 0x32, 0xe5, 0xf1, 0x7b, 0xa2, 0x72, 0x69, 0xa4, 0x77, 0xd9, - 0xe2, 0x84, 0x53, 0x41, 0x4e, 0x66, 0x68, 0xbf, 0x4e, 0x97, 0xca, 0x70, 0x99, 0x69, 0xcb, 0x45, - 0xa8, 0x0e, 0x56, 0x7d, 0xd0, 0x4d, 0x87, 0x51, 0xc5, 0x7d, 0x9a, 0x65, 0xd2, 0xd0, 0xaa, 0xf2, - 0x7a, 0x05, 0x8d, 0x53, 0xce, 0x32, 0x63, 0x01, 0xfc, 0x1a, 0xf6, 0x9e, 0x31, 0x13, 0x52, 0xb1, - 0x28, 0xcd, 0x22, 0xf6, 0x6e, 0xc5, 0xb4, 0xf1, 0x10, 0xbc, 0x98, 0x33, 0x2d, 0x57, 0x79, 0xcc, - 0xfa, 0x60, 0x08, 0x46, 0xdd, 0xe8, 0xec, 0xbf, 0x37, 0x85, 0xbb, 0x36, 0xb9, 0xdf, 0x19, 0x82, - 0xd1, 0xde, 0xc1, 0x35, 0x52, 0x6b, 0x81, 0x38, 0x27, 0x47, 0xc2, 0x29, 0xec, 0x05, 0xff, 0x98, - 0x70, 0x1f, 0x5e, 0x70, 0x8d, 0xbb, 0x88, 0x5b, 0x8d, 0x88, 0x80, 0x19, 0xeb, 0xf6, 0xd4, 0xd2, - 0xa2, 0x35, 0x1f, 0xbf, 0x80, 0x37, 0x9e, 0x33, 0x5d, 0xc6, 0xb1, 0x5c, 0x70, 0xad, 0x4b, 0x78, - 0x8b, 0xcc, 0x21, 0xdc, 0x53, 0xe7, 0x8a, 0x7e, 0x67, 0xb8, 0x33, 0xea, 0x46, 0xd5, 0x27, 0xfc, - 0x08, 0xa2, 0x4d, 0xd6, 0x5a, 0xc9, 0x4c, 0xb7, 0xf4, 0xa0, 0xa5, 0x3f, 0xf8, 0xbe, 0x03, 0xbb, - 0xe1, 0xe1, 0x13, 0x5b, 0xb8, 0x67, 0xe0, 0xa5, 0xea, 0xe0, 0x3d, 0xdc, 0x68, 0x71, 0xc3, 0x56, - 0xd0, 0xe6, 0x49, 0xe3, 0xf1, 0xa7, 0x1f, 0x3f, 0xbf, 0x74, 0x6e, 0xe3, 0x41, 0xf1, 0x51, 0x7c, - 0x58, 0x77, 0xf4, 0x70, 0x32, 0xf9, 0x38, 0xd7, 0x15, 0x97, 0x39, 0x98, 0x14, 0xa9, 0xc1, 0xdf, - 0x52, 0x83, 0xff, 0x92, 0x9a, 0x34, 0x52, 0xbf, 0x02, 0xe8, 0xb5, 0x47, 0xe7, 0x8d, 0x1a, 0xc6, - 0x7f, 0x5c, 0x1c, 0x1a, 0x6f, 0xc1, 0xb4, 0x7b, 0xc0, 0x7e, 0x59, 0xd6, 0x18, 0xdf, 0x69, 0x97, - 0x65, 0x5a, 0xaa, 0x39, 0x98, 0xa0, 0xc1, 0xe9, 0xe1, 0x3e, 0xa7, 0x62, 0x2a, 0x98, 0xa1, 0x53, - 0xaa, 0xb8, 0x8b, 0xa2, 0x8a, 0x6b, 0x12, 0x4b, 0x71, 0xf4, 0x19, 0xc0, 0xab, 0xb1, 0x14, 0xf5, - 0x0a, 0x8e, 0xae, 0x9c, 0x35, 0xb8, 0x28, 0xee, 0x68, 0x01, 0x5e, 0xde, 0x75, 0x84, 0x44, 0xa6, - 0x34, 0x4b, 0x88, 0xcc, 0x13, 0x3f, 0x61, 0x59, 0x79, 0x65, 0xfe, 0xb9, 0xa5, 0xbb, 0xdd, 0x07, - 0x9c, 0x8a, 0x5f, 0x00, 0x7c, 0xeb, 0xf4, 0x02, 0xab, 0x7a, 0x9c, 0xca, 0xd5, 0x5b, 0x12, 0x52, - 0x41, 0x8e, 0x67, 0xa7, 0xeb, 0xd7, 0x65, 0xf9, 0xba, 0x0c, 0xa9, 0x58, 0x1e, 0xcf, 0xde, 0xec, - 0x96, 0x5e, 0xf7, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x57, 0xb0, 0xe9, 0x52, 0x04, 0x00, - 0x00, + // 514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xc1, 0x8a, 0xd3, 0x40, + 0x18, 0x66, 0x52, 0x58, 0xed, 0xac, 0x0a, 0xa6, 0x88, 0xdd, 0xac, 0x74, 0x4b, 0x74, 0xa1, 0x0d, + 0xec, 0xc4, 0xd6, 0x93, 0x15, 0x85, 0xd4, 0x43, 0xe8, 0x41, 0x2c, 0x55, 0xf6, 0x20, 0x85, 0x65, + 0x36, 0x3b, 0xc6, 0x81, 0x4c, 0x66, 0xcc, 0x4c, 0x2b, 0x22, 0x5e, 0x3c, 0xf8, 0x02, 0xde, 0x7c, + 0x04, 0xcf, 0x3e, 0xc5, 0x5e, 0x7d, 0x81, 0x3d, 0xf8, 0x10, 0xe2, 0x49, 0x92, 0x99, 0x6e, 0x93, + 0xb6, 0x8a, 0xca, 0x9e, 0x0a, 0xff, 0xf7, 0xfd, 0xdf, 0xf7, 0x7f, 0xff, 0xdf, 0x09, 0x6c, 0xc5, + 0x9c, 0xc7, 0x09, 0xf1, 0x29, 0x66, 0xfe, 0xbc, 0x97, 0xff, 0x1c, 0x09, 0x9e, 0xd0, 0xe8, 0x2d, + 0x12, 0x19, 0x57, 0xdc, 0xbe, 0xaa, 0x71, 0x44, 0x31, 0x43, 0xf3, 0x9e, 0xb3, 0x5b, 0xa5, 0x73, + 0xa1, 0x28, 0x4f, 0xa5, 0xe6, 0x3a, 0x4e, 0x15, 0x2c, 0xeb, 0x38, 0xb7, 0x0c, 0x86, 0x05, 0xf5, + 0x71, 0x9a, 0x72, 0x85, 0xcb, 0x9d, 0x37, 0x4b, 0x68, 0x94, 0x50, 0x92, 0x2a, 0x03, 0xec, 0x95, + 0x80, 0x97, 0x94, 0x24, 0x27, 0x47, 0xc7, 0xe4, 0x15, 0x9e, 0x53, 0x9e, 0x19, 0xc2, 0x4e, 0x89, + 0x90, 0x11, 0xc9, 0x67, 0x59, 0x44, 0x34, 0xe4, 0x0a, 0xd8, 0x78, 0x46, 0xd4, 0x08, 0xb3, 0x71, + 0x31, 0xc8, 0x84, 0xbc, 0x9e, 0x11, 0xa9, 0xec, 0x7d, 0x78, 0x79, 0x41, 0x6c, 0x82, 0x36, 0xe8, + 0xd4, 0x87, 0xf5, 0xb3, 0xc0, 0xfa, 0x19, 0xd4, 0x20, 0xf0, 0x26, 0xe7, 0x90, 0xdd, 0x87, 0x5b, + 0x3a, 0x40, 0xd3, 0x6a, 0x83, 0xce, 0x76, 0xff, 0x06, 0xaa, 0x6c, 0x02, 0x69, 0xd1, 0x61, 0xed, + 0x2c, 0xb0, 0x26, 0x86, 0xe9, 0xbe, 0x81, 0x8d, 0xf0, 0xff, 0x1d, 0xef, 0xc3, 0x4b, 0x66, 0x9f, + 0xc6, 0x72, 0x6f, 0xc5, 0x32, 0x24, 0x4a, 0x0b, 0x3f, 0xd5, 0xb4, 0xc9, 0x82, 0xef, 0x52, 0xb8, + 0xf3, 0x9c, 0xc8, 0xc2, 0x99, 0x64, 0x8c, 0x4a, 0x59, 0xc0, 0xff, 0x66, 0xbf, 0x0f, 0xb7, 0xc5, + 0xb2, 0xb9, 0x69, 0xb5, 0x6b, 0x9d, 0xba, 0x8e, 0x57, 0xae, 0xbb, 0x8f, 0xa0, 0xb3, 0xc9, 0x4a, + 0x0a, 0x9e, 0x4a, 0x62, 0xb7, 0xab, 0x22, 0x20, 0x17, 0xa9, 0xf4, 0xf7, 0xbf, 0xd6, 0x60, 0x7d, + 0x14, 0x3c, 0xd1, 0x41, 0x6c, 0x05, 0xaf, 0x94, 0x6f, 0x64, 0xbb, 0x2b, 0x91, 0x37, 0x1c, 0xd0, + 0xd9, 0x7c, 0x09, 0xb7, 0xfb, 0xe1, 0xdb, 0xf7, 0x4f, 0xd6, 0x6d, 0xb7, 0x95, 0xff, 0xf7, 0xde, + 0x2d, 0x62, 0x3d, 0xf4, 0xbc, 0xf7, 0x03, 0x59, 0x52, 0x19, 0x00, 0x2f, 0x77, 0x0d, 0xff, 0xe4, + 0x1a, 0x5e, 0x88, 0x6b, 0xbc, 0xe2, 0xfa, 0x19, 0x40, 0x7b, 0x7d, 0x75, 0x76, 0x67, 0x45, 0xf8, + 0xb7, 0x87, 0x74, 0xba, 0x7f, 0xc1, 0xd4, 0x77, 0x70, 0xfd, 0x62, 0xac, 0xae, 0x7b, 0x67, 0x7d, + 0x2c, 0xb5, 0xd6, 0x35, 0x00, 0x9e, 0xd3, 0x3a, 0x0d, 0x76, 0x29, 0x66, 0x07, 0x8c, 0x28, 0x7c, + 0x80, 0x05, 0x35, 0x56, 0x58, 0x50, 0x89, 0x22, 0xce, 0x86, 0x1f, 0x01, 0xbc, 0x1e, 0x71, 0x56, + 0x9d, 0x60, 0x78, 0xed, 0x3c, 0xe0, 0x38, 0x7f, 0x72, 0x63, 0xf0, 0xe2, 0xae, 0x21, 0xc4, 0x3c, + 0xc1, 0x69, 0x8c, 0x78, 0x16, 0xfb, 0x31, 0x49, 0x8b, 0x07, 0xe9, 0x2f, 0x25, 0xcd, 0x27, 0xe2, + 0x01, 0xc5, 0xec, 0x07, 0x00, 0x5f, 0xac, 0x46, 0xa8, 0xbb, 0x1e, 0x27, 0x7c, 0x76, 0x82, 0x46, + 0x98, 0xa1, 0xc3, 0xde, 0xe9, 0xa2, 0x3a, 0x2d, 0xaa, 0xd3, 0x11, 0x66, 0xd3, 0xc3, 0xde, 0xf1, + 0x56, 0xa1, 0x75, 0xef, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0x24, 0xb5, 0x51, 0xb9, 0x04, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion6 // IAMPolicyClient is the client API for IAMPolicy service. // @@ -299,10 +306,10 @@ type IAMPolicyClient interface { } type iAMPolicyClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewIAMPolicyClient(cc *grpc.ClientConn) IAMPolicyClient { +func NewIAMPolicyClient(cc grpc.ClientConnInterface) IAMPolicyClient { return &iAMPolicyClient{cc} } @@ -352,6 +359,20 @@ type IAMPolicyServer interface { TestIamPermissions(context.Context, *TestIamPermissionsRequest) (*TestIamPermissionsResponse, error) } +// UnimplementedIAMPolicyServer can be embedded to have forward compatible implementations. +type UnimplementedIAMPolicyServer struct { +} + +func (*UnimplementedIAMPolicyServer) SetIamPolicy(ctx context.Context, req *SetIamPolicyRequest) (*Policy, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetIamPolicy not implemented") +} +func (*UnimplementedIAMPolicyServer) GetIamPolicy(ctx context.Context, req *GetIamPolicyRequest) (*Policy, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetIamPolicy not implemented") +} +func (*UnimplementedIAMPolicyServer) TestIamPermissions(ctx context.Context, req *TestIamPermissionsRequest) (*TestIamPermissionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestIamPermissions not implemented") +} + func RegisterIAMPolicyServer(s *grpc.Server, srv IAMPolicyServer) { s.RegisterService(&_IAMPolicy_serviceDesc, srv) } diff --git a/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go b/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go index 8f02bd3c4..fc3a218b7 100644 --- a/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go @@ -25,9 +25,13 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // Encapsulates settings provided to GetIamPolicy. type GetPolicyOptions struct { // Optional. The policy format version to be returned. - // Acceptable values are 0 and 1. - // If the value is 0, or the field is omitted, policy format version 1 will be - // returned. + // + // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + // rejected. + // + // Requests for policies with any conditional bindings must specify version 3. + // Policies without any conditional bindings may specify any valid value or + // leave the field unset. RequestedPolicyVersion int32 `protobuf:"varint,1,opt,name=requested_policy_version,json=requestedPolicyVersion,proto3" json:"requested_policy_version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -70,7 +74,9 @@ func init() { proto.RegisterType((*GetPolicyOptions)(nil), "google.iam.v1.GetPolicyOptions") } -func init() { proto.RegisterFile("google/iam/v1/options.proto", fileDescriptor_19aa09e909092bd1) } +func init() { + proto.RegisterFile("google/iam/v1/options.proto", fileDescriptor_19aa09e909092bd1) +} var fileDescriptor_19aa09e909092bd1 = []byte{ // 229 bytes of a gzipped FileDescriptorProto diff --git a/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go b/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go index 275cfcea8..086732f12 100644 --- a/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go @@ -91,27 +91,36 @@ func (AuditConfigDelta_Action) EnumDescriptor() ([]byte, []int) { // specify access control policies for Cloud Platform resources. // // -// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -// `members` to a `role`, where the members can be user accounts, Google groups, -// Google domains, and service accounts. A `role` is a named list of permissions -// defined by IAM. +// A `Policy` is a collection of `bindings`. A `binding` binds one or more +// `members` to a single `role`. Members can be user accounts, service accounts, +// Google groups, and domains (such as G Suite). A `role` is a named list of +// permissions (defined by IAM or configured by users). A `binding` can +// optionally specify a `condition`, which is a logic expression that further +// constrains the role binding based on attributes about the request and/or +// target resource. // // **JSON Example** // // { // "bindings": [ // { -// "role": "roles/owner", +// "role": "roles/resourcemanager.organizationAdmin", // "members": [ // "user:mike@example.com", // "group:admins@example.com", // "domain:google.com", -// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +// "serviceAccount:my-project-id@appspot.gserviceaccount.com" // ] // }, // { -// "role": "roles/viewer", -// "members": ["user:sean@example.com"] +// "role": "roles/resourcemanager.organizationViewer", +// "members": ["user:eve@example.com"], +// "condition": { +// "title": "expirable access", +// "description": "Does not grant access after Sep 2020", +// "expression": "request.time < +// timestamp('2020-10-01T00:00:00.000Z')", +// } // } // ] // } @@ -123,19 +132,36 @@ func (AuditConfigDelta_Action) EnumDescriptor() ([]byte, []int) { // - user:mike@example.com // - group:admins@example.com // - domain:google.com -// - serviceAccount:my-other-app@appspot.gserviceaccount.com -// role: roles/owner +// - serviceAccount:my-project-id@appspot.gserviceaccount.com +// role: roles/resourcemanager.organizationAdmin // - members: -// - user:sean@example.com -// role: roles/viewer -// +// - user:eve@example.com +// role: roles/resourcemanager.organizationViewer +// condition: +// title: expirable access +// description: Does not grant access after Sep 2020 +// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') // // For a description of IAM and its features, see the // [IAM developer's guide](https://cloud.google.com/iam/docs). type Policy struct { - // Deprecated. + // Specifies the format of the policy. + // + // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + // rejected. + // + // Operations affecting conditional bindings must specify version 3. This can + // be either setting a conditional policy, modifying a conditional binding, + // or removing a binding (conditional or unconditional) from the stored + // conditional policy. + // Operations on non-conditional policies may specify any valid value or + // leave the field unset. + // + // If no etag is provided in the call to `setIamPolicy`, version compliance + // checks against the stored policy is skipped. Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - // Associates a list of `members` to a `role`. + // Associates a list of `members` to a `role`. Optionally may specify a + // `condition` that determines when binding is in effect. // `bindings` with no members will result in an error. Bindings []*Binding `protobuf:"bytes,4,rep,name=bindings,proto3" json:"bindings,omitempty"` // `etag` is used for optimistic concurrency control as a way to help @@ -147,7 +173,9 @@ type Policy struct { // ensure that their change will be applied to the same version of the policy. // // If no `etag` is provided in the call to `setIamPolicy`, then the existing - // policy is overwritten. + // policy is overwritten. Due to blind-set semantics of an etag-less policy, + // 'setIamPolicy' will not fail even if the incoming policy version does not + // meet the requirements for modifying the stored policy. Etag []byte `protobuf:"bytes,3,opt,name=etag,proto3" json:"etag,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -350,8 +378,7 @@ type BindingDelta struct { // Follows the same format of Binding.members. // Required Member string `protobuf:"bytes,3,opt,name=member,proto3" json:"member,omitempty"` - // The condition that is associated with this binding. This field is logged - // only for Cloud Audit Logging. + // The condition that is associated with this binding. Condition *expr.Expr `protobuf:"bytes,4,opt,name=condition,proto3" json:"condition,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -498,7 +525,9 @@ func init() { proto.RegisterType((*AuditConfigDelta)(nil), "google.iam.v1.AuditConfigDelta") } -func init() { proto.RegisterFile("google/iam/v1/policy.proto", fileDescriptor_a3cd40b8a66b2a99) } +func init() { + proto.RegisterFile("google/iam/v1/policy.proto", fileDescriptor_a3cd40b8a66b2a99) +} var fileDescriptor_a3cd40b8a66b2a99 = []byte{ // 550 bytes of a gzipped FileDescriptorProto diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go index 9ff770b5f..a6e456964 100644 --- a/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go @@ -21,7 +21,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package -// The canonical error codes for Google APIs. +// The canonical error codes for gRPC APIs. // // // Sometimes multiple error codes may apply. Services should return @@ -156,7 +156,8 @@ const ( Code_INTERNAL Code = 13 // The service is currently unavailable. This is most likely a // transient condition, which can be corrected by retrying with - // a backoff. + // a backoff. Note that it is not always safe to retry + // non-idempotent operations. // // See the guidelines above for deciding between `FAILED_PRECONDITION`, // `ABORTED`, and `UNAVAILABLE`. @@ -221,7 +222,9 @@ func init() { proto.RegisterEnum("google.rpc.Code", Code_name, Code_value) } -func init() { proto.RegisterFile("google/rpc/code.proto", fileDescriptor_fe593a732623ccf0) } +func init() { + proto.RegisterFile("google/rpc/code.proto", fileDescriptor_fe593a732623ccf0) +} var fileDescriptor_fe593a732623ccf0 = []byte{ // 362 bytes of a gzipped FileDescriptorProto diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go index 0b9907f89..c988461b6 100644 --- a/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go @@ -24,65 +24,17 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // The `Status` type defines a logical error model that is suitable for // different programming environments, including REST APIs and RPC APIs. It is -// used by [gRPC](https://github.com/grpc). The error model is designed to be: +// used by [gRPC](https://github.com/grpc). Each `Status` message contains +// three pieces of data: error code, error message, and error details. // -// - Simple to use and understand for most users -// - Flexible enough to meet unexpected needs -// -// # Overview -// -// The `Status` message contains three pieces of data: error code, error -// message, and error details. The error code should be an enum value of -// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes -// if needed. The error message should be a developer-facing English message -// that helps developers *understand* and *resolve* the error. If a localized -// user-facing error message is needed, put the localized message in the error -// details or localize it in the client. The optional error details may contain -// arbitrary information about the error. There is a predefined set of error -// detail types in the package `google.rpc` that can be used for common error -// conditions. -// -// # Language mapping -// -// The `Status` message is the logical representation of the error model, but it -// is not necessarily the actual wire format. When the `Status` message is -// exposed in different client libraries and different wire protocols, it can be -// mapped differently. For example, it will likely be mapped to some exceptions -// in Java, but more likely mapped to some error codes in C. -// -// # Other uses -// -// The error model and the `Status` message can be used in a variety of -// environments, either with or without APIs, to provide a -// consistent developer experience across different environments. -// -// Example uses of this error model include: -// -// - Partial errors. If a service needs to return partial errors to the client, -// it may embed the `Status` in the normal response to indicate the partial -// errors. -// -// - Workflow errors. A typical workflow has multiple steps. Each step may -// have a `Status` message for error reporting. -// -// - Batch operations. If a client uses batch request and batch response, the -// `Status` message should be used directly inside batch response, one for -// each error sub-response. -// -// - Asynchronous operations. If an API call embeds asynchronous operation -// results in its response, the status of those operations should be -// represented directly using the `Status` message. -// -// - Logging. If some API errors are stored in logs, the message `Status` could -// be used directly after any stripping needed for security/privacy reasons. +// You can find out more about this error model and how to work with it in the +// [API Design Guide](https://cloud.google.com/apis/design/errors). type Status struct { - // The status code, which should be an enum value of - // [google.rpc.Code][google.rpc.Code]. + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // A developer-facing error message, which should be in English. Any // user-facing error message should be localized and sent in the - // [google.rpc.Status.details][google.rpc.Status.details] field, or localized - // by the client. + // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of // message types for APIs to use. @@ -142,10 +94,12 @@ func init() { proto.RegisterType((*Status)(nil), "google.rpc.Status") } -func init() { proto.RegisterFile("google/rpc/status.proto", fileDescriptor_24d244abaf643bfe) } +func init() { + proto.RegisterFile("google/rpc/status.proto", fileDescriptor_24d244abaf643bfe) +} var fileDescriptor_24d244abaf643bfe = []byte{ - // 209 bytes of a gzipped FileDescriptorProto + // 212 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x48, 0xe8, 0x15, 0x15, 0x24, 0x4b, 0x49, 0x42, 0x15, 0x81, @@ -154,10 +108,10 @@ var fileDescriptor_24d244abaf643bfe = []byte{ 0xc0, 0x6c, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, 0x48, 0x8f, 0x8b, 0x3d, 0x25, 0xb5, 0x24, 0x31, 0x33, 0xa7, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x6a, 0x21, 0xcc, 0x12, 0x3d, 0xc7, - 0xbc, 0xca, 0x20, 0x98, 0x22, 0xa7, 0x38, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x3d, 0x84, 0xa3, 0x9c, + 0xbc, 0xca, 0x20, 0x98, 0x22, 0xa7, 0x44, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x3d, 0x84, 0xa3, 0x9c, 0xb8, 0x21, 0xf6, 0x06, 0x80, 0x94, 0x07, 0x30, 0x46, 0x99, 0x43, 0xa5, 0xd2, 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xf2, 0x8b, 0xd2, 0xf5, 0xd3, 0x53, 0xf3, 0xc0, 0x86, 0xe9, 0x43, 0xa4, 0x12, - 0x0b, 0x32, 0x8b, 0x91, 0xfc, 0x69, 0x0d, 0xa1, 0x16, 0x31, 0x31, 0x07, 0x05, 0x38, 0x27, 0xb1, - 0x81, 0x55, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x53, 0xf0, 0x7c, 0x10, 0x01, 0x00, - 0x00, + 0x0b, 0x32, 0x8b, 0x91, 0xfc, 0x69, 0x0d, 0xa1, 0x7e, 0x30, 0x32, 0x2e, 0x62, 0x62, 0x0e, 0x0a, + 0x70, 0x4e, 0x62, 0x03, 0x2b, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x28, 0x45, 0xb1, + 0x13, 0x01, 0x00, 0x00, } diff --git a/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go b/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go index 27d46fe00..5f8f3d7c2 100644 --- a/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go @@ -105,7 +105,9 @@ func init() { proto.RegisterType((*Expr)(nil), "google.type.Expr") } -func init() { proto.RegisterFile("google/type/expr.proto", fileDescriptor_d7920f1ae7a2722f) } +func init() { + proto.RegisterFile("google/type/expr.proto", fileDescriptor_d7920f1ae7a2722f) +} var fileDescriptor_d7920f1ae7a2722f = []byte{ // 195 bytes of a gzipped FileDescriptorProto diff --git a/vendor/google.golang.org/grpc/.travis.yml b/vendor/google.golang.org/grpc/.travis.yml index 024408e64..a11e8cbca 100644 --- a/vendor/google.golang.org/grpc/.travis.yml +++ b/vendor/google.golang.org/grpc/.travis.yml @@ -2,18 +2,20 @@ language: go matrix: include: - - go: 1.12.x + - go: 1.13.x env: VET=1 GO111MODULE=on - - go: 1.12.x + - go: 1.13.x env: RACE=1 GO111MODULE=on - - go: 1.12.x + - go: 1.13.x env: RUN386=1 - - go: 1.12.x + - go: 1.13.x env: GRPC_GO_RETRY=on + - go: 1.13.x + env: TESTEXTRAS=1 + - go: 1.12.x + env: GO111MODULE=on - go: 1.11.x env: GO111MODULE=on - - go: 1.10.x - - go: 1.9.x - go: 1.9.x env: GAE=1 @@ -23,17 +25,18 @@ before_install: - if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go"; fi - if [[ -n "${RUN386}" ]]; then export GOARCH=386; fi - if [[ "${TRAVIS_EVENT_TYPE}" = "cron" && -z "${RUN386}" ]]; then RACE=1; fi - - if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]]; then VET_SKIP_PROTO=1; fi + - if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]]; then export VET_SKIP_PROTO=1; fi install: - try3() { eval "$*" || eval "$*" || eval "$*"; } - try3 'if [[ "${GO111MODULE}" = "on" ]]; then go mod download; else make testdeps; fi' - - if [[ "${GAE}" = 1 ]]; then source ./install_gae.sh; make testappenginedeps; fi - - if [[ "${VET}" = 1 ]]; then ./vet.sh -install; fi + - if [[ -n "${GAE}" ]]; then source ./install_gae.sh; make testappenginedeps; fi + - if [[ -n "${VET}" ]]; then ./vet.sh -install; fi script: - set -e - - if [[ "${VET}" = 1 ]]; then ./vet.sh; fi - - if [[ "${GAE}" = 1 ]]; then make testappengine; exit 0; fi - - if [[ "${RACE}" = 1 ]]; then make testrace; exit 0; fi + - if [[ -n "${TESTEXTRAS}" ]]; then examples/examples_test.sh; interop/interop_test.sh; make testsubmodule; exit 0; fi + - if [[ -n "${VET}" ]]; then ./vet.sh; fi + - if [[ -n "${GAE}" ]]; then make testappengine; exit 0; fi + - if [[ -n "${RACE}" ]]; then make testrace; exit 0; fi - make test diff --git a/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md b/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md new file mode 100644 index 000000000..9d4213ebc --- /dev/null +++ b/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md @@ -0,0 +1,3 @@ +## Community Code of Conduct + +gRPC follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). diff --git a/vendor/google.golang.org/grpc/CONTRIBUTING.md b/vendor/google.golang.org/grpc/CONTRIBUTING.md index 6e69b28c2..4f1567e2f 100644 --- a/vendor/google.golang.org/grpc/CONTRIBUTING.md +++ b/vendor/google.golang.org/grpc/CONTRIBUTING.md @@ -1,6 +1,8 @@ # How to contribute -We definitely welcome your patches and contributions to gRPC! +We definitely welcome your patches and contributions to gRPC! Please read the gRPC +organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md) +and [contribution guidelines](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) before proceeding. If you are new to github, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/) diff --git a/vendor/google.golang.org/grpc/GOVERNANCE.md b/vendor/google.golang.org/grpc/GOVERNANCE.md new file mode 100644 index 000000000..d6ff26747 --- /dev/null +++ b/vendor/google.golang.org/grpc/GOVERNANCE.md @@ -0,0 +1 @@ +This repository is governed by the gRPC organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md). diff --git a/vendor/google.golang.org/grpc/MAINTAINERS.md b/vendor/google.golang.org/grpc/MAINTAINERS.md new file mode 100644 index 000000000..093c82b3a --- /dev/null +++ b/vendor/google.golang.org/grpc/MAINTAINERS.md @@ -0,0 +1,27 @@ +This page lists all active maintainers of this repository. If you were a +maintainer and would like to add your name to the Emeritus list, please send us a +PR. + +See [GOVERNANCE.md](https://github.com/grpc/grpc-community/blob/master/governance.md) +for governance guidelines and how to become a maintainer. +See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) +for general contribution guidelines. + +## Maintainers (in alphabetical order) +- [canguler](https://github.com/canguler), Google LLC +- [cesarghali](https://github.com/cesarghali), Google LLC +- [dfawley](https://github.com/dfawley), Google LLC +- [easwars](https://github.com/easwars), Google LLC +- [jadekler](https://github.com/jadekler), Google LLC +- [menghanl](https://github.com/menghanl), Google LLC +- [srini100](https://github.com/srini100), Google LLC + +## Emeritus Maintainers (in alphabetical order) +- [adelez](https://github.com/adelez), Google LLC +- [iamqizhao](https://github.com/iamqizhao), Google LLC +- [jtattermusch](https://github.com/jtattermusch), Google LLC +- [lyuxuan](https://github.com/lyuxuan), Google LLC +- [makmukhi](https://github.com/makmukhi), Google LLC +- [matt-kwong](https://github.com/matt-kwong), Google LLC +- [nicolasnoble](https://github.com/nicolasnoble), Google LLC +- [yongni](https://github.com/yongni), Google LLC diff --git a/vendor/google.golang.org/grpc/Makefile b/vendor/google.golang.org/grpc/Makefile index db982aabd..410f7d56d 100644 --- a/vendor/google.golang.org/grpc/Makefile +++ b/vendor/google.golang.org/grpc/Makefile @@ -19,6 +19,9 @@ proto: test: testdeps go test -cpu 1,4 -timeout 7m google.golang.org/grpc/... +testsubmodule: testdeps + cd security/advancedtls && go test -cpu 1,4 -timeout 7m google.golang.org/grpc/security/advancedtls/... + testappengine: testappenginedeps goapp test -cpu 1,4 -timeout 7m google.golang.org/grpc/... diff --git a/vendor/google.golang.org/grpc/attributes/attributes.go b/vendor/google.golang.org/grpc/attributes/attributes.go new file mode 100644 index 000000000..68ffc6201 --- /dev/null +++ b/vendor/google.golang.org/grpc/attributes/attributes.go @@ -0,0 +1,70 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package attributes defines a generic key/value store used in various gRPC +// components. +// +// All APIs in this package are EXPERIMENTAL. +package attributes + +import "fmt" + +// Attributes is an immutable struct for storing and retrieving generic +// key/value pairs. Keys must be hashable, and users should define their own +// types for keys. +type Attributes struct { + m map[interface{}]interface{} +} + +// New returns a new Attributes containing all key/value pairs in kvs. If the +// same key appears multiple times, the last value overwrites all previous +// values for that key. Panics if len(kvs) is not even. +func New(kvs ...interface{}) *Attributes { + if len(kvs)%2 != 0 { + panic(fmt.Sprintf("attributes.New called with unexpected input: len(kvs) = %v", len(kvs))) + } + a := &Attributes{m: make(map[interface{}]interface{}, len(kvs)/2)} + for i := 0; i < len(kvs)/2; i++ { + a.m[kvs[i*2]] = kvs[i*2+1] + } + return a +} + +// WithValues returns a new Attributes containing all key/value pairs in a and +// kvs. Panics if len(kvs) is not even. If the same key appears multiple +// times, the last value overwrites all previous values for that key. To +// remove an existing key, use a nil value. +func (a *Attributes) WithValues(kvs ...interface{}) *Attributes { + if len(kvs)%2 != 0 { + panic(fmt.Sprintf("attributes.New called with unexpected input: len(kvs) = %v", len(kvs))) + } + n := &Attributes{m: make(map[interface{}]interface{}, len(a.m)+len(kvs)/2)} + for k, v := range a.m { + n.m[k] = v + } + for i := 0; i < len(kvs)/2; i++ { + n.m[kvs[i*2]] = kvs[i*2+1] + } + return n +} + +// Value returns the value associated with these attributes for key, or nil if +// no value is associated with key. +func (a *Attributes) Value(key interface{}) interface{} { + return a.m[key] +} diff --git a/vendor/google.golang.org/grpc/backoff.go b/vendor/google.golang.org/grpc/backoff.go index 97c6e2568..ff7c3ee6f 100644 --- a/vendor/google.golang.org/grpc/backoff.go +++ b/vendor/google.golang.org/grpc/backoff.go @@ -23,16 +23,36 @@ package grpc import ( "time" + + "google.golang.org/grpc/backoff" ) // DefaultBackoffConfig uses values specified for backoff in // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +// +// Deprecated: use ConnectParams instead. Will be supported throughout 1.x. var DefaultBackoffConfig = BackoffConfig{ MaxDelay: 120 * time.Second, } // BackoffConfig defines the parameters for the default gRPC backoff strategy. +// +// Deprecated: use ConnectParams instead. Will be supported throughout 1.x. type BackoffConfig struct { // MaxDelay is the upper bound of backoff delay. MaxDelay time.Duration } + +// ConnectParams defines the parameters for connecting and retrying. Users are +// encouraged to use this instead of the BackoffConfig type defined above. See +// here for more details: +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +// +// This API is EXPERIMENTAL. +type ConnectParams struct { + // Backoff specifies the configuration options for connection backoff. + Backoff backoff.Config + // MinConnectTimeout is the minimum amount of time we are willing to give a + // connection to complete. + MinConnectTimeout time.Duration +} diff --git a/vendor/google.golang.org/grpc/backoff/backoff.go b/vendor/google.golang.org/grpc/backoff/backoff.go new file mode 100644 index 000000000..0787d0b50 --- /dev/null +++ b/vendor/google.golang.org/grpc/backoff/backoff.go @@ -0,0 +1,52 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package backoff provides configuration options for backoff. +// +// More details can be found at: +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +// +// All APIs in this package are experimental. +package backoff + +import "time" + +// Config defines the configuration options for backoff. +type Config struct { + // BaseDelay is the amount of time to backoff after the first failure. + BaseDelay time.Duration + // Multiplier is the factor with which to multiply backoffs after a + // failed retry. Should ideally be greater than 1. + Multiplier float64 + // Jitter is the factor with which backoffs are randomized. + Jitter float64 + // MaxDelay is the upper bound of backoff delay. + MaxDelay time.Duration +} + +// DefaultConfig is a backoff configuration with the default values specfied +// at https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +// +// This should be useful for callers who want to configure backoff with +// non-default values only for a subset of the options. +var DefaultConfig = Config{ + BaseDelay: 1.0 * time.Second, + Multiplier: 1.6, + Jitter: 0.2, + MaxDelay: 120 * time.Second, +} diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go index c266f4ec1..9258858ed 100644 --- a/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -117,6 +117,15 @@ type NewSubConnOptions struct { HealthCheckEnabled bool } +// State contains the balancer's state relevant to the gRPC ClientConn. +type State struct { + // State contains the connectivity state of the balancer, which is used to + // determine the state of the ClientConn. + ConnectivityState connectivity.State + // Picker is used to choose connections (SubConns) for RPCs. + Picker V2Picker +} + // ClientConn represents a gRPC ClientConn. // // This interface is to be implemented by gRPC. Users should not need a @@ -137,10 +146,19 @@ type ClientConn interface { // // gRPC will update the connectivity state of the ClientConn, and will call pick // on the new picker to pick new SubConn. + // + // Deprecated: use UpdateState instead UpdateBalancerState(s connectivity.State, p Picker) + // UpdateState notifies gRPC that the balancer's internal state has + // changed. + // + // gRPC will update the connectivity state of the ClientConn, and will call pick + // on the new picker to pick new SubConns. + UpdateState(State) + // ResolveNow is called by balancer to notify gRPC to do a name resolving. - ResolveNow(resolver.ResolveNowOption) + ResolveNow(resolver.ResolveNowOptions) // Target returns the dial target for this ClientConn. // @@ -185,11 +203,14 @@ type ConfigParser interface { ParseConfig(LoadBalancingConfigJSON json.RawMessage) (serviceconfig.LoadBalancingConfig, error) } -// PickOptions contains addition information for the Pick operation. -type PickOptions struct { +// PickInfo contains additional information for the Pick operation. +type PickInfo struct { // FullMethodName is the method name that NewClientStream() is called // with. The canonical format is /service/Method. FullMethodName string + // Ctx is the RPC's context, and may contain relevant RPC-level information + // like the outgoing header metadata. + Ctx context.Context } // DoneInfo contains additional information for done. @@ -215,7 +236,7 @@ var ( ErrNoSubConnAvailable = errors.New("no SubConn is available") // ErrTransientFailure indicates all SubConns are in TransientFailure. // WaitForReady RPCs will block, non-WaitForReady RPCs will fail. - ErrTransientFailure = errors.New("all SubConns are in TransientFailure") + ErrTransientFailure = TransientFailureError(errors.New("all SubConns are in TransientFailure")) ) // Picker is used by gRPC to pick a SubConn to send an RPC. @@ -223,6 +244,8 @@ var ( // internal state has changed. // // The pickers used by gRPC can be updated by ClientConn.UpdateBalancerState(). +// +// Deprecated: use V2Picker instead type Picker interface { // Pick returns the SubConn to be used to send the RPC. // The returned SubConn must be one returned by NewSubConn(). @@ -243,18 +266,76 @@ type Picker interface { // // If the returned error is not nil: // - If the error is ErrNoSubConnAvailable, gRPC will block until UpdateBalancerState() - // - If the error is ErrTransientFailure: + // - If the error is ErrTransientFailure or implements IsTransientFailure() + // bool, returning true: // - If the RPC is wait-for-ready, gRPC will block until UpdateBalancerState() // is called to pick again; // - Otherwise, RPC will fail with unavailable error. // - Else (error is other non-nil error): - // - The RPC will fail with unavailable error. + // - The RPC will fail with the error's status code, or Unknown if it is + // not a status error. // // The returned done() function will be called once the rpc has finished, // with the final status of that RPC. If the SubConn returned is not a // valid SubConn type, done may not be called. done may be nil if balancer // doesn't care about the RPC status. - Pick(ctx context.Context, opts PickOptions) (conn SubConn, done func(DoneInfo), err error) + Pick(ctx context.Context, info PickInfo) (conn SubConn, done func(DoneInfo), err error) +} + +// PickResult contains information related to a connection chosen for an RPC. +type PickResult struct { + // SubConn is the connection to use for this pick, if its state is Ready. + // If the state is not Ready, gRPC will block the RPC until a new Picker is + // provided by the balancer (using ClientConn.UpdateState). The SubConn + // must be one returned by ClientConn.NewSubConn. + SubConn SubConn + + // Done is called when the RPC is completed. If the SubConn is not ready, + // this will be called with a nil parameter. If the SubConn is not a valid + // type, Done may not be called. May be nil if the balancer does not wish + // to be notified when the RPC completes. + Done func(DoneInfo) +} + +type transientFailureError struct { + error +} + +func (e *transientFailureError) IsTransientFailure() bool { return true } + +// TransientFailureError wraps err in an error implementing +// IsTransientFailure() bool, returning true. +func TransientFailureError(err error) error { + return &transientFailureError{error: err} +} + +// V2Picker is used by gRPC to pick a SubConn to send an RPC. +// Balancer is expected to generate a new picker from its snapshot every time its +// internal state has changed. +// +// The pickers used by gRPC can be updated by ClientConn.UpdateBalancerState(). +type V2Picker interface { + // Pick returns the connection to use for this RPC and related information. + // + // Pick should not block. If the balancer needs to do I/O or any blocking + // or time-consuming work to service this call, it should return + // ErrNoSubConnAvailable, and the Pick call will be repeated by gRPC when + // the Picker is updated (using ClientConn.UpdateState). + // + // If an error is returned: + // + // - If the error is ErrNoSubConnAvailable, gRPC will block until a new + // Picker is provided by the balancer (using ClientConn.UpdateState). + // + // - If the error implements IsTransientFailure() bool, returning true, + // wait for ready RPCs will wait, but non-wait for ready RPCs will be + // terminated with this error's Error() string and status code + // Unavailable. + // + // - Any other errors terminate all RPCs with the code and message + // provided. If the error is not a status error, it will be converted by + // gRPC to a status error with code Unknown. + Pick(info PickInfo) (PickResult, error) } // Balancer takes input from gRPC, manages SubConns, and collects and aggregates @@ -292,8 +373,11 @@ type Balancer interface { // SubConnState describes the state of a SubConn. type SubConnState struct { + // ConnectivityState is the connectivity state of the SubConn. ConnectivityState connectivity.State - // TODO: add last connection error + // ConnectionError is set if the ConnectivityState is TransientFailure, + // describing the reason the SubConn failed. Otherwise, it is nil. + ConnectionError error } // ClientConnState describes the state of a ClientConn relevant to the @@ -305,14 +389,23 @@ type ClientConnState struct { BalancerConfig serviceconfig.LoadBalancingConfig } +// ErrBadResolverState may be returned by UpdateClientConnState to indicate a +// problem with the provided name resolver data. +var ErrBadResolverState = errors.New("bad resolver state") + // V2Balancer is defined for documentation purposes. If a Balancer also // implements V2Balancer, its UpdateClientConnState method will be called // instead of HandleResolvedAddrs and its UpdateSubConnState will be called // instead of HandleSubConnStateChange. type V2Balancer interface { // UpdateClientConnState is called by gRPC when the state of the ClientConn - // changes. - UpdateClientConnState(ClientConnState) + // changes. If the error returned is ErrBadResolverState, the ClientConn + // will begin calling ResolveNow on the active name resolver with + // exponential backoff until a subsequent call to UpdateClientConnState + // returns a nil error. Any other errors are currently ignored. + UpdateClientConnState(ClientConnState) error + // ResolverError is called by gRPC when the name resolver reports an error. + ResolverError(error) // UpdateSubConnState is called by gRPC when the state of a SubConn // changes. UpdateSubConnState(SubConn, SubConnState) @@ -326,9 +419,8 @@ type V2Balancer interface { // // It's not thread safe. type ConnectivityStateEvaluator struct { - numReady uint64 // Number of addrConns in ready state. - numConnecting uint64 // Number of addrConns in connecting state. - numTransientFailure uint64 // Number of addrConns in transientFailure. + numReady uint64 // Number of addrConns in ready state. + numConnecting uint64 // Number of addrConns in connecting state. } // RecordTransition records state change happening in subConn and based on that @@ -348,8 +440,6 @@ func (cse *ConnectivityStateEvaluator) RecordTransition(oldState, newState conne cse.numReady += updateVal case connectivity.Connecting: cse.numConnecting += updateVal - case connectivity.TransientFailure: - cse.numTransientFailure += updateVal } } diff --git a/vendor/google.golang.org/grpc/balancer/base/balancer.go b/vendor/google.golang.org/grpc/balancer/base/balancer.go index 1af88f0a3..d7d72918a 100644 --- a/vendor/google.golang.org/grpc/balancer/base/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/base/balancer.go @@ -20,6 +20,8 @@ package base import ( "context" + "errors" + "fmt" "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" @@ -28,34 +30,44 @@ import ( ) type baseBuilder struct { - name string - pickerBuilder PickerBuilder - config Config + name string + pickerBuilder PickerBuilder + v2PickerBuilder V2PickerBuilder + config Config } func (bb *baseBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer { - return &baseBalancer{ - cc: cc, - pickerBuilder: bb.pickerBuilder, + bal := &baseBalancer{ + cc: cc, + pickerBuilder: bb.pickerBuilder, + v2PickerBuilder: bb.v2PickerBuilder, subConns: make(map[resolver.Address]balancer.SubConn), scStates: make(map[balancer.SubConn]connectivity.State), csEvltr: &balancer.ConnectivityStateEvaluator{}, - // Initialize picker to a picker that always return - // ErrNoSubConnAvailable, because when state of a SubConn changes, we - // may call UpdateBalancerState with this picker. - picker: NewErrPicker(balancer.ErrNoSubConnAvailable), - config: bb.config, + config: bb.config, } + // Initialize picker to a picker that always returns + // ErrNoSubConnAvailable, because when state of a SubConn changes, we + // may call UpdateState with this picker. + if bb.pickerBuilder != nil { + bal.picker = NewErrPicker(balancer.ErrNoSubConnAvailable) + } else { + bal.v2Picker = NewErrPickerV2(balancer.ErrNoSubConnAvailable) + } + return bal } func (bb *baseBuilder) Name() string { return bb.name } +var _ balancer.V2Balancer = (*baseBalancer)(nil) // Assert that we implement V2Balancer + type baseBalancer struct { - cc balancer.ClientConn - pickerBuilder PickerBuilder + cc balancer.ClientConn + pickerBuilder PickerBuilder + v2PickerBuilder V2PickerBuilder csEvltr *balancer.ConnectivityStateEvaluator state connectivity.State @@ -63,19 +75,50 @@ type baseBalancer struct { subConns map[resolver.Address]balancer.SubConn scStates map[balancer.SubConn]connectivity.State picker balancer.Picker + v2Picker balancer.V2Picker config Config + + resolverErr error // the last error reported by the resolver; cleared on successful resolution + connErr error // the last connection error; cleared upon leaving TransientFailure } func (b *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { panic("not implemented") } -func (b *baseBalancer) UpdateClientConnState(s balancer.ClientConnState) { +func (b *baseBalancer) ResolverError(err error) { + b.resolverErr = err + if len(b.subConns) == 0 { + b.state = connectivity.TransientFailure + } + if b.state != connectivity.TransientFailure { + // The picker will not change since the balancer does not currently + // report an error. + return + } + b.regeneratePicker() + if b.picker != nil { + b.cc.UpdateBalancerState(b.state, b.picker) + } else { + b.cc.UpdateState(balancer.State{ + ConnectivityState: b.state, + Picker: b.v2Picker, + }) + } +} + +func (b *baseBalancer) UpdateClientConnState(s balancer.ClientConnState) error { // TODO: handle s.ResolverState.Err (log if not nil) once implemented. // TODO: handle s.ResolverState.ServiceConfig? if grpclog.V(2) { grpclog.Infoln("base.baseBalancer: got new ClientConn state: ", s) } + if len(s.ResolverState.Addresses) == 0 { + b.ResolverError(errors.New("produced zero addresses")) + return balancer.ErrBadResolverState + } + // Successful resolution; clear resolver error and ensure we return nil. + b.resolverErr = nil // addrsSet is the set converted from addrs, it's used for quick lookup of an address. addrsSet := make(map[resolver.Address]struct{}) for _, a := range s.ResolverState.Addresses { @@ -101,26 +144,57 @@ func (b *baseBalancer) UpdateClientConnState(s balancer.ClientConnState) { // The entry will be deleted in HandleSubConnStateChange. } } + return nil +} + +// mergeErrors builds an error from the last connection error and the last +// resolver error. Must only be called if b.state is TransientFailure. +func (b *baseBalancer) mergeErrors() error { + // connErr must always be non-nil unless there are no SubConns, in which + // case resolverErr must be non-nil. + if b.connErr == nil { + return fmt.Errorf("last resolver error: %v", b.resolverErr) + } + if b.resolverErr == nil { + return fmt.Errorf("last connection error: %v", b.connErr) + } + return fmt.Errorf("last connection error: %v; last resolver error: %v", b.connErr, b.resolverErr) } // regeneratePicker takes a snapshot of the balancer, and generates a picker // from it. The picker is -// - errPicker with ErrTransientFailure if the balancer is in TransientFailure, +// - errPicker if the balancer is in TransientFailure, // - built by the pickerBuilder with all READY SubConns otherwise. func (b *baseBalancer) regeneratePicker() { if b.state == connectivity.TransientFailure { - b.picker = NewErrPicker(balancer.ErrTransientFailure) + if b.pickerBuilder != nil { + b.picker = NewErrPicker(balancer.ErrTransientFailure) + } else { + b.v2Picker = NewErrPickerV2(balancer.TransientFailureError(b.mergeErrors())) + } return } - readySCs := make(map[resolver.Address]balancer.SubConn) + if b.pickerBuilder != nil { + readySCs := make(map[resolver.Address]balancer.SubConn) - // Filter out all ready SCs from full subConn map. - for addr, sc := range b.subConns { - if st, ok := b.scStates[sc]; ok && st == connectivity.Ready { - readySCs[addr] = sc + // Filter out all ready SCs from full subConn map. + for addr, sc := range b.subConns { + if st, ok := b.scStates[sc]; ok && st == connectivity.Ready { + readySCs[addr] = sc + } } + b.picker = b.pickerBuilder.Build(readySCs) + } else { + readySCs := make(map[balancer.SubConn]SubConnInfo) + + // Filter out all ready SCs from full subConn map. + for addr, sc := range b.subConns { + if st, ok := b.scStates[sc]; ok && st == connectivity.Ready { + readySCs[sc] = SubConnInfo{Address: addr} + } + } + b.v2Picker = b.v2PickerBuilder.Build(PickerBuildInfo{ReadySCs: readySCs}) } - b.picker = b.pickerBuilder.Build(readySCs) } func (b *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { @@ -152,6 +226,9 @@ func (b *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.Su oldAggrState := b.state b.state = b.csEvltr.RecordTransition(oldS, s) + // Set or clear the last connection error accordingly. + b.connErr = state.ConnectionError + // Regenerate picker when one of the following happens: // - this sc became ready from not-ready // - this sc became not-ready from ready @@ -162,7 +239,11 @@ func (b *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.Su b.regeneratePicker() } - b.cc.UpdateBalancerState(b.state, b.picker) + if b.picker != nil { + b.cc.UpdateBalancerState(b.state, b.picker) + } else { + b.cc.UpdateState(balancer.State{ConnectivityState: b.state, Picker: b.v2Picker}) + } } // Close is a nop because base balancer doesn't have internal state to clean up, @@ -179,6 +260,19 @@ type errPicker struct { err error // Pick() always returns this err. } -func (p *errPicker) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) { +func (p *errPicker) Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { return nil, nil, p.err } + +// NewErrPickerV2 returns a V2Picker that always returns err on Pick(). +func NewErrPickerV2(err error) balancer.V2Picker { + return &errPickerV2{err: err} +} + +type errPickerV2 struct { + err error // Pick() always returns this err. +} + +func (p *errPickerV2) Pick(info balancer.PickInfo) (balancer.PickResult, error) { + return balancer.PickResult{}, p.err +} diff --git a/vendor/google.golang.org/grpc/balancer/base/base.go b/vendor/google.golang.org/grpc/balancer/base/base.go index 34b1f2994..4192918b9 100644 --- a/vendor/google.golang.org/grpc/balancer/base/base.go +++ b/vendor/google.golang.org/grpc/balancer/base/base.go @@ -42,6 +42,26 @@ type PickerBuilder interface { Build(readySCs map[resolver.Address]balancer.SubConn) balancer.Picker } +// V2PickerBuilder creates balancer.V2Picker. +type V2PickerBuilder interface { + // Build returns a picker that will be used by gRPC to pick a SubConn. + Build(info PickerBuildInfo) balancer.V2Picker +} + +// PickerBuildInfo contains information needed by the picker builder to +// construct a picker. +type PickerBuildInfo struct { + // ReadySCs is a map from all ready SubConns to the Addresses used to + // create them. + ReadySCs map[balancer.SubConn]SubConnInfo +} + +// SubConnInfo contains information about a SubConn created by the base +// balancer. +type SubConnInfo struct { + Address resolver.Address // the address used to create this SubConn +} + // NewBalancerBuilder returns a balancer builder. The balancers // built by this builder will use the picker builder to build pickers. func NewBalancerBuilder(name string, pb PickerBuilder) balancer.Builder { @@ -62,3 +82,12 @@ func NewBalancerBuilderWithConfig(name string, pb PickerBuilder, config Config) config: config, } } + +// NewBalancerBuilderV2 returns a base balancer builder configured by the provided config. +func NewBalancerBuilderV2(name string, pb V2PickerBuilder, config Config) balancer.Builder { + return &baseBuilder{ + name: name, + v2PickerBuilder: pb, + config: config, + } +} diff --git a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go index 29f7a4ddd..d4d645501 100644 --- a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go +++ b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go @@ -22,14 +22,12 @@ package roundrobin import ( - "context" "sync" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/grpcrand" - "google.golang.org/grpc/resolver" ) // Name is the name of round_robin balancer. @@ -37,7 +35,7 @@ const Name = "round_robin" // newBuilder creates a new roundrobin balancer builder. func newBuilder() balancer.Builder { - return base.NewBalancerBuilderWithConfig(Name, &rrPickerBuilder{}, base.Config{HealthCheck: true}) + return base.NewBalancerBuilderV2(Name, &rrPickerBuilder{}, base.Config{HealthCheck: true}) } func init() { @@ -46,13 +44,13 @@ func init() { type rrPickerBuilder struct{} -func (*rrPickerBuilder) Build(readySCs map[resolver.Address]balancer.SubConn) balancer.Picker { - grpclog.Infof("roundrobinPicker: newPicker called with readySCs: %v", readySCs) - if len(readySCs) == 0 { - return base.NewErrPicker(balancer.ErrNoSubConnAvailable) +func (*rrPickerBuilder) Build(info base.PickerBuildInfo) balancer.V2Picker { + grpclog.Infof("roundrobinPicker: newPicker called with info: %v", info) + if len(info.ReadySCs) == 0 { + return base.NewErrPickerV2(balancer.ErrNoSubConnAvailable) } var scs []balancer.SubConn - for _, sc := range readySCs { + for sc := range info.ReadySCs { scs = append(scs, sc) } return &rrPicker{ @@ -74,10 +72,10 @@ type rrPicker struct { next int } -func (p *rrPicker) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) { +func (p *rrPicker) Pick(balancer.PickInfo) (balancer.PickResult, error) { p.mu.Lock() sc := p.subConns[p.next] p.next = (p.next + 1) % len(p.subConns) p.mu.Unlock() - return sc, nil, nil + return balancer.PickResult{SubConn: sc}, nil } diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go index 8df4095ca..824f28e74 100644 --- a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go +++ b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go @@ -25,6 +25,8 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/buffer" + "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/resolver" ) @@ -32,64 +34,17 @@ import ( type scStateUpdate struct { sc balancer.SubConn state connectivity.State -} - -// scStateUpdateBuffer is an unbounded channel for scStateChangeTuple. -// TODO make a general purpose buffer that uses interface{}. -type scStateUpdateBuffer struct { - c chan *scStateUpdate - mu sync.Mutex - backlog []*scStateUpdate -} - -func newSCStateUpdateBuffer() *scStateUpdateBuffer { - return &scStateUpdateBuffer{ - c: make(chan *scStateUpdate, 1), - } -} - -func (b *scStateUpdateBuffer) put(t *scStateUpdate) { - b.mu.Lock() - defer b.mu.Unlock() - if len(b.backlog) == 0 { - select { - case b.c <- t: - return - default: - } - } - b.backlog = append(b.backlog, t) -} - -func (b *scStateUpdateBuffer) load() { - b.mu.Lock() - defer b.mu.Unlock() - if len(b.backlog) > 0 { - select { - case b.c <- b.backlog[0]: - b.backlog[0] = nil - b.backlog = b.backlog[1:] - default: - } - } -} - -// get returns the channel that the scStateUpdate will be sent to. -// -// Upon receiving, the caller should call load to send another -// scStateChangeTuple onto the channel if there is any. -func (b *scStateUpdateBuffer) get() <-chan *scStateUpdate { - return b.c + err error } // ccBalancerWrapper is a wrapper on top of cc for balancers. // It implements balancer.ClientConn interface. type ccBalancerWrapper struct { - cc *ClientConn - balancer balancer.Balancer - stateChangeQueue *scStateUpdateBuffer - ccUpdateCh chan *balancer.ClientConnState - done chan struct{} + cc *ClientConn + balancerMu sync.Mutex // synchronizes calls to the balancer + balancer balancer.Balancer + scBuffer *buffer.Unbounded + done *grpcsync.Event mu sync.Mutex subConns map[*acBalancerWrapper]struct{} @@ -97,11 +52,10 @@ type ccBalancerWrapper struct { func newCCBalancerWrapper(cc *ClientConn, b balancer.Builder, bopts balancer.BuildOptions) *ccBalancerWrapper { ccb := &ccBalancerWrapper{ - cc: cc, - stateChangeQueue: newSCStateUpdateBuffer(), - ccUpdateCh: make(chan *balancer.ClientConnState, 1), - done: make(chan struct{}), - subConns: make(map[*acBalancerWrapper]struct{}), + cc: cc, + scBuffer: buffer.NewUnbounded(), + done: grpcsync.NewEvent(), + subConns: make(map[*acBalancerWrapper]struct{}), } go ccb.watcher() ccb.balancer = b.Build(ccb, bopts) @@ -113,36 +67,23 @@ func newCCBalancerWrapper(cc *ClientConn, b balancer.Builder, bopts balancer.Bui func (ccb *ccBalancerWrapper) watcher() { for { select { - case t := <-ccb.stateChangeQueue.get(): - ccb.stateChangeQueue.load() - select { - case <-ccb.done: - ccb.balancer.Close() - return - default: + case t := <-ccb.scBuffer.Get(): + ccb.scBuffer.Load() + if ccb.done.HasFired() { + break } + ccb.balancerMu.Lock() + su := t.(*scStateUpdate) if ub, ok := ccb.balancer.(balancer.V2Balancer); ok { - ub.UpdateSubConnState(t.sc, balancer.SubConnState{ConnectivityState: t.state}) + ub.UpdateSubConnState(su.sc, balancer.SubConnState{ConnectivityState: su.state, ConnectionError: su.err}) } else { - ccb.balancer.HandleSubConnStateChange(t.sc, t.state) + ccb.balancer.HandleSubConnStateChange(su.sc, su.state) } - case s := <-ccb.ccUpdateCh: - select { - case <-ccb.done: - ccb.balancer.Close() - return - default: - } - if ub, ok := ccb.balancer.(balancer.V2Balancer); ok { - ub.UpdateClientConnState(*s) - } else { - ccb.balancer.HandleResolvedAddrs(s.ResolverState.Addresses, nil) - } - case <-ccb.done: + ccb.balancerMu.Unlock() + case <-ccb.done.Done(): } - select { - case <-ccb.done: + if ccb.done.HasFired() { ccb.balancer.Close() ccb.mu.Lock() scs := ccb.subConns @@ -151,19 +92,17 @@ func (ccb *ccBalancerWrapper) watcher() { for acbw := range scs { ccb.cc.removeAddrConn(acbw.getAddrConn(), errConnDrain) } - ccb.UpdateBalancerState(connectivity.Connecting, nil) + ccb.UpdateState(balancer.State{ConnectivityState: connectivity.Connecting, Picker: nil}) return - default: } - ccb.cc.firstResolveEvent.Fire() } } func (ccb *ccBalancerWrapper) close() { - close(ccb.done) + ccb.done.Fire() } -func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { +func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State, err error) { // When updating addresses for a SubConn, if the address in use is not in // the new addresses, the old ac will be tearDown() and a new ac will be // created. tearDown() generates a state change with Shutdown state, we @@ -174,30 +113,29 @@ func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s co if sc == nil { return } - ccb.stateChangeQueue.put(&scStateUpdate{ + ccb.scBuffer.Put(&scStateUpdate{ sc: sc, state: s, + err: err, }) } -func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) { - if ccb.cc.curBalancerName != grpclbName { - // Filter any grpclb addresses since we don't have the grpclb balancer. - s := &ccs.ResolverState - for i := 0; i < len(s.Addresses); { - if s.Addresses[i].Type == resolver.GRPCLB { - copy(s.Addresses[i:], s.Addresses[i+1:]) - s.Addresses = s.Addresses[:len(s.Addresses)-1] - continue - } - i++ - } +func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { + ccb.balancerMu.Lock() + defer ccb.balancerMu.Unlock() + if ub, ok := ccb.balancer.(balancer.V2Balancer); ok { + return ub.UpdateClientConnState(*ccs) } - select { - case <-ccb.ccUpdateCh: - default: + ccb.balancer.HandleResolvedAddrs(ccs.ResolverState.Addresses, nil) + return nil +} + +func (ccb *ccBalancerWrapper) resolverError(err error) { + if ub, ok := ccb.balancer.(balancer.V2Balancer); ok { + ccb.balancerMu.Lock() + ub.ResolverError(err) + ccb.balancerMu.Unlock() } - ccb.ccUpdateCh <- ccs } func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { @@ -250,7 +188,22 @@ func (ccb *ccBalancerWrapper) UpdateBalancerState(s connectivity.State, p balanc ccb.cc.csMgr.updateState(s) } -func (ccb *ccBalancerWrapper) ResolveNow(o resolver.ResolveNowOption) { +func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) { + ccb.mu.Lock() + defer ccb.mu.Unlock() + if ccb.subConns == nil { + return + } + // Update picker before updating state. Even though the ordering here does + // not matter, it can lead to multiple calls of Pick in the common start-up + // case where we wait for ready and then perform an RPC. If the picker is + // updated later, we could call the "connecting" picker when the state is + // updated, and then call the "ready" picker after the picker gets updated. + ccb.cc.blockingpicker.updatePickerV2(s.Picker) + ccb.cc.csMgr.updateState(s.ConnectivityState) +} + +func (ccb *ccBalancerWrapper) ResolveNow(o resolver.ResolveNowOptions) { ccb.cc.resolveNow(o) } diff --git a/vendor/google.golang.org/grpc/balancer_v1_wrapper.go b/vendor/google.golang.org/grpc/balancer_v1_wrapper.go index 66e9a44ac..db04b08b8 100644 --- a/vendor/google.golang.org/grpc/balancer_v1_wrapper.go +++ b/vendor/google.golang.org/grpc/balancer_v1_wrapper.go @@ -19,7 +19,6 @@ package grpc import ( - "context" "sync" "google.golang.org/grpc/balancer" @@ -49,7 +48,7 @@ func (bwb *balancerWrapperBuilder) Build(cc balancer.ClientConn, opts balancer.B csEvltr: &balancer.ConnectivityStateEvaluator{}, state: connectivity.Idle, } - cc.UpdateBalancerState(connectivity.Idle, bw) + cc.UpdateState(balancer.State{ConnectivityState: connectivity.Idle, Picker: bw}) go bw.lbWatcher() return bw } @@ -243,7 +242,7 @@ func (bw *balancerWrapper) HandleSubConnStateChange(sc balancer.SubConn, s conne if bw.state != sa { bw.state = sa } - bw.cc.UpdateBalancerState(bw.state, bw) + bw.cc.UpdateState(balancer.State{ConnectivityState: bw.state, Picker: bw}) if s == connectivity.Shutdown { // Remove state for this sc. delete(bw.connSt, sc) @@ -275,17 +274,17 @@ func (bw *balancerWrapper) Close() { // The picker is the balancerWrapper itself. // It either blocks or returns error, consistent with v1 balancer Get(). -func (bw *balancerWrapper) Pick(ctx context.Context, opts balancer.PickOptions) (sc balancer.SubConn, done func(balancer.DoneInfo), err error) { +func (bw *balancerWrapper) Pick(info balancer.PickInfo) (result balancer.PickResult, err error) { failfast := true // Default failfast is true. - if ss, ok := rpcInfoFromContext(ctx); ok { + if ss, ok := rpcInfoFromContext(info.Ctx); ok { failfast = ss.failfast } - a, p, err := bw.balancer.Get(ctx, BalancerGetOptions{BlockingWait: !failfast}) + a, p, err := bw.balancer.Get(info.Ctx, BalancerGetOptions{BlockingWait: !failfast}) if err != nil { - return nil, nil, err + return balancer.PickResult{}, toRPCErr(err) } if p != nil { - done = func(balancer.DoneInfo) { p() } + result.Done = func(balancer.DoneInfo) { p() } defer func() { if err != nil { p() @@ -297,38 +296,39 @@ func (bw *balancerWrapper) Pick(ctx context.Context, opts balancer.PickOptions) defer bw.mu.Unlock() if bw.pickfirst { // Get the first sc in conns. - for _, sc := range bw.conns { - return sc, done, nil + for _, result.SubConn = range bw.conns { + return result, nil } - return nil, nil, balancer.ErrNoSubConnAvailable + return balancer.PickResult{}, balancer.ErrNoSubConnAvailable } - sc, ok1 := bw.conns[resolver.Address{ + var ok1 bool + result.SubConn, ok1 = bw.conns[resolver.Address{ Addr: a.Addr, Type: resolver.Backend, ServerName: "", Metadata: a.Metadata, }] - s, ok2 := bw.connSt[sc] + s, ok2 := bw.connSt[result.SubConn] if !ok1 || !ok2 { // This can only happen due to a race where Get() returned an address // that was subsequently removed by Notify. In this case we should // retry always. - return nil, nil, balancer.ErrNoSubConnAvailable + return balancer.PickResult{}, balancer.ErrNoSubConnAvailable } switch s.s { case connectivity.Ready, connectivity.Idle: - return sc, done, nil + return result, nil case connectivity.Shutdown, connectivity.TransientFailure: // If the returned sc has been shut down or is in transient failure, // return error, and this RPC will fail or wait for another picker (if // non-failfast). - return nil, nil, balancer.ErrTransientFailure + return balancer.PickResult{}, balancer.ErrTransientFailure default: // For other states (connecting or unknown), the v1 balancer would // traditionally wait until ready and then issue the RPC. Returning // ErrNoSubConnAvailable will be a slight improvement in that it will // allow the balancer to choose another address in case others are // connected. - return nil, nil, balancer.ErrNoSubConnAvailable + return balancer.PickResult{}, balancer.ErrNoSubConnAvailable } } diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index a7643df7d..f58740b25 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -31,7 +31,7 @@ import ( "time" "google.golang.org/grpc/balancer" - _ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin. + "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" @@ -42,10 +42,12 @@ import ( "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/resolver" - _ "google.golang.org/grpc/resolver/dns" // To register dns resolver. - _ "google.golang.org/grpc/resolver/passthrough" // To register passthrough resolver. "google.golang.org/grpc/serviceconfig" "google.golang.org/grpc/status" + + _ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin. + _ "google.golang.org/grpc/internal/resolver/dns" // To register dns resolver. + _ "google.golang.org/grpc/internal/resolver/passthrough" // To register passthrough resolver. ) const ( @@ -186,11 +188,11 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * } if cc.dopts.defaultServiceConfigRawJSON != nil { - sc, err := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON) - if err != nil { - return nil, fmt.Errorf("%s: %v", invalidDefaultServiceConfigErrPrefix, err) + scpr := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON) + if scpr.Err != nil { + return nil, fmt.Errorf("%s: %v", invalidDefaultServiceConfigErrPrefix, scpr.Err) } - cc.dopts.defaultServiceConfig = sc + cc.dopts.defaultServiceConfig, _ = scpr.Config.(*ServiceConfig) } cc.mkp = cc.dopts.copts.KeepaliveParams @@ -235,29 +237,28 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * } } if cc.dopts.bs == nil { - cc.dopts.bs = backoff.Exponential{ - MaxDelay: DefaultBackoffConfig.MaxDelay, + cc.dopts.bs = backoff.DefaultExponential + } + + // Determine the resolver to use. + cc.parsedTarget = parseTarget(cc.target) + grpclog.Infof("parsed scheme: %q", cc.parsedTarget.Scheme) + resolverBuilder := cc.getResolver(cc.parsedTarget.Scheme) + if resolverBuilder == nil { + // If resolver builder is still nil, the parsed target's scheme is + // not registered. Fallback to default resolver and set Endpoint to + // the original target. + grpclog.Infof("scheme %q not registered, fallback to default scheme", cc.parsedTarget.Scheme) + cc.parsedTarget = resolver.Target{ + Scheme: resolver.GetDefaultScheme(), + Endpoint: target, } - } - if cc.dopts.resolverBuilder == nil { - // Only try to parse target when resolver builder is not already set. - cc.parsedTarget = parseTarget(cc.target) - grpclog.Infof("parsed scheme: %q", cc.parsedTarget.Scheme) - cc.dopts.resolverBuilder = resolver.Get(cc.parsedTarget.Scheme) - if cc.dopts.resolverBuilder == nil { - // If resolver builder is still nil, the parsed target's scheme is - // not registered. Fallback to default resolver and set Endpoint to - // the original target. - grpclog.Infof("scheme %q not registered, fallback to default scheme", cc.parsedTarget.Scheme) - cc.parsedTarget = resolver.Target{ - Scheme: resolver.GetDefaultScheme(), - Endpoint: target, - } - cc.dopts.resolverBuilder = resolver.Get(cc.parsedTarget.Scheme) + resolverBuilder = cc.getResolver(cc.parsedTarget.Scheme) + if resolverBuilder == nil { + return nil, fmt.Errorf("could not get resolver for default scheme: %q", cc.parsedTarget.Scheme) } - } else { - cc.parsedTarget = resolver.Target{Endpoint: target} } + creds := cc.dopts.copts.TransportCredentials if creds != nil && creds.Info().ServerName != "" { cc.authority = creds.Info().ServerName @@ -297,14 +298,14 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * } // Build the resolver. - rWrapper, err := newCCResolverWrapper(cc) + rWrapper, err := newCCResolverWrapper(cc, resolverBuilder) if err != nil { return nil, fmt.Errorf("failed to build resolver: %v", err) } - cc.mu.Lock() cc.resolverWrapper = rWrapper cc.mu.Unlock() + // A blocking dial blocks until the clientConn is ready. if cc.dopts.block { for { @@ -443,7 +444,32 @@ func (csm *connectivityStateManager) getNotifyChan() <-chan struct{} { return csm.notifyChan } -// ClientConn represents a client connection to an RPC server. +// ClientConnInterface defines the functions clients need to perform unary and +// streaming RPCs. It is implemented by *ClientConn, and is only intended to +// be referenced by generated code. +type ClientConnInterface interface { + // Invoke performs a unary RPC and returns after the response is received + // into reply. + Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...CallOption) error + // NewStream begins a streaming RPC. + NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) +} + +// Assert *ClientConn implements ClientConnInterface. +var _ ClientConnInterface = (*ClientConn)(nil) + +// ClientConn represents a virtual connection to a conceptual endpoint, to +// perform RPCs. +// +// A ClientConn is free to have zero or more actual connections to the endpoint +// based on configuration, load, etc. It is also free to determine which actual +// endpoints to use and may change it every RPC, permitting client-side load +// balancing. +// +// A ClientConn encapsulates a range of functionality including name +// resolution, TCP connection establishment (with retries and backoff) and TLS +// handshakes. It also handles errors on established connections by +// re-resolving the name and reconnecting. type ClientConn struct { ctx context.Context cancel context.CancelFunc @@ -532,58 +558,104 @@ func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) error { } } -func (cc *ClientConn) updateResolverState(s resolver.State) error { +var emptyServiceConfig *ServiceConfig + +func init() { + cfg := parseServiceConfig("{}") + if cfg.Err != nil { + panic(fmt.Sprintf("impossible error parsing empty service config: %v", cfg.Err)) + } + emptyServiceConfig = cfg.Config.(*ServiceConfig) +} + +func (cc *ClientConn) maybeApplyDefaultServiceConfig(addrs []resolver.Address) { + if cc.sc != nil { + cc.applyServiceConfigAndBalancer(cc.sc, addrs) + return + } + if cc.dopts.defaultServiceConfig != nil { + cc.applyServiceConfigAndBalancer(cc.dopts.defaultServiceConfig, addrs) + } else { + cc.applyServiceConfigAndBalancer(emptyServiceConfig, addrs) + } +} + +func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { + defer cc.firstResolveEvent.Fire() cc.mu.Lock() - defer cc.mu.Unlock() // Check if the ClientConn is already closed. Some fields (e.g. // balancerWrapper) are set to nil when closing the ClientConn, and could // cause nil pointer panic if we don't have this check. if cc.conns == nil { + cc.mu.Unlock() return nil } - if cc.dopts.disableServiceConfig || s.ServiceConfig == nil { - if cc.dopts.defaultServiceConfig != nil && cc.sc == nil { - cc.applyServiceConfig(cc.dopts.defaultServiceConfig) + if err != nil { + // May need to apply the initial service config in case the resolver + // doesn't support service configs, or doesn't provide a service config + // with the new addresses. + cc.maybeApplyDefaultServiceConfig(nil) + + if cc.balancerWrapper != nil { + cc.balancerWrapper.resolverError(err) } - } else if sc, ok := s.ServiceConfig.(*ServiceConfig); ok { - cc.applyServiceConfig(sc) + + // No addresses are valid with err set; return early. + cc.mu.Unlock() + return balancer.ErrBadResolverState } - var balCfg serviceconfig.LoadBalancingConfig - if cc.dopts.balancerBuilder == nil { - // Only look at balancer types and switch balancer if balancer dial - // option is not set. - var newBalancerName string - if cc.sc != nil && cc.sc.lbConfig != nil { - newBalancerName = cc.sc.lbConfig.name - balCfg = cc.sc.lbConfig.cfg + var ret error + if cc.dopts.disableServiceConfig || s.ServiceConfig == nil { + cc.maybeApplyDefaultServiceConfig(s.Addresses) + // TODO: do we need to apply a failing LB policy if there is no + // default, per the error handling design? + } else { + if sc, ok := s.ServiceConfig.Config.(*ServiceConfig); s.ServiceConfig.Err == nil && ok { + cc.applyServiceConfigAndBalancer(sc, s.Addresses) } else { - var isGRPCLB bool - for _, a := range s.Addresses { - if a.Type == resolver.GRPCLB { - isGRPCLB = true - break + ret = balancer.ErrBadResolverState + if cc.balancerWrapper == nil { + var err error + if s.ServiceConfig.Err != nil { + err = status.Errorf(codes.Unavailable, "error parsing service config: %v", s.ServiceConfig.Err) + } else { + err = status.Errorf(codes.Unavailable, "illegal service config type: %T", s.ServiceConfig.Config) } - } - if isGRPCLB { - newBalancerName = grpclbName - } else if cc.sc != nil && cc.sc.LB != nil { - newBalancerName = *cc.sc.LB - } else { - newBalancerName = PickFirstBalancerName + cc.blockingpicker.updatePicker(base.NewErrPicker(err)) + cc.csMgr.updateState(connectivity.TransientFailure) + cc.mu.Unlock() + return ret } } - cc.switchBalancer(newBalancerName) - } else if cc.balancerWrapper == nil { - // Balancer dial option was set, and this is the first time handling - // resolved addresses. Build a balancer with dopts.balancerBuilder. - cc.curBalancerName = cc.dopts.balancerBuilder.Name() - cc.balancerWrapper = newCCBalancerWrapper(cc, cc.dopts.balancerBuilder, cc.balancerBuildOpts) } - cc.balancerWrapper.updateClientConnState(&balancer.ClientConnState{ResolverState: s, BalancerConfig: balCfg}) - return nil + var balCfg serviceconfig.LoadBalancingConfig + if cc.dopts.balancerBuilder == nil && cc.sc != nil && cc.sc.lbConfig != nil { + balCfg = cc.sc.lbConfig.cfg + } + + cbn := cc.curBalancerName + bw := cc.balancerWrapper + cc.mu.Unlock() + if cbn != grpclbName { + // Filter any grpclb addresses since we don't have the grpclb balancer. + for i := 0; i < len(s.Addresses); { + if s.Addresses[i].Type == resolver.GRPCLB { + copy(s.Addresses[i:], s.Addresses[i+1:]) + s.Addresses = s.Addresses[:len(s.Addresses)-1] + continue + } + i++ + } + } + uccsErr := bw.updateClientConnState(&balancer.ClientConnState{ResolverState: s, BalancerConfig: balCfg}) + if ret == nil { + ret = uccsErr // prefer ErrBadResolver state since any other error is + // currently meaningless to the caller. + } + return ret } // switchBalancer starts the switching from current balancer to the balancer @@ -631,7 +703,7 @@ func (cc *ClientConn) switchBalancer(name string) { cc.balancerWrapper = newCCBalancerWrapper(cc, builder, cc.balancerBuildOpts) } -func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { +func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State, err error) { cc.mu.Lock() if cc.conns == nil { cc.mu.Unlock() @@ -639,7 +711,7 @@ func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivi } // TODO(bar switching) send updates to all balancer wrappers when balancer // gracefully switching is supported. - cc.balancerWrapper.handleSubConnStateChange(sc, s) + cc.balancerWrapper.handleSubConnStateChange(sc, s, err) cc.mu.Unlock() } @@ -736,7 +808,7 @@ func (ac *addrConn) connect() error { } // Update connectivity state within the lock to prevent subsequent or // concurrent calls from resetting the transport more than once. - ac.updateConnectivityState(connectivity.Connecting) + ac.updateConnectivityState(connectivity.Connecting, nil) ac.mu.Unlock() // Start a goroutine connecting to the server asynchronously. @@ -822,7 +894,8 @@ func (cc *ClientConn) healthCheckConfig() *healthCheckConfig { } func (cc *ClientConn) getTransport(ctx context.Context, failfast bool, method string) (transport.ClientTransport, func(balancer.DoneInfo), error) { - t, done, err := cc.blockingpicker.pick(ctx, failfast, balancer.PickOptions{ + t, done, err := cc.blockingpicker.pick(ctx, failfast, balancer.PickInfo{ + Ctx: ctx, FullMethodName: method, }) if err != nil { @@ -831,10 +904,10 @@ func (cc *ClientConn) getTransport(ctx context.Context, failfast bool, method st return t, done, nil } -func (cc *ClientConn) applyServiceConfig(sc *ServiceConfig) error { +func (cc *ClientConn) applyServiceConfigAndBalancer(sc *ServiceConfig, addrs []resolver.Address) { if sc == nil { // should never reach here. - return fmt.Errorf("got nil pointer for service config") + return } cc.sc = sc @@ -850,10 +923,38 @@ func (cc *ClientConn) applyServiceConfig(sc *ServiceConfig) error { cc.retryThrottler.Store((*retryThrottler)(nil)) } - return nil + if cc.dopts.balancerBuilder == nil { + // Only look at balancer types and switch balancer if balancer dial + // option is not set. + var newBalancerName string + if cc.sc != nil && cc.sc.lbConfig != nil { + newBalancerName = cc.sc.lbConfig.name + } else { + var isGRPCLB bool + for _, a := range addrs { + if a.Type == resolver.GRPCLB { + isGRPCLB = true + break + } + } + if isGRPCLB { + newBalancerName = grpclbName + } else if cc.sc != nil && cc.sc.LB != nil { + newBalancerName = *cc.sc.LB + } else { + newBalancerName = PickFirstBalancerName + } + } + cc.switchBalancer(newBalancerName) + } else if cc.balancerWrapper == nil { + // Balancer dial option was set, and this is the first time handling + // resolved addresses. Build a balancer with dopts.balancerBuilder. + cc.curBalancerName = cc.dopts.balancerBuilder.Name() + cc.balancerWrapper = newCCBalancerWrapper(cc, cc.dopts.balancerBuilder, cc.balancerBuildOpts) + } } -func (cc *ClientConn) resolveNow(o resolver.ResolveNowOption) { +func (cc *ClientConn) resolveNow(o resolver.ResolveNowOptions) { cc.mu.RLock() r := cc.resolverWrapper cc.mu.RUnlock() @@ -875,8 +976,9 @@ func (cc *ClientConn) resolveNow(o resolver.ResolveNowOption) { // This API is EXPERIMENTAL. func (cc *ClientConn) ResetConnectBackoff() { cc.mu.Lock() - defer cc.mu.Unlock() - for ac := range cc.conns { + conns := cc.conns + cc.mu.Unlock() + for ac := range conns { ac.resetConnectBackoff() } } @@ -962,7 +1064,7 @@ type addrConn struct { } // Note: this requires a lock on ac.mu. -func (ac *addrConn) updateConnectivityState(s connectivity.State) { +func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) { if ac.state == s { return } @@ -975,7 +1077,7 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State) { Severity: channelz.CtINFO, }) } - ac.cc.handleSubConnStateChange(ac.acbw, s) + ac.cc.handleSubConnStateChange(ac.acbw, s, lastErr) } // adjustParams updates parameters used to create transports upon @@ -995,7 +1097,7 @@ func (ac *addrConn) adjustParams(r transport.GoAwayReason) { func (ac *addrConn) resetTransport() { for i := 0; ; i++ { if i > 0 { - ac.cc.resolveNow(resolver.ResolveNowOption{}) + ac.cc.resolveNow(resolver.ResolveNowOptions{}) } ac.mu.Lock() @@ -1024,7 +1126,7 @@ func (ac *addrConn) resetTransport() { // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md#proposed-backoff-algorithm connectDeadline := time.Now().Add(dialDuration) - ac.updateConnectivityState(connectivity.Connecting) + ac.updateConnectivityState(connectivity.Connecting, nil) ac.transport = nil ac.mu.Unlock() @@ -1037,7 +1139,7 @@ func (ac *addrConn) resetTransport() { ac.mu.Unlock() return } - ac.updateConnectivityState(connectivity.TransientFailure) + ac.updateConnectivityState(connectivity.TransientFailure, err) // Backoff. b := ac.resetBackoff @@ -1093,6 +1195,7 @@ func (ac *addrConn) resetTransport() { // first successful one. It returns the transport, the address and a Event in // the successful case. The Event fires when the returned transport disconnects. func (ac *addrConn) tryAllAddrs(addrs []resolver.Address, connectDeadline time.Time) (transport.ClientTransport, resolver.Address, *grpcsync.Event, error) { + var firstConnErr error for _, addr := range addrs { ac.mu.Lock() if ac.state == connectivity.Shutdown { @@ -1121,11 +1224,14 @@ func (ac *addrConn) tryAllAddrs(addrs []resolver.Address, connectDeadline time.T if err == nil { return newTr, addr, reconnect, nil } + if firstConnErr == nil { + firstConnErr = err + } ac.cc.blockingpicker.updateConnectionError(err) } // Couldn't connect to any address. - return nil, resolver.Address{}, nil, fmt.Errorf("couldn't connect to any address") + return nil, resolver.Address{}, nil, firstConnErr } // createTransport creates a connection to addr. It returns the transport and a @@ -1136,10 +1242,16 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne onCloseCalled := make(chan struct{}) reconnect := grpcsync.NewEvent() + authority := ac.cc.authority + // addr.ServerName takes precedent over ClientConn authority, if present. + if addr.ServerName != "" { + authority = addr.ServerName + } + target := transport.TargetInfo{ Addr: addr.Addr, Metadata: addr.Metadata, - Authority: ac.cc.authority, + Authority: authority, } once := sync.Once{} @@ -1152,7 +1264,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne // state to Connecting. // // TODO: this should be Idle when grpc-go properly supports it. - ac.updateConnectivityState(connectivity.Connecting) + ac.updateConnectivityState(connectivity.Connecting, nil) } }) ac.mu.Unlock() @@ -1167,7 +1279,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne // state to Connecting. // // TODO: this should be Idle when grpc-go properly supports it. - ac.updateConnectivityState(connectivity.Connecting) + ac.updateConnectivityState(connectivity.Connecting, nil) } }) ac.mu.Unlock() @@ -1193,7 +1305,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne } select { - case <-time.After(connectDeadline.Sub(time.Now())): + case <-time.After(time.Until(connectDeadline)): // We didn't get the preface in time. newTr.Close() grpclog.Warningf("grpc: addrConn.createTransport failed to connect to %v: didn't receive server preface in time. Reconnecting...", addr) @@ -1224,7 +1336,7 @@ func (ac *addrConn) startHealthCheck(ctx context.Context) { var healthcheckManagingState bool defer func() { if !healthcheckManagingState { - ac.updateConnectivityState(connectivity.Ready) + ac.updateConnectivityState(connectivity.Ready, nil) } }() @@ -1260,13 +1372,13 @@ func (ac *addrConn) startHealthCheck(ctx context.Context) { ac.mu.Unlock() return newNonRetryClientStream(ctx, &StreamDesc{ServerStreams: true}, method, currentTr, ac) } - setConnectivityState := func(s connectivity.State) { + setConnectivityState := func(s connectivity.State, lastErr error) { ac.mu.Lock() defer ac.mu.Unlock() if ac.transport != currentTr { return } - ac.updateConnectivityState(s) + ac.updateConnectivityState(s, lastErr) } // Start the health checking stream. go func() { @@ -1331,8 +1443,8 @@ func (ac *addrConn) tearDown(err error) { curTr := ac.transport ac.transport = nil // We have to set the state to Shutdown before anything else to prevent races - // between setting the state and logic that waits on context cancelation / etc. - ac.updateConnectivityState(connectivity.Shutdown) + // between setting the state and logic that waits on context cancellation / etc. + ac.updateConnectivityState(connectivity.Shutdown, nil) ac.cancel() ac.curAddr = resolver.Address{} if err == errConnDrain && curTr != nil { @@ -1355,7 +1467,7 @@ func (ac *addrConn) tearDown(err error) { }, }) // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add trace reference to - // the entity beng deleted, and thus prevent it from being deleted right away. + // the entity being deleted, and thus prevent it from being deleted right away. channelz.RemoveEntry(ac.channelzID) } ac.mu.Unlock() @@ -1445,3 +1557,12 @@ func (c *channelzChannel) ChannelzMetric() *channelz.ChannelInternalMetric { // Deprecated: This error is never returned by grpc and should not be // referenced by users. var ErrClientConnTimeout = errors.New("grpc: timed out when dialing") + +func (cc *ClientConn) getResolver(scheme string) resolver.Builder { + for _, rb := range cc.dopts.resolvers { + if cc.parsedTarget.Scheme == rb.Scheme() { + return rb + } + } + return resolver.Get(cc.parsedTarget.Scheme) +} diff --git a/vendor/google.golang.org/grpc/credentials/credentials.go b/vendor/google.golang.org/grpc/credentials/credentials.go index 8ea3d4a1d..845ce5d21 100644 --- a/vendor/google.golang.org/grpc/credentials/credentials.go +++ b/vendor/google.golang.org/grpc/credentials/credentials.go @@ -24,16 +24,12 @@ package credentials // import "google.golang.org/grpc/credentials" import ( "context" - "crypto/tls" - "crypto/x509" "errors" "fmt" - "io/ioutil" "net" - "strings" "github.com/golang/protobuf/proto" - "google.golang.org/grpc/credentials/internal" + "google.golang.org/grpc/internal" ) // PerRPCCredentials defines the common interface for the credentials which need to @@ -45,7 +41,8 @@ type PerRPCCredentials interface { // context. If a status code is returned, it will be used as the status // for the RPC. uri is the URI of the entry point for the request. // When supported by the underlying implementation, ctx can be used for - // timeout and cancellation. + // timeout and cancellation. Additionally, RequestInfo data will be + // available via ctx to this call. // TODO(zhaoq): Define the set of the qualified keys instead of leaving // it as an arbitrary string. GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) @@ -54,6 +51,48 @@ type PerRPCCredentials interface { RequireTransportSecurity() bool } +// SecurityLevel defines the protection level on an established connection. +// +// This API is experimental. +type SecurityLevel int + +const ( + // NoSecurity indicates a connection is insecure. + // The zero SecurityLevel value is invalid for backward compatibility. + NoSecurity SecurityLevel = iota + 1 + // IntegrityOnly indicates a connection only provides integrity protection. + IntegrityOnly + // PrivacyAndIntegrity indicates a connection provides both privacy and integrity protection. + PrivacyAndIntegrity +) + +// String returns SecurityLevel in a string format. +func (s SecurityLevel) String() string { + switch s { + case NoSecurity: + return "NoSecurity" + case IntegrityOnly: + return "IntegrityOnly" + case PrivacyAndIntegrity: + return "PrivacyAndIntegrity" + } + return fmt.Sprintf("invalid SecurityLevel: %v", int(s)) +} + +// CommonAuthInfo contains authenticated information common to AuthInfo implementations. +// It should be embedded in a struct implementing AuthInfo to provide additional information +// about the credentials. +// +// This API is experimental. +type CommonAuthInfo struct { + SecurityLevel SecurityLevel +} + +// GetCommonAuthInfo returns the pointer to CommonAuthInfo struct. +func (c *CommonAuthInfo) GetCommonAuthInfo() *CommonAuthInfo { + return c +} + // ProtocolInfo provides information regarding the gRPC wire protocol version, // security protocol, security protocol version in use, server name, etc. type ProtocolInfo struct { @@ -68,6 +107,8 @@ type ProtocolInfo struct { } // AuthInfo defines the common interface for the auth information the users are interested in. +// A struct that implements AuthInfo should embed CommonAuthInfo by including additional +// information about the credentials in it. type AuthInfo interface { AuthType() string } @@ -82,7 +123,8 @@ type TransportCredentials interface { // ClientHandshake does the authentication handshake specified by the corresponding // authentication protocol on rawConn for clients. It returns the authenticated // connection and the corresponding auth information about the connection. - // Implementations must use the provided context to implement timely cancellation. + // The auth information should embed CommonAuthInfo to return additional information about + // the credentials. Implementations must use the provided context to implement timely cancellation. // gRPC will try to reconnect if the error returned is a temporary error // (io.EOF, context.DeadlineExceeded or err.Temporary() == true). // If the returned error is a wrapper error, implementations should make sure that @@ -92,7 +134,8 @@ type TransportCredentials interface { ClientHandshake(context.Context, string, net.Conn) (net.Conn, AuthInfo, error) // ServerHandshake does the authentication handshake for servers. It returns // the authenticated connection and the corresponding auth information about - // the connection. + // the connection. The auth information should embed CommonAuthInfo to return additional information + // about the credentials. // // If the returned net.Conn is closed, it MUST close the net.Conn provided. ServerHandshake(net.Conn) (net.Conn, AuthInfo, error) @@ -125,145 +168,63 @@ type Bundle interface { NewWithMode(mode string) (Bundle, error) } -// TLSInfo contains the auth information for a TLS authenticated connection. -// It implements the AuthInfo interface. -type TLSInfo struct { - State tls.ConnectionState -} - -// AuthType returns the type of TLSInfo as a string. -func (t TLSInfo) AuthType() string { - return "tls" +// RequestInfo contains request data attached to the context passed to GetRequestMetadata calls. +// +// This API is experimental. +type RequestInfo struct { + // The method passed to Invoke or NewStream for this RPC. (For proto methods, this has the format "/some.Service/Method") + Method string + // AuthInfo contains the information from a security handshake (TransportCredentials.ClientHandshake, TransportCredentials.ServerHandshake) + AuthInfo AuthInfo } -// GetSecurityValue returns security info requested by channelz. -func (t TLSInfo) GetSecurityValue() ChannelzSecurityValue { - v := &TLSChannelzSecurityValue{ - StandardName: cipherSuiteLookup[t.State.CipherSuite], - } - // Currently there's no way to get LocalCertificate info from tls package. - if len(t.State.PeerCertificates) > 0 { - v.RemoteCertificate = t.State.PeerCertificates[0].Raw - } - return v -} +// requestInfoKey is a struct to be used as the key when attaching a RequestInfo to a context object. +type requestInfoKey struct{} -// tlsCreds is the credentials required for authenticating a connection using TLS. -type tlsCreds struct { - // TLS configuration - config *tls.Config +// RequestInfoFromContext extracts the RequestInfo from the context if it exists. +// +// This API is experimental. +func RequestInfoFromContext(ctx context.Context) (ri RequestInfo, ok bool) { + ri, ok = ctx.Value(requestInfoKey{}).(RequestInfo) + return } -func (c tlsCreds) Info() ProtocolInfo { - return ProtocolInfo{ - SecurityProtocol: "tls", - SecurityVersion: "1.2", - ServerName: c.config.ServerName, +// CheckSecurityLevel checks if a connection's security level is greater than or equal to the specified one. +// It returns success if 1) the condition is satisified or 2) AuthInfo struct does not implement GetCommonAuthInfo() method +// or 3) CommonAuthInfo.SecurityLevel has an invalid zero value. For 2) and 3), it is for the purpose of backward-compatibility. +// +// This API is experimental. +func CheckSecurityLevel(ctx context.Context, level SecurityLevel) error { + type internalInfo interface { + GetCommonAuthInfo() *CommonAuthInfo } -} - -func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (_ net.Conn, _ AuthInfo, err error) { - // use local cfg to avoid clobbering ServerName if using multiple endpoints - cfg := cloneTLSConfig(c.config) - if cfg.ServerName == "" { - colonPos := strings.LastIndex(authority, ":") - if colonPos == -1 { - colonPos = len(authority) - } - cfg.ServerName = authority[:colonPos] + ri, _ := RequestInfoFromContext(ctx) + if ri.AuthInfo == nil { + return errors.New("unable to obtain SecurityLevel from context") } - conn := tls.Client(rawConn, cfg) - errChannel := make(chan error, 1) - go func() { - errChannel <- conn.Handshake() - }() - select { - case err := <-errChannel: - if err != nil { - return nil, nil, err + if ci, ok := ri.AuthInfo.(internalInfo); ok { + // CommonAuthInfo.SecurityLevel has an invalid value. + if ci.GetCommonAuthInfo().SecurityLevel == 0 { + return nil } - case <-ctx.Done(): - return nil, nil, ctx.Err() - } - return internal.WrapSyscallConn(rawConn, conn), TLSInfo{conn.ConnectionState()}, nil -} - -func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) { - conn := tls.Server(rawConn, c.config) - if err := conn.Handshake(); err != nil { - return nil, nil, err - } - return internal.WrapSyscallConn(rawConn, conn), TLSInfo{conn.ConnectionState()}, nil -} - -func (c *tlsCreds) Clone() TransportCredentials { - return NewTLS(c.config) -} - -func (c *tlsCreds) OverrideServerName(serverNameOverride string) error { - c.config.ServerName = serverNameOverride - return nil -} - -const alpnProtoStrH2 = "h2" - -func appendH2ToNextProtos(ps []string) []string { - for _, p := range ps { - if p == alpnProtoStrH2 { - return ps + if ci.GetCommonAuthInfo().SecurityLevel < level { + return fmt.Errorf("requires SecurityLevel %v; connection has %v", level, ci.GetCommonAuthInfo().SecurityLevel) } } - ret := make([]string, 0, len(ps)+1) - ret = append(ret, ps...) - return append(ret, alpnProtoStrH2) -} - -// NewTLS uses c to construct a TransportCredentials based on TLS. -func NewTLS(c *tls.Config) TransportCredentials { - tc := &tlsCreds{cloneTLSConfig(c)} - tc.config.NextProtos = appendH2ToNextProtos(tc.config.NextProtos) - return tc -} - -// NewClientTLSFromCert constructs TLS credentials from the input certificate for client. -// serverNameOverride is for testing only. If set to a non empty string, -// it will override the virtual host name of authority (e.g. :authority header field) in requests. -func NewClientTLSFromCert(cp *x509.CertPool, serverNameOverride string) TransportCredentials { - return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}) -} - -// NewClientTLSFromFile constructs TLS credentials from the input certificate file for client. -// serverNameOverride is for testing only. If set to a non empty string, -// it will override the virtual host name of authority (e.g. :authority header field) in requests. -func NewClientTLSFromFile(certFile, serverNameOverride string) (TransportCredentials, error) { - b, err := ioutil.ReadFile(certFile) - if err != nil { - return nil, err - } - cp := x509.NewCertPool() - if !cp.AppendCertsFromPEM(b) { - return nil, fmt.Errorf("credentials: failed to append certificates") - } - return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}), nil -} - -// NewServerTLSFromCert constructs TLS credentials from the input certificate for server. -func NewServerTLSFromCert(cert *tls.Certificate) TransportCredentials { - return NewTLS(&tls.Config{Certificates: []tls.Certificate{*cert}}) + // The condition is satisfied or AuthInfo struct does not implement GetCommonAuthInfo() method. + return nil } -// NewServerTLSFromFile constructs TLS credentials from the input certificate file and key -// file for server. -func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error) { - cert, err := tls.LoadX509KeyPair(certFile, keyFile) - if err != nil { - return nil, err +func init() { + internal.NewRequestInfoContext = func(ctx context.Context, ri RequestInfo) context.Context { + return context.WithValue(ctx, requestInfoKey{}, ri) } - return NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}), nil } // ChannelzSecurityInfo defines the interface that security protocols should implement // in order to provide security info to channelz. +// +// This API is experimental. type ChannelzSecurityInfo interface { GetSecurityValue() ChannelzSecurityValue } @@ -271,66 +232,20 @@ type ChannelzSecurityInfo interface { // ChannelzSecurityValue defines the interface that GetSecurityValue() return value // should satisfy. This interface should only be satisfied by *TLSChannelzSecurityValue // and *OtherChannelzSecurityValue. +// +// This API is experimental. type ChannelzSecurityValue interface { isChannelzSecurityValue() } -// TLSChannelzSecurityValue defines the struct that TLS protocol should return -// from GetSecurityValue(), containing security info like cipher and certificate used. -type TLSChannelzSecurityValue struct { - ChannelzSecurityValue - StandardName string - LocalCertificate []byte - RemoteCertificate []byte -} - // OtherChannelzSecurityValue defines the struct that non-TLS protocol should return // from GetSecurityValue(), which contains protocol specific security info. Note // the Value field will be sent to users of channelz requesting channel info, and // thus sensitive info should better be avoided. +// +// This API is experimental. type OtherChannelzSecurityValue struct { ChannelzSecurityValue Name string Value proto.Message } - -var cipherSuiteLookup = map[uint16]string{ - tls.TLS_RSA_WITH_RC4_128_SHA: "TLS_RSA_WITH_RC4_128_SHA", - tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_RSA_WITH_3DES_EDE_CBC_SHA", - tls.TLS_RSA_WITH_AES_128_CBC_SHA: "TLS_RSA_WITH_AES_128_CBC_SHA", - tls.TLS_RSA_WITH_AES_256_CBC_SHA: "TLS_RSA_WITH_AES_256_CBC_SHA", - tls.TLS_RSA_WITH_AES_128_GCM_SHA256: "TLS_RSA_WITH_AES_128_GCM_SHA256", - tls.TLS_RSA_WITH_AES_256_GCM_SHA384: "TLS_RSA_WITH_AES_256_GCM_SHA384", - tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA: "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - tls.TLS_FALLBACK_SCSV: "TLS_FALLBACK_SCSV", - tls.TLS_RSA_WITH_AES_128_CBC_SHA256: "TLS_RSA_WITH_AES_128_CBC_SHA256", - tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", -} - -// cloneTLSConfig returns a shallow clone of the exported -// fields of cfg, ignoring the unexported sync.Once, which -// contains a mutex and must not be copied. -// -// If cfg is nil, a new zero tls.Config is returned. -// -// TODO: inline this function if possible. -func cloneTLSConfig(cfg *tls.Config) *tls.Config { - if cfg == nil { - return &tls.Config{} - } - - return cfg.Clone() -} diff --git a/vendor/google.golang.org/grpc/credentials/tls13.go b/vendor/google.golang.org/grpc/credentials/go12.go similarity index 100% rename from vendor/google.golang.org/grpc/credentials/tls13.go rename to vendor/google.golang.org/grpc/credentials/go12.go diff --git a/vendor/google.golang.org/grpc/credentials/tls.go b/vendor/google.golang.org/grpc/credentials/tls.go new file mode 100644 index 000000000..28b4f6232 --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/tls.go @@ -0,0 +1,225 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package credentials + +import ( + "context" + "crypto/tls" + "crypto/x509" + "fmt" + "io/ioutil" + "net" + + "google.golang.org/grpc/credentials/internal" +) + +// TLSInfo contains the auth information for a TLS authenticated connection. +// It implements the AuthInfo interface. +type TLSInfo struct { + State tls.ConnectionState + CommonAuthInfo +} + +// AuthType returns the type of TLSInfo as a string. +func (t TLSInfo) AuthType() string { + return "tls" +} + +// GetSecurityValue returns security info requested by channelz. +func (t TLSInfo) GetSecurityValue() ChannelzSecurityValue { + v := &TLSChannelzSecurityValue{ + StandardName: cipherSuiteLookup[t.State.CipherSuite], + } + // Currently there's no way to get LocalCertificate info from tls package. + if len(t.State.PeerCertificates) > 0 { + v.RemoteCertificate = t.State.PeerCertificates[0].Raw + } + return v +} + +// tlsCreds is the credentials required for authenticating a connection using TLS. +type tlsCreds struct { + // TLS configuration + config *tls.Config +} + +func (c tlsCreds) Info() ProtocolInfo { + return ProtocolInfo{ + SecurityProtocol: "tls", + SecurityVersion: "1.2", + ServerName: c.config.ServerName, + } +} + +func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (_ net.Conn, _ AuthInfo, err error) { + // use local cfg to avoid clobbering ServerName if using multiple endpoints + cfg := cloneTLSConfig(c.config) + if cfg.ServerName == "" { + serverName, _, err := net.SplitHostPort(authority) + if err != nil { + // If the authority had no host port or if the authority cannot be parsed, use it as-is. + serverName = authority + } + cfg.ServerName = serverName + } + conn := tls.Client(rawConn, cfg) + errChannel := make(chan error, 1) + go func() { + errChannel <- conn.Handshake() + close(errChannel) + }() + select { + case err := <-errChannel: + if err != nil { + conn.Close() + return nil, nil, err + } + case <-ctx.Done(): + conn.Close() + return nil, nil, ctx.Err() + } + return internal.WrapSyscallConn(rawConn, conn), TLSInfo{conn.ConnectionState(), CommonAuthInfo{PrivacyAndIntegrity}}, nil +} + +func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) { + conn := tls.Server(rawConn, c.config) + if err := conn.Handshake(); err != nil { + conn.Close() + return nil, nil, err + } + return internal.WrapSyscallConn(rawConn, conn), TLSInfo{conn.ConnectionState(), CommonAuthInfo{PrivacyAndIntegrity}}, nil +} + +func (c *tlsCreds) Clone() TransportCredentials { + return NewTLS(c.config) +} + +func (c *tlsCreds) OverrideServerName(serverNameOverride string) error { + c.config.ServerName = serverNameOverride + return nil +} + +const alpnProtoStrH2 = "h2" + +func appendH2ToNextProtos(ps []string) []string { + for _, p := range ps { + if p == alpnProtoStrH2 { + return ps + } + } + ret := make([]string, 0, len(ps)+1) + ret = append(ret, ps...) + return append(ret, alpnProtoStrH2) +} + +// NewTLS uses c to construct a TransportCredentials based on TLS. +func NewTLS(c *tls.Config) TransportCredentials { + tc := &tlsCreds{cloneTLSConfig(c)} + tc.config.NextProtos = appendH2ToNextProtos(tc.config.NextProtos) + return tc +} + +// NewClientTLSFromCert constructs TLS credentials from the input certificate for client. +// serverNameOverride is for testing only. If set to a non empty string, +// it will override the virtual host name of authority (e.g. :authority header field) in requests. +func NewClientTLSFromCert(cp *x509.CertPool, serverNameOverride string) TransportCredentials { + return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}) +} + +// NewClientTLSFromFile constructs TLS credentials from the input certificate file for client. +// serverNameOverride is for testing only. If set to a non empty string, +// it will override the virtual host name of authority (e.g. :authority header field) in requests. +func NewClientTLSFromFile(certFile, serverNameOverride string) (TransportCredentials, error) { + b, err := ioutil.ReadFile(certFile) + if err != nil { + return nil, err + } + cp := x509.NewCertPool() + if !cp.AppendCertsFromPEM(b) { + return nil, fmt.Errorf("credentials: failed to append certificates") + } + return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}), nil +} + +// NewServerTLSFromCert constructs TLS credentials from the input certificate for server. +func NewServerTLSFromCert(cert *tls.Certificate) TransportCredentials { + return NewTLS(&tls.Config{Certificates: []tls.Certificate{*cert}}) +} + +// NewServerTLSFromFile constructs TLS credentials from the input certificate file and key +// file for server. +func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error) { + cert, err := tls.LoadX509KeyPair(certFile, keyFile) + if err != nil { + return nil, err + } + return NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}), nil +} + +// TLSChannelzSecurityValue defines the struct that TLS protocol should return +// from GetSecurityValue(), containing security info like cipher and certificate used. +// +// This API is EXPERIMENTAL. +type TLSChannelzSecurityValue struct { + ChannelzSecurityValue + StandardName string + LocalCertificate []byte + RemoteCertificate []byte +} + +var cipherSuiteLookup = map[uint16]string{ + tls.TLS_RSA_WITH_RC4_128_SHA: "TLS_RSA_WITH_RC4_128_SHA", + tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + tls.TLS_RSA_WITH_AES_128_CBC_SHA: "TLS_RSA_WITH_AES_128_CBC_SHA", + tls.TLS_RSA_WITH_AES_256_CBC_SHA: "TLS_RSA_WITH_AES_256_CBC_SHA", + tls.TLS_RSA_WITH_AES_128_GCM_SHA256: "TLS_RSA_WITH_AES_128_GCM_SHA256", + tls.TLS_RSA_WITH_AES_256_GCM_SHA384: "TLS_RSA_WITH_AES_256_GCM_SHA384", + tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA: "TLS_ECDHE_RSA_WITH_RC4_128_SHA", + tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", + tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + tls.TLS_FALLBACK_SCSV: "TLS_FALLBACK_SCSV", + tls.TLS_RSA_WITH_AES_128_CBC_SHA256: "TLS_RSA_WITH_AES_128_CBC_SHA256", + tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", +} + +// cloneTLSConfig returns a shallow clone of the exported +// fields of cfg, ignoring the unexported sync.Once, which +// contains a mutex and must not be copied. +// +// If cfg is nil, a new zero tls.Config is returned. +// +// TODO: inline this function if possible. +func cloneTLSConfig(cfg *tls.Config) *tls.Config { + if cfg == nil { + return &tls.Config{} + } + + return cfg.Clone() +} diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index e8f34d0d6..63f5ae21d 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -24,11 +24,12 @@ import ( "net" "time" + "google.golang.org/grpc/backoff" "google.golang.org/grpc/balancer" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" - "google.golang.org/grpc/internal/backoff" + internalbackoff "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/envconfig" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" @@ -47,7 +48,7 @@ type dialOptions struct { cp Compressor dc Decompressor - bs backoff.Strategy + bs internalbackoff.Strategy block bool insecure bool timeout time.Duration @@ -57,9 +58,7 @@ type dialOptions struct { callOptions []CallOption // This is used by v1 balancer dial option WithBalancer to support v1 // balancer, and also by WithBalancerName dial option. - balancerBuilder balancer.Builder - // This is to support grpclb. - resolverBuilder resolver.Builder + balancerBuilder balancer.Builder channelzParentID int64 disableServiceConfig bool disableRetry bool @@ -68,6 +67,11 @@ type dialOptions struct { minConnectTimeout func() time.Duration defaultServiceConfig *ServiceConfig // defaultServiceConfig is parsed from defaultServiceConfigRawJSON. defaultServiceConfigRawJSON *string + // This is used by ccResolverWrapper to backoff between successive calls to + // resolver.ResolveNow(). The user will have no need to configure this, but + // we need to be able to configure this in tests. + resolveNowBackoff func(int) time.Duration + resolvers []resolver.Builder } // DialOption configures how we set up the connection. @@ -226,13 +230,6 @@ func WithBalancerName(balancerName string) DialOption { }) } -// withResolverBuilder is only for grpclb. -func withResolverBuilder(b resolver.Builder) DialOption { - return newFuncDialOption(func(o *dialOptions) { - o.resolverBuilder = b - }) -} - // WithServiceConfig returns a DialOption which has a channel to read the // service configuration. // @@ -246,8 +243,28 @@ func WithServiceConfig(c <-chan ServiceConfig) DialOption { }) } +// WithConnectParams configures the dialer to use the provided ConnectParams. +// +// The backoff configuration specified as part of the ConnectParams overrides +// all defaults specified in +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. Consider +// using the backoff.DefaultConfig as a base, in cases where you want to +// override only a subset of the backoff configuration. +// +// This API is EXPERIMENTAL. +func WithConnectParams(p ConnectParams) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.bs = internalbackoff.Exponential{Config: p.Backoff} + o.minConnectTimeout = func() time.Duration { + return p.MinConnectTimeout + } + }) +} + // WithBackoffMaxDelay configures the dialer to use the provided maximum delay // when backing off after failed connection attempts. +// +// Deprecated: use WithConnectParams instead. Will be supported throughout 1.x. func WithBackoffMaxDelay(md time.Duration) DialOption { return WithBackoffConfig(BackoffConfig{MaxDelay: md}) } @@ -255,19 +272,18 @@ func WithBackoffMaxDelay(md time.Duration) DialOption { // WithBackoffConfig configures the dialer to use the provided backoff // parameters after connection failures. // -// Use WithBackoffMaxDelay until more parameters on BackoffConfig are opened up -// for use. +// Deprecated: use WithConnectParams instead. Will be supported throughout 1.x. func WithBackoffConfig(b BackoffConfig) DialOption { - return withBackoff(backoff.Exponential{ - MaxDelay: b.MaxDelay, - }) + bc := backoff.DefaultConfig + bc.MaxDelay = b.MaxDelay + return withBackoff(internalbackoff.Exponential{Config: bc}) } // withBackoff sets the backoff strategy used for connectRetryNum after a failed // connection attempt. // // This can be exported if arbitrary backoff strategies are allowed by gRPC. -func withBackoff(bs backoff.Strategy) DialOption { +func withBackoff(bs internalbackoff.Strategy) DialOption { return newFuncDialOption(func(o *dialOptions) { o.bs = bs }) @@ -322,8 +338,8 @@ func WithCredentialsBundle(b credentials.Bundle) DialOption { // WithTimeout returns a DialOption that configures a timeout for dialing a // ClientConn initially. This is valid if and only if WithBlock() is present. // -// Deprecated: use DialContext and context.WithTimeout instead. Will be -// supported throughout 1.x. +// Deprecated: use DialContext instead of Dial and context.WithTimeout +// instead. Will be supported throughout 1.x. func WithTimeout(d time.Duration) DialOption { return newFuncDialOption(func(o *dialOptions) { o.timeout = d @@ -341,7 +357,6 @@ func WithContextDialer(f func(context.Context, string) (net.Conn, error)) DialOp } func init() { - internal.WithResolverBuilder = withResolverBuilder internal.WithHealthCheckFunc = withHealthCheckFunc } @@ -455,6 +470,8 @@ func WithAuthority(a string) DialOption { // WithChannelzParentID returns a DialOption that specifies the channelz ID of // current ClientConn's parent. This function is used in nested channel creation // (e.g. grpclb dial). +// +// This API is EXPERIMENTAL. func WithChannelzParentID(id int64) DialOption { return newFuncDialOption(func(o *dialOptions) { o.channelzParentID = id @@ -539,6 +556,7 @@ func defaultDialOptions() dialOptions { WriteBufferSize: defaultWriteBufSize, ReadBufferSize: defaultReadBufSize, }, + resolveNowBackoff: internalbackoff.DefaultExponential.Backoff, } } @@ -552,3 +570,25 @@ func withMinConnectDeadline(f func() time.Duration) DialOption { o.minConnectTimeout = f }) } + +// withResolveNowBackoff specifies the function that clientconn uses to backoff +// between successive calls to resolver.ResolveNow(). +// +// For testing purpose only. +func withResolveNowBackoff(f func(int) time.Duration) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.resolveNowBackoff = f + }) +} + +// WithResolvers allows a list of resolver implementations to be registered +// locally with the ClientConn without needing to be globally registered via +// resolver.Register. They will be matched against the scheme used for the +// current Dial only, and will take precedence over the global registry. +// +// This API is EXPERIMENTAL. +func WithResolvers(rs ...resolver.Builder) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.resolvers = append(o.resolvers, rs...) + }) +} diff --git a/vendor/google.golang.org/grpc/encoding/encoding.go b/vendor/google.golang.org/grpc/encoding/encoding.go index 30a75da99..195e8448b 100644 --- a/vendor/google.golang.org/grpc/encoding/encoding.go +++ b/vendor/google.golang.org/grpc/encoding/encoding.go @@ -46,6 +46,10 @@ type Compressor interface { // coding header. The result must be static; the result cannot change // between calls. Name() string + // EXPERIMENTAL: if a Compressor implements + // DecompressedSize(compressedBytes []byte) int, gRPC will call it + // to determine the size of the buffer allocated for the result of decompression. + // Return -1 to indicate unknown size. } var registeredCompressor = make(map[string]Compressor) diff --git a/vendor/google.golang.org/grpc/go.mod b/vendor/google.golang.org/grpc/go.mod index c1a8340c5..237836130 100644 --- a/vendor/google.golang.org/grpc/go.mod +++ b/vendor/google.golang.org/grpc/go.mod @@ -1,19 +1,16 @@ module google.golang.org/grpc +go 1.11 + require ( - cloud.google.com/go v0.26.0 // indirect - github.com/BurntSushi/toml v0.3.1 // indirect - github.com/client9/misspell v0.3.4 + github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473 + github.com/envoyproxy/protoc-gen-validate v0.1.0 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/mock v1.1.1 - github.com/golang/protobuf v1.2.0 + github.com/golang/protobuf v1.3.2 github.com/google/go-cmp v0.2.0 - golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 golang.org/x/net v0.0.0-20190311183353-d8887717615a golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a - golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 - google.golang.org/appengine v1.1.0 // indirect - google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 - honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc + google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 ) diff --git a/vendor/google.golang.org/grpc/go.sum b/vendor/google.golang.org/grpc/go.sum index 741677d2e..dd5d0cee7 100644 --- a/vendor/google.golang.org/grpc/go.sum +++ b/vendor/google.golang.org/grpc/go.sum @@ -1,37 +1,53 @@ cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473 h1:4cmBvAEBNJaGARUEs3/suWRyfyBfhf7I60WBZq+bv2w= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/google.golang.org/grpc/grpclog/grpclog.go b/vendor/google.golang.org/grpc/grpclog/grpclog.go index 51bb9457c..874ea6d98 100644 --- a/vendor/google.golang.org/grpc/grpclog/grpclog.go +++ b/vendor/google.golang.org/grpc/grpclog/grpclog.go @@ -89,7 +89,7 @@ func Fatal(args ...interface{}) { } // Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf. -// It calles os.Exit() with exit code 1. +// It calls os.Exit() with exit code 1. func Fatalf(format string, args ...interface{}) { logger.Fatalf(format, args...) // Make sure fatal logs will exit. diff --git a/vendor/google.golang.org/grpc/health/client.go b/vendor/google.golang.org/grpc/health/client.go index b43746e61..b5bee4838 100644 --- a/vendor/google.golang.org/grpc/health/client.go +++ b/vendor/google.golang.org/grpc/health/client.go @@ -33,20 +33,20 @@ import ( "google.golang.org/grpc/status" ) -const maxDelay = 120 * time.Second - -var backoffStrategy = backoff.Exponential{MaxDelay: maxDelay} -var backoffFunc = func(ctx context.Context, retries int) bool { - d := backoffStrategy.Backoff(retries) - timer := time.NewTimer(d) - select { - case <-timer.C: - return true - case <-ctx.Done(): - timer.Stop() - return false +var ( + backoffStrategy = backoff.DefaultExponential + backoffFunc = func(ctx context.Context, retries int) bool { + d := backoffStrategy.Backoff(retries) + timer := time.NewTimer(d) + select { + case <-timer.C: + return true + case <-ctx.Done(): + timer.Stop() + return false + } } -} +) func init() { internal.HealthCheckFunc = clientHealthCheck @@ -56,7 +56,7 @@ const healthCheckMethod = "/grpc.health.v1.Health/Watch" // This function implements the protocol defined at: // https://github.com/grpc/grpc/blob/master/doc/health-checking.md -func clientHealthCheck(ctx context.Context, newStream func(string) (interface{}, error), setConnectivityState func(connectivity.State), service string) error { +func clientHealthCheck(ctx context.Context, newStream func(string) (interface{}, error), setConnectivityState func(connectivity.State, error), service string) error { tryCnt := 0 retryConnection: @@ -70,7 +70,7 @@ retryConnection: if ctx.Err() != nil { return nil } - setConnectivityState(connectivity.Connecting) + setConnectivityState(connectivity.Connecting, nil) rawS, err := newStream(healthCheckMethod) if err != nil { continue retryConnection @@ -79,7 +79,7 @@ retryConnection: s, ok := rawS.(grpc.ClientStream) // Ideally, this should never happen. But if it happens, the server is marked as healthy for LBing purposes. if !ok { - setConnectivityState(connectivity.Ready) + setConnectivityState(connectivity.Ready, nil) return fmt.Errorf("newStream returned %v (type %T); want grpc.ClientStream", rawS, rawS) } @@ -95,22 +95,22 @@ retryConnection: // Reports healthy for the LBing purposes if health check is not implemented in the server. if status.Code(err) == codes.Unimplemented { - setConnectivityState(connectivity.Ready) + setConnectivityState(connectivity.Ready, nil) return err } // Reports unhealthy if server's Watch method gives an error other than UNIMPLEMENTED. if err != nil { - setConnectivityState(connectivity.TransientFailure) + setConnectivityState(connectivity.TransientFailure, fmt.Errorf("connection active but received health check RPC error: %v", err)) continue retryConnection } - // As a message has been received, removes the need for backoff for the next retry by reseting the try count. + // As a message has been received, removes the need for backoff for the next retry by resetting the try count. tryCnt = 0 if resp.Status == healthpb.HealthCheckResponse_SERVING { - setConnectivityState(connectivity.Ready) + setConnectivityState(connectivity.Ready, nil) } else { - setConnectivityState(connectivity.TransientFailure) + setConnectivityState(connectivity.TransientFailure, fmt.Errorf("connection active but health check failed. status=%s", resp.Status)) } } } diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go index c2f2c7729..c99e27ae5 100644 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go +++ b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go @@ -1,15 +1,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: grpc/health/v1/health.proto -package grpc_health_v1 // import "google.golang.org/grpc/health/grpc_health_v1" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +package grpc_health_v1 import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -21,7 +22,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type HealthCheckResponse_ServingStatus int32 @@ -38,6 +39,7 @@ var HealthCheckResponse_ServingStatus_name = map[int32]string{ 2: "NOT_SERVING", 3: "SERVICE_UNKNOWN", } + var HealthCheckResponse_ServingStatus_value = map[string]int32{ "UNKNOWN": 0, "SERVING": 1, @@ -48,8 +50,9 @@ var HealthCheckResponse_ServingStatus_value = map[string]int32{ func (x HealthCheckResponse_ServingStatus) String() string { return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) } + func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_health_6b1a06aa67f91efd, []int{1, 0} + return fileDescriptor_e265fd9d4e077217, []int{1, 0} } type HealthCheckRequest struct { @@ -63,16 +66,17 @@ func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) } func (*HealthCheckRequest) ProtoMessage() {} func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_health_6b1a06aa67f91efd, []int{0} + return fileDescriptor_e265fd9d4e077217, []int{0} } + func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HealthCheckRequest.Unmarshal(m, b) } func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HealthCheckRequest.Marshal(b, m, deterministic) } -func (dst *HealthCheckRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckRequest.Merge(dst, src) +func (m *HealthCheckRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_HealthCheckRequest.Merge(m, src) } func (m *HealthCheckRequest) XXX_Size() int { return xxx_messageInfo_HealthCheckRequest.Size(m) @@ -101,16 +105,17 @@ func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } func (*HealthCheckResponse) ProtoMessage() {} func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_health_6b1a06aa67f91efd, []int{1} + return fileDescriptor_e265fd9d4e077217, []int{1} } + func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HealthCheckResponse.Unmarshal(m, b) } func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic) } -func (dst *HealthCheckResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckResponse.Merge(dst, src) +func (m *HealthCheckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_HealthCheckResponse.Merge(m, src) } func (m *HealthCheckResponse) XXX_Size() int { return xxx_messageInfo_HealthCheckResponse.Size(m) @@ -129,9 +134,34 @@ func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { } func init() { + proto.RegisterEnum("grpc.health.v1.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) proto.RegisterType((*HealthCheckRequest)(nil), "grpc.health.v1.HealthCheckRequest") proto.RegisterType((*HealthCheckResponse)(nil), "grpc.health.v1.HealthCheckResponse") - proto.RegisterEnum("grpc.health.v1.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) +} + +func init() { proto.RegisterFile("grpc/health/v1/health.proto", fileDescriptor_e265fd9d4e077217) } + +var fileDescriptor_e265fd9d4e077217 = []byte{ + // 297 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0x2f, 0x2a, 0x48, + 0xd6, 0xcf, 0x48, 0x4d, 0xcc, 0x29, 0xc9, 0xd0, 0x2f, 0x33, 0x84, 0xb2, 0xf4, 0x0a, 0x8a, 0xf2, + 0x4b, 0xf2, 0x85, 0xf8, 0x40, 0x92, 0x7a, 0x50, 0xa1, 0x32, 0x43, 0x25, 0x3d, 0x2e, 0x21, 0x0f, + 0x30, 0xc7, 0x39, 0x23, 0x35, 0x39, 0x3b, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, 0x82, + 0x8b, 0xbd, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, + 0xc6, 0x55, 0xda, 0xc8, 0xc8, 0x25, 0x8c, 0xa2, 0xa1, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, 0xc8, + 0x93, 0x8b, 0xad, 0xb8, 0x24, 0xb1, 0xa4, 0xb4, 0x18, 0xac, 0x81, 0xcf, 0xc8, 0x50, 0x0f, 0xd5, + 0x22, 0x3d, 0x2c, 0x9a, 0xf4, 0x82, 0x41, 0x86, 0xe6, 0xa5, 0x07, 0x83, 0x35, 0x06, 0x41, 0x0d, + 0x50, 0xf2, 0xe7, 0xe2, 0x45, 0x91, 0x10, 0xe2, 0xe6, 0x62, 0x0f, 0xf5, 0xf3, 0xf6, 0xf3, 0x0f, + 0xf7, 0x13, 0x60, 0x00, 0x71, 0x82, 0x5d, 0x83, 0xc2, 0x3c, 0xfd, 0xdc, 0x05, 0x18, 0x85, 0xf8, + 0xb9, 0xb8, 0xfd, 0xfc, 0x43, 0xe2, 0x61, 0x02, 0x4c, 0x42, 0xc2, 0x5c, 0xfc, 0x60, 0x8e, 0xb3, + 0x6b, 0x3c, 0x4c, 0x0b, 0xb3, 0xd1, 0x3a, 0x46, 0x2e, 0x36, 0x88, 0xf5, 0x42, 0x01, 0x5c, 0xac, + 0x60, 0x27, 0x08, 0x29, 0xe1, 0x75, 0x1f, 0x38, 0x14, 0xa4, 0x94, 0x89, 0xf0, 0x83, 0x50, 0x10, + 0x17, 0x6b, 0x78, 0x62, 0x49, 0x72, 0x06, 0xd5, 0x4c, 0x34, 0x60, 0x74, 0x4a, 0xe4, 0x12, 0xcc, + 0xcc, 0x47, 0x53, 0xea, 0xc4, 0x0d, 0x51, 0x1b, 0x00, 0x8a, 0xc6, 0x00, 0xc6, 0x28, 0x9d, 0xf4, + 0xfc, 0xfc, 0xf4, 0x9c, 0x54, 0xbd, 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0xbd, 0xfc, 0xa2, 0x74, + 0x7d, 0xe4, 0x78, 0x07, 0xb1, 0xe3, 0x21, 0xec, 0xf8, 0x32, 0xc3, 0x55, 0x4c, 0x7c, 0xee, 0x20, + 0xd3, 0x20, 0x46, 0xe8, 0x85, 0x19, 0x26, 0xb1, 0x81, 0x93, 0x83, 0x31, 0x20, 0x00, 0x00, 0xff, + 0xff, 0x12, 0x7d, 0x96, 0xcb, 0x2d, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -239,6 +269,17 @@ type HealthServer interface { Watch(*HealthCheckRequest, Health_WatchServer) error } +// UnimplementedHealthServer can be embedded to have forward compatible implementations. +type UnimplementedHealthServer struct { +} + +func (*UnimplementedHealthServer) Check(ctx context.Context, req *HealthCheckRequest) (*HealthCheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") +} +func (*UnimplementedHealthServer) Watch(req *HealthCheckRequest, srv Health_WatchServer) error { + return status.Errorf(codes.Unimplemented, "method Watch not implemented") +} + func RegisterHealthServer(s *grpc.Server, srv HealthServer) { s.RegisterService(&_Health_serviceDesc, srv) } @@ -300,28 +341,3 @@ var _Health_serviceDesc = grpc.ServiceDesc{ }, Metadata: "grpc/health/v1/health.proto", } - -func init() { proto.RegisterFile("grpc/health/v1/health.proto", fileDescriptor_health_6b1a06aa67f91efd) } - -var fileDescriptor_health_6b1a06aa67f91efd = []byte{ - // 297 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0x2f, 0x2a, 0x48, - 0xd6, 0xcf, 0x48, 0x4d, 0xcc, 0x29, 0xc9, 0xd0, 0x2f, 0x33, 0x84, 0xb2, 0xf4, 0x0a, 0x8a, 0xf2, - 0x4b, 0xf2, 0x85, 0xf8, 0x40, 0x92, 0x7a, 0x50, 0xa1, 0x32, 0x43, 0x25, 0x3d, 0x2e, 0x21, 0x0f, - 0x30, 0xc7, 0x39, 0x23, 0x35, 0x39, 0x3b, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, 0x82, - 0x8b, 0xbd, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, - 0xc6, 0x55, 0xda, 0xc8, 0xc8, 0x25, 0x8c, 0xa2, 0xa1, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, 0xc8, - 0x93, 0x8b, 0xad, 0xb8, 0x24, 0xb1, 0xa4, 0xb4, 0x18, 0xac, 0x81, 0xcf, 0xc8, 0x50, 0x0f, 0xd5, - 0x22, 0x3d, 0x2c, 0x9a, 0xf4, 0x82, 0x41, 0x86, 0xe6, 0xa5, 0x07, 0x83, 0x35, 0x06, 0x41, 0x0d, - 0x50, 0xf2, 0xe7, 0xe2, 0x45, 0x91, 0x10, 0xe2, 0xe6, 0x62, 0x0f, 0xf5, 0xf3, 0xf6, 0xf3, 0x0f, - 0xf7, 0x13, 0x60, 0x00, 0x71, 0x82, 0x5d, 0x83, 0xc2, 0x3c, 0xfd, 0xdc, 0x05, 0x18, 0x85, 0xf8, - 0xb9, 0xb8, 0xfd, 0xfc, 0x43, 0xe2, 0x61, 0x02, 0x4c, 0x42, 0xc2, 0x5c, 0xfc, 0x60, 0x8e, 0xb3, - 0x6b, 0x3c, 0x4c, 0x0b, 0xb3, 0xd1, 0x3a, 0x46, 0x2e, 0x36, 0x88, 0xf5, 0x42, 0x01, 0x5c, 0xac, - 0x60, 0x27, 0x08, 0x29, 0xe1, 0x75, 0x1f, 0x38, 0x14, 0xa4, 0x94, 0x89, 0xf0, 0x83, 0x50, 0x10, - 0x17, 0x6b, 0x78, 0x62, 0x49, 0x72, 0x06, 0xd5, 0x4c, 0x34, 0x60, 0x74, 0x4a, 0xe4, 0x12, 0xcc, - 0xcc, 0x47, 0x53, 0xea, 0xc4, 0x0d, 0x51, 0x1b, 0x00, 0x8a, 0xc6, 0x00, 0xc6, 0x28, 0x9d, 0xf4, - 0xfc, 0xfc, 0xf4, 0x9c, 0x54, 0xbd, 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0xbd, 0xfc, 0xa2, 0x74, - 0x7d, 0xe4, 0x78, 0x07, 0xb1, 0xe3, 0x21, 0xec, 0xf8, 0x32, 0xc3, 0x55, 0x4c, 0x7c, 0xee, 0x20, - 0xd3, 0x20, 0x46, 0xe8, 0x85, 0x19, 0x26, 0xb1, 0x81, 0x93, 0x83, 0x31, 0x20, 0x00, 0x00, 0xff, - 0xff, 0x12, 0x7d, 0x96, 0xcb, 0x2d, 0x02, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/grpc/health/server.go b/vendor/google.golang.org/grpc/health/server.go index c79f9d2ab..2262607f8 100644 --- a/vendor/google.golang.org/grpc/health/server.go +++ b/vendor/google.golang.org/grpc/health/server.go @@ -35,7 +35,7 @@ import ( // Server implements `service Health`. type Server struct { - mu sync.Mutex + mu sync.RWMutex // If shutdown is true, it's expected all serving status is NOT_SERVING, and // will stay in NOT_SERVING. shutdown bool @@ -54,8 +54,8 @@ func NewServer() *Server { // Check implements `service Health`. func (s *Server) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) { - s.mu.Lock() - defer s.mu.Unlock() + s.mu.RLock() + defer s.mu.RUnlock() if servingStatus, ok := s.statusMap[in.Service]; ok { return &healthpb.HealthCheckResponse{ Status: servingStatus, @@ -139,7 +139,7 @@ func (s *Server) setServingStatusLocked(service string, servingStatus healthpb.H // Shutdown sets all serving status to NOT_SERVING, and configures the server to // ignore all future status changes. // -// This changes serving status for all services. To set status for a perticular +// This changes serving status for all services. To set status for a particular // services, call SetServingStatus(). func (s *Server) Shutdown() { s.mu.Lock() @@ -153,7 +153,7 @@ func (s *Server) Shutdown() { // Resume sets all serving status to SERVING, and configures the server to // accept all future status changes. // -// This changes serving status for all services. To set status for a perticular +// This changes serving status for all services. To set status for a particular // services, call SetServingStatus(). func (s *Server) Resume() { s.mu.Lock() diff --git a/vendor/google.golang.org/grpc/internal/backoff/backoff.go b/vendor/google.golang.org/grpc/internal/backoff/backoff.go index 1bd0cce5a..5fc0ee3da 100644 --- a/vendor/google.golang.org/grpc/internal/backoff/backoff.go +++ b/vendor/google.golang.org/grpc/internal/backoff/backoff.go @@ -25,44 +25,39 @@ package backoff import ( "time" + grpcbackoff "google.golang.org/grpc/backoff" "google.golang.org/grpc/internal/grpcrand" ) // Strategy defines the methodology for backing off after a grpc connection // failure. -// type Strategy interface { // Backoff returns the amount of time to wait before the next retry given // the number of consecutive failures. Backoff(retries int) time.Duration } -const ( - // baseDelay is the amount of time to wait before retrying after the first - // failure. - baseDelay = 1.0 * time.Second - // factor is applied to the backoff after each retry. - factor = 1.6 - // jitter provides a range to randomize backoff delays. - jitter = 0.2 -) +// DefaultExponential is an exponential backoff implementation using the +// default values for all the configurable knobs defined in +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +var DefaultExponential = Exponential{Config: grpcbackoff.DefaultConfig} // Exponential implements exponential backoff algorithm as defined in // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. type Exponential struct { - // MaxDelay is the upper bound of backoff delay. - MaxDelay time.Duration + // Config contains all options to configure the backoff algorithm. + Config grpcbackoff.Config } // Backoff returns the amount of time to wait before the next retry given the // number of retries. func (bc Exponential) Backoff(retries int) time.Duration { if retries == 0 { - return baseDelay + return bc.Config.BaseDelay } - backoff, max := float64(baseDelay), float64(bc.MaxDelay) + backoff, max := float64(bc.Config.BaseDelay), float64(bc.Config.MaxDelay) for backoff < max && retries > 0 { - backoff *= factor + backoff *= bc.Config.Multiplier retries-- } if backoff > max { @@ -70,7 +65,7 @@ func (bc Exponential) Backoff(retries int) time.Duration { } // Randomize backoff delays so that if a cluster of requests start at // the same time, they won't operate in lockstep. - backoff *= 1 + jitter*(grpcrand.Float64()*2-1) + backoff *= 1 + bc.Config.Jitter*(grpcrand.Float64()*2-1) if backoff < 0 { return 0 } diff --git a/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go b/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go index fee6aecd0..8b1051674 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go @@ -34,7 +34,7 @@ type Logger interface { } // binLogger is the global binary logger for the binary. One of this should be -// built at init time from the configuration (environment varialbe or flags). +// built at init time from the configuration (environment variable or flags). // // It is used to get a methodLogger for each individual method. var binLogger Logger @@ -98,7 +98,7 @@ func (l *logger) setDefaultMethodLogger(ml *methodLoggerConfig) error { // New methodLogger with same service overrides the old one. func (l *logger) setServiceMethodLogger(service string, ml *methodLoggerConfig) error { if _, ok := l.services[service]; ok { - return fmt.Errorf("conflicting rules for service %v found", service) + return fmt.Errorf("conflicting service rules for service %v found", service) } if l.services == nil { l.services = make(map[string]*methodLoggerConfig) @@ -112,10 +112,10 @@ func (l *logger) setServiceMethodLogger(service string, ml *methodLoggerConfig) // New methodLogger with same method overrides the old one. func (l *logger) setMethodMethodLogger(method string, ml *methodLoggerConfig) error { if _, ok := l.blacklist[method]; ok { - return fmt.Errorf("conflicting rules for method %v found", method) + return fmt.Errorf("conflicting blacklist rules for method %v found", method) } if _, ok := l.methods[method]; ok { - return fmt.Errorf("conflicting rules for method %v found", method) + return fmt.Errorf("conflicting method rules for method %v found", method) } if l.methods == nil { l.methods = make(map[string]*methodLoggerConfig) @@ -127,10 +127,10 @@ func (l *logger) setMethodMethodLogger(method string, ml *methodLoggerConfig) er // Set blacklist method for "-service/method". func (l *logger) setBlacklist(method string) error { if _, ok := l.blacklist[method]; ok { - return fmt.Errorf("conflicting rules for method %v found", method) + return fmt.Errorf("conflicting blacklist rules for method %v found", method) } if _, ok := l.methods[method]; ok { - return fmt.Errorf("conflicting rules for method %v found", method) + return fmt.Errorf("conflicting method rules for method %v found", method) } if l.blacklist == nil { l.blacklist = make(map[string]struct{}) diff --git a/vendor/google.golang.org/grpc/internal/binarylog/env_config.go b/vendor/google.golang.org/grpc/internal/binarylog/env_config.go index 4cc2525df..be30d0e65 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/env_config.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/env_config.go @@ -43,7 +43,7 @@ import ( // Foo. // // If two configs exist for one certain method or service, the one specified -// later overrides the privous config. +// later overrides the previous config. func NewLoggerFromConfigString(s string) Logger { if s == "" { return nil @@ -74,7 +74,7 @@ func (l *logger) fillMethodLoggerWithConfigString(config string) error { return fmt.Errorf("invalid config: %q, %v", config, err) } if m == "*" { - return fmt.Errorf("invalid config: %q, %v", config, "* not allowd in blacklist config") + return fmt.Errorf("invalid config: %q, %v", config, "* not allowed in blacklist config") } if suffix != "" { return fmt.Errorf("invalid config: %q, %v", config, "header/message limit not allowed in blacklist config") diff --git a/vendor/google.golang.org/grpc/internal/binarylog/sink.go b/vendor/google.golang.org/grpc/internal/binarylog/sink.go index 20d044f0f..a2e7c346d 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/sink.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/sink.go @@ -63,7 +63,7 @@ func (ns *noopSink) Close() error { return nil } // newWriterSink creates a binary log sink with the given writer. // -// Write() marshalls the proto message and writes it to the given writer. Each +// Write() marshals the proto message and writes it to the given writer. Each // message is prefixed with a 4 byte big endian unsigned integer as the length. // // No buffer is done, Close() doesn't try to close the writer. diff --git a/vendor/google.golang.org/grpc/internal/buffer/unbounded.go b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go new file mode 100644 index 000000000..9f6a0c120 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go @@ -0,0 +1,85 @@ +/* + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package buffer provides an implementation of an unbounded buffer. +package buffer + +import "sync" + +// Unbounded is an implementation of an unbounded buffer which does not use +// extra goroutines. This is typically used for passing updates from one entity +// to another within gRPC. +// +// All methods on this type are thread-safe and don't block on anything except +// the underlying mutex used for synchronization. +// +// Unbounded supports values of any type to be stored in it by using a channel +// of `interface{}`. This means that a call to Put() incurs an extra memory +// allocation, and also that users need a type assertion while reading. For +// performance critical code paths, using Unbounded is strongly discouraged and +// defining a new type specific implementation of this buffer is preferred. See +// internal/transport/transport.go for an example of this. +type Unbounded struct { + c chan interface{} + mu sync.Mutex + backlog []interface{} +} + +// NewUnbounded returns a new instance of Unbounded. +func NewUnbounded() *Unbounded { + return &Unbounded{c: make(chan interface{}, 1)} +} + +// Put adds t to the unbounded buffer. +func (b *Unbounded) Put(t interface{}) { + b.mu.Lock() + if len(b.backlog) == 0 { + select { + case b.c <- t: + b.mu.Unlock() + return + default: + } + } + b.backlog = append(b.backlog, t) + b.mu.Unlock() +} + +// Load sends the earliest buffered data, if any, onto the read channel +// returned by Get(). Users are expected to call this every time they read a +// value from the read channel. +func (b *Unbounded) Load() { + b.mu.Lock() + if len(b.backlog) > 0 { + select { + case b.c <- b.backlog[0]: + b.backlog[0] = nil + b.backlog = b.backlog[1:] + default: + } + } + b.mu.Unlock() +} + +// Get returns a read channel on which values added to the buffer, via Put(), +// are sent on. +// +// Upon reading a value from this channel, users are expected to call Load() to +// send the next buffered value onto the channel if there is any. +func (b *Unbounded) Get() <-chan interface{} { + return b.c +} diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 3ee8740f1..ae6c8972f 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -25,11 +25,14 @@ import ( ) const ( - prefix = "GRPC_GO_" - retryStr = prefix + "RETRY" + prefix = "GRPC_GO_" + retryStr = prefix + "RETRY" + txtErrIgnoreStr = prefix + "IGNORE_TXT_ERRORS" ) var ( // Retry is set if retry is explicitly enabled via "GRPC_GO_RETRY=on". Retry = strings.EqualFold(os.Getenv(retryStr), "on") + // TXTErrIgnore is set if TXT errors should be ignored ("GRPC_GO_IGNORE_TXT_ERRORS" is not "false"). + TXTErrIgnore = !strings.EqualFold(os.Getenv(retryStr), "false") ) diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index bc1f99ac8..0912f0bf4 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -28,9 +28,7 @@ import ( ) var ( - // WithResolverBuilder is exported by dialoptions.go - WithResolverBuilder interface{} // func (resolver.Builder) grpc.DialOption - // WithHealthCheckFunc is not exported by dialoptions.go + // WithHealthCheckFunc is set by dialoptions.go WithHealthCheckFunc interface{} // func (HealthChecker) DialOption // HealthCheckFunc is used to provide client-side LB channel health checking HealthCheckFunc HealthChecker @@ -39,14 +37,17 @@ var ( // KeepaliveMinPingTime is the minimum ping interval. This must be 10s by // default, but tests may wish to set it lower for convenience. KeepaliveMinPingTime = 10 * time.Second - // ParseServiceConfig is a function to parse JSON service configs into - // opaque data structures. - ParseServiceConfig func(sc string) (interface{}, error) // StatusRawProto is exported by status/status.go. This func returns a // pointer to the wrapped Status proto for a given status.Status without a // call to proto.Clone(). The returned Status proto should not be mutated by // the caller. StatusRawProto interface{} // func (*status.Status) *spb.Status + // NewRequestInfoContext creates a new context based on the argument context attaching + // the passed in RequestInfo to the new context. + NewRequestInfoContext interface{} // func(context.Context, credentials.RequestInfo) context.Context + // ParseServiceConfigForTesting is for creating a fake + // ClientConn for resolver testing only + ParseServiceConfigForTesting interface{} // func(string) *serviceconfig.ParseResult ) // HealthChecker defines the signature of the client-side LB channel health checking function. @@ -57,7 +58,7 @@ var ( // // The health checking protocol is defined at: // https://github.com/grpc/grpc/blob/master/doc/health-checking.md -type HealthChecker func(ctx context.Context, newStream func(string) (interface{}, error), setConnectivityState func(connectivity.State), serviceName string) error +type HealthChecker func(ctx context.Context, newStream func(string) (interface{}, error), setConnectivityState func(connectivity.State, error), serviceName string) error const ( // CredsBundleModeFallback switches GoogleDefaultCreds to fallback mode. diff --git a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go similarity index 72% rename from vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go rename to vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go index 297492e87..c368db62e 100644 --- a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go +++ b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go @@ -33,18 +33,22 @@ import ( "time" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/internal/backoff" + "google.golang.org/grpc/internal/envconfig" "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/serviceconfig" ) +// EnableSRVLookups controls whether the DNS resolver attempts to fetch gRPCLB +// addresses from SRV records. Must not be changed after init time. +var EnableSRVLookups = false + func init() { resolver.Register(NewBuilder()) } const ( defaultPort = "443" - defaultFreq = time.Minute * 30 defaultDNSSvrPort = "53" golang = "GO" // txtPrefix is the prefix string to be prepended to the host name for txt record lookup. @@ -94,47 +98,33 @@ var customAuthorityResolver = func(authority string) (netResolver, error) { // NewBuilder creates a dnsBuilder which is used to factory DNS resolvers. func NewBuilder() resolver.Builder { - return &dnsBuilder{minFreq: defaultFreq} + return &dnsBuilder{} } -type dnsBuilder struct { - // minimum frequency of polling the DNS server. - minFreq time.Duration -} +type dnsBuilder struct{} // Build creates and starts a DNS resolver that watches the name resolution of the target. -func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error) { +func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { host, port, err := parseTarget(target.Endpoint, defaultPort) if err != nil { return nil, err } // IP address. - if net.ParseIP(host) != nil { - host, _ = formatIP(host) - addr := []resolver.Address{{Addr: host + ":" + port}} - i := &ipResolver{ - cc: cc, - ip: addr, - rn: make(chan struct{}, 1), - q: make(chan struct{}), - } - cc.NewAddress(addr) - go i.watcher() - return i, nil + if ipAddr, ok := formatIP(host); ok { + addr := []resolver.Address{{Addr: ipAddr + ":" + port}} + cc.UpdateState(resolver.State{Addresses: addr}) + return deadResolver{}, nil } // DNS address (non-IP). ctx, cancel := context.WithCancel(context.Background()) d := &dnsResolver{ - freq: b.minFreq, - backoff: backoff.Exponential{MaxDelay: b.minFreq}, host: host, port: port, ctx: ctx, cancel: cancel, cc: cc, - t: time.NewTimer(0), rn: make(chan struct{}, 1), disableServiceConfig: opts.DisableServiceConfig, } @@ -150,6 +140,7 @@ func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts d.wg.Add(1) go d.watcher() + d.ResolveNow(resolver.ResolveNowOptions{}) return d, nil } @@ -164,53 +155,23 @@ type netResolver interface { LookupTXT(ctx context.Context, name string) (txts []string, err error) } -// ipResolver watches for the name resolution update for an IP address. -type ipResolver struct { - cc resolver.ClientConn - ip []resolver.Address - // rn channel is used by ResolveNow() to force an immediate resolution of the target. - rn chan struct{} - q chan struct{} -} - -// ResolveNow resend the address it stores, no resolution is needed. -func (i *ipResolver) ResolveNow(opt resolver.ResolveNowOption) { - select { - case i.rn <- struct{}{}: - default: - } -} +// deadResolver is a resolver that does nothing. +type deadResolver struct{} -// Close closes the ipResolver. -func (i *ipResolver) Close() { - close(i.q) -} +func (deadResolver) ResolveNow(resolver.ResolveNowOptions) {} -func (i *ipResolver) watcher() { - for { - select { - case <-i.rn: - i.cc.NewAddress(i.ip) - case <-i.q: - return - } - } -} +func (deadResolver) Close() {} // dnsResolver watches for the name resolution update for a non-IP target. type dnsResolver struct { - freq time.Duration - backoff backoff.Exponential - retryCount int - host string - port string - resolver netResolver - ctx context.Context - cancel context.CancelFunc - cc resolver.ClientConn + host string + port string + resolver netResolver + ctx context.Context + cancel context.CancelFunc + cc resolver.ClientConn // rn channel is used by ResolveNow() to force an immediate resolution of the target. rn chan struct{} - t *time.Timer // wg is used to enforce Close() to return after the watcher() goroutine has finished. // Otherwise, data race will be possible. [Race Example] in dns_resolver_test we // replace the real lookup functions with mocked ones to facilitate testing. @@ -222,7 +183,7 @@ type dnsResolver struct { } // ResolveNow invoke an immediate resolution of the target that this dnsResolver watches. -func (d *dnsResolver) ResolveNow(opt resolver.ResolveNowOption) { +func (d *dnsResolver) ResolveNow(resolver.ResolveNowOptions) { select { case d.rn <- struct{}{}: default: @@ -233,7 +194,6 @@ func (d *dnsResolver) ResolveNow(opt resolver.ResolveNowOption) { func (d *dnsResolver) Close() { d.cancel() d.wg.Wait() - d.t.Stop() } func (d *dnsResolver) watcher() { @@ -242,27 +202,15 @@ func (d *dnsResolver) watcher() { select { case <-d.ctx.Done(): return - case <-d.t.C: case <-d.rn: - if !d.t.Stop() { - // Before resetting a timer, it should be stopped to prevent racing with - // reads on it's channel. - <-d.t.C - } } - result, sc := d.lookup() - // Next lookup should happen within an interval defined by d.freq. It may be - // more often due to exponential retry on empty address list. - if len(result) == 0 { - d.retryCount++ - d.t.Reset(d.backoff.Backoff(d.retryCount)) + state, err := d.lookup() + if err != nil { + d.cc.ReportError(err) } else { - d.retryCount = 0 - d.t.Reset(d.freq) + d.cc.UpdateState(*state) } - d.cc.NewServiceConfig(sc) - d.cc.NewAddress(result) // Sleep to prevent excessive re-resolutions. Incoming resolution requests // will be queued in d.rn. @@ -276,37 +224,68 @@ func (d *dnsResolver) watcher() { } } -func (d *dnsResolver) lookupSRV() []resolver.Address { +func (d *dnsResolver) lookupSRV() ([]resolver.Address, error) { + if !EnableSRVLookups { + return nil, nil + } var newAddrs []resolver.Address _, srvs, err := d.resolver.LookupSRV(d.ctx, "grpclb", "tcp", d.host) if err != nil { - grpclog.Infof("grpc: failed dns SRV record lookup due to %v.\n", err) - return nil + err = handleDNSError(err, "SRV") // may become nil + return nil, err } for _, s := range srvs { lbAddrs, err := d.resolver.LookupHost(d.ctx, s.Target) if err != nil { - grpclog.Infof("grpc: failed load balancer address dns lookup due to %v.\n", err) - continue + err = handleDNSError(err, "A") // may become nil + if err == nil { + // If there are other SRV records, look them up and ignore this + // one that does not exist. + continue + } + return nil, err } for _, a := range lbAddrs { - a, ok := formatIP(a) + ip, ok := formatIP(a) if !ok { - grpclog.Errorf("grpc: failed IP parsing due to %v.\n", err) - continue + return nil, fmt.Errorf("dns: error parsing A record IP address %v", a) } - addr := a + ":" + strconv.Itoa(int(s.Port)) + addr := ip + ":" + strconv.Itoa(int(s.Port)) newAddrs = append(newAddrs, resolver.Address{Addr: addr, Type: resolver.GRPCLB, ServerName: s.Target}) } } - return newAddrs + return newAddrs, nil +} + +var filterError = func(err error) error { + if dnsErr, ok := err.(*net.DNSError); ok && !dnsErr.IsTimeout && !dnsErr.IsTemporary { + // Timeouts and temporary errors should be communicated to gRPC to + // attempt another DNS query (with backoff). Other errors should be + // suppressed (they may represent the absence of a TXT record). + return nil + } + return err +} + +func handleDNSError(err error, lookupType string) error { + err = filterError(err) + if err != nil { + err = fmt.Errorf("dns: %v record lookup error: %v", lookupType, err) + grpclog.Infoln(err) + } + return err } -func (d *dnsResolver) lookupTXT() string { +func (d *dnsResolver) lookupTXT() *serviceconfig.ParseResult { ss, err := d.resolver.LookupTXT(d.ctx, txtPrefix+d.host) if err != nil { - grpclog.Infof("grpc: failed dns TXT record lookup due to %v.\n", err) - return "" + if envconfig.TXTErrIgnore { + return nil + } + if err = handleDNSError(err, "TXT"); err != nil { + return &serviceconfig.ParseResult{Err: err} + } + return nil } var res string for _, s := range ss { @@ -315,40 +294,45 @@ func (d *dnsResolver) lookupTXT() string { // TXT record must have "grpc_config=" attribute in order to be used as service config. if !strings.HasPrefix(res, txtAttribute) { - grpclog.Warningf("grpc: TXT record %v missing %v attribute", res, txtAttribute) - return "" + grpclog.Warningf("dns: TXT record %v missing %v attribute", res, txtAttribute) + // This is not an error; it is the equivalent of not having a service config. + return nil } - return strings.TrimPrefix(res, txtAttribute) + sc := canaryingSC(strings.TrimPrefix(res, txtAttribute)) + return d.cc.ParseServiceConfig(sc) } -func (d *dnsResolver) lookupHost() []resolver.Address { +func (d *dnsResolver) lookupHost() ([]resolver.Address, error) { var newAddrs []resolver.Address addrs, err := d.resolver.LookupHost(d.ctx, d.host) if err != nil { - grpclog.Warningf("grpc: failed dns A record lookup due to %v.\n", err) - return nil + err = handleDNSError(err, "A") + return nil, err } for _, a := range addrs { - a, ok := formatIP(a) + ip, ok := formatIP(a) if !ok { - grpclog.Errorf("grpc: failed IP parsing due to %v.\n", err) - continue + return nil, fmt.Errorf("dns: error parsing A record IP address %v", a) } - addr := a + ":" + d.port + addr := ip + ":" + d.port newAddrs = append(newAddrs, resolver.Address{Addr: addr}) } - return newAddrs + return newAddrs, nil } -func (d *dnsResolver) lookup() ([]resolver.Address, string) { - newAddrs := d.lookupSRV() - // Support fallback to non-balancer address. - newAddrs = append(newAddrs, d.lookupHost()...) - if d.disableServiceConfig { - return newAddrs, "" +func (d *dnsResolver) lookup() (*resolver.State, error) { + srv, srvErr := d.lookupSRV() + addrs, hostErr := d.lookupHost() + if hostErr != nil && (srvErr != nil || len(srv) == 0) { + return nil, hostErr + } + state := &resolver.State{ + Addresses: append(addrs, srv...), + } + if !d.disableServiceConfig { + state.ServiceConfig = d.lookupTXT() } - sc := d.lookupTXT() - return newAddrs, canaryingSC(sc) + return state, nil } // formatIP returns ok = false if addr is not a valid textual representation of an IP address. @@ -434,12 +418,12 @@ func canaryingSC(js string) string { var rcs []rawChoice err := json.Unmarshal([]byte(js), &rcs) if err != nil { - grpclog.Warningf("grpc: failed to parse service config json string due to %v.\n", err) + grpclog.Warningf("dns: error parsing service config json: %v", err) return "" } cliHostname, err := os.Hostname() if err != nil { - grpclog.Warningf("grpc: failed to get client hostname due to %v.\n", err) + grpclog.Warningf("dns: error getting client hostname: %v", err) return "" } var sc string diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/go113.go b/vendor/google.golang.org/grpc/internal/resolver/dns/go113.go new file mode 100644 index 000000000..8783a8cf8 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/resolver/dns/go113.go @@ -0,0 +1,33 @@ +// +build go1.13 + +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package dns + +import "net" + +func init() { + filterError = func(err error) error { + if dnsErr, ok := err.(*net.DNSError); ok && dnsErr.IsNotFound { + // The name does not exist; not an error. + return nil + } + return err + } +} diff --git a/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go b/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go similarity index 94% rename from vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go rename to vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go index 893d5d12c..520d9229e 100644 --- a/vendor/google.golang.org/grpc/resolver/passthrough/passthrough.go +++ b/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go @@ -26,7 +26,7 @@ const scheme = "passthrough" type passthroughBuilder struct{} -func (*passthroughBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error) { +func (*passthroughBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { r := &passthroughResolver{ target: target, cc: cc, @@ -48,7 +48,7 @@ func (r *passthroughResolver) start() { r.cc.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: r.target.Endpoint}}}) } -func (*passthroughResolver) ResolveNow(o resolver.ResolveNowOption) {} +func (*passthroughResolver) ResolveNow(o resolver.ResolveNowOptions) {} func (*passthroughResolver) Close() {} diff --git a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index b8e0aa4db..ddee20b6b 100644 --- a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -107,8 +107,8 @@ func (*registerStream) isTransportResponseFrame() bool { return false } type headerFrame struct { streamID uint32 hf []hpack.HeaderField - endStream bool // Valid on server side. - initStream func(uint32) (bool, error) // Used only on the client side. + endStream bool // Valid on server side. + initStream func(uint32) error // Used only on the client side. onWrite func() wq *writeQuota // write quota for the stream created. cleanup *cleanupStream // Valid on the server side. @@ -637,21 +637,17 @@ func (l *loopyWriter) headerHandler(h *headerFrame) error { func (l *loopyWriter) originateStream(str *outStream) error { hdr := str.itl.dequeue().(*headerFrame) - sendPing, err := hdr.initStream(str.id) - if err != nil { + if err := hdr.initStream(str.id); err != nil { if err == ErrConnClosing { return err } // Other errors(errStreamDrain) need not close transport. return nil } - if err = l.writeHeader(str.id, hdr.endStream, hdr.hf, hdr.onWrite); err != nil { + if err := l.writeHeader(str.id, hdr.endStream, hdr.hf, hdr.onWrite); err != nil { return err } l.estdStreams[str.id] = str - if sendPing { - return l.pingHandler(&ping{data: [8]byte{}}) - } return nil } diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go index 78f9ddc3d..c3c32dafe 100644 --- a/vendor/google.golang.org/grpc/internal/transport/handler_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -227,7 +227,9 @@ func (ht *serverHandlerTransport) WriteStatus(s *Stream, st *status.Status) erro if err == nil { // transport has not been closed if ht.stats != nil { - ht.stats.HandleRPC(s.Context(), &stats.OutTrailer{}) + ht.stats.HandleRPC(s.Context(), &stats.OutTrailer{ + Trailer: s.trailer.Copy(), + }) } } ht.Close() @@ -289,7 +291,9 @@ func (ht *serverHandlerTransport) WriteHeader(s *Stream, md metadata.MD) error { if err == nil { if ht.stats != nil { - ht.stats.HandleRPC(s.Context(), &stats.OutHeader{}) + ht.stats.HandleRPC(s.Context(), &stats.OutHeader{ + Header: md.Copy(), + }) } } return err @@ -334,7 +338,7 @@ func (ht *serverHandlerTransport) HandleStreams(startStream func(*Stream), trace Addr: ht.RemoteAddr(), } if req.TLS != nil { - pr.AuthInfo = credentials.TLSInfo{State: *req.TLS} + pr.AuthInfo = credentials.TLSInfo{State: *req.TLS, CommonAuthInfo: credentials.CommonAuthInfo{credentials.PrivacyAndIntegrity}} } ctx = metadata.NewIncomingContext(ctx, ht.headerMD) s.ctx = peer.NewContext(ctx, pr) diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 41a79c567..2d6feeb1b 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -35,6 +35,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/keepalive" @@ -44,8 +45,14 @@ import ( "google.golang.org/grpc/status" ) +// clientConnectionCounter counts the number of connections a client has +// initiated (equal to the number of http2Clients created). Must be accessed +// atomically. +var clientConnectionCounter uint64 + // http2Client implements the ClientTransport interface with HTTP2. type http2Client struct { + lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. ctx context.Context cancel context.CancelFunc ctxDone <-chan struct{} // Cache the ctx.Done() chan. @@ -62,8 +69,6 @@ type http2Client struct { // goAway is closed to notify the upper layer (i.e., addrConn.transportMonitor) // that the server sent GoAway on this transport. goAway chan struct{} - // awakenKeepalive is used to wake up keepalive when after it has gone dormant. - awakenKeepalive chan struct{} framer *framer // controlBuf delivers all the control related tasks (e.g., window @@ -77,9 +82,6 @@ type http2Client struct { perRPCCreds []credentials.PerRPCCredentials - // Boolean to keep track of reading activity on transport. - // 1 is true and 0 is false. - activity uint32 // Accessed atomically. kp keepalive.ClientParameters keepaliveEnabled bool @@ -110,6 +112,16 @@ type http2Client struct { // goAwayReason records the http2.ErrCode and debug data received with the // GoAway frame. goAwayReason GoAwayReason + // A condition variable used to signal when the keepalive goroutine should + // go dormant. The condition for dormancy is based on the number of active + // streams and the `PermitWithoutStream` keepalive client parameter. And + // since the number of active streams is guarded by the above mutex, we use + // the same for this condition variable as well. + kpDormancyCond *sync.Cond + // A boolean to track whether the keepalive goroutine is dormant or not. + // This is checked before attempting to signal the above condition + // variable. + kpDormant bool // Fields below are for channelz metric collection. channelzID int64 // channelz unique identification number @@ -119,6 +131,8 @@ type http2Client struct { onClose func() bufferPool *bufferPool + + connectionID uint64 } func dial(ctx context.Context, fn func(context.Context, string) (net.Conn, error), addr string) (net.Conn, error) { @@ -232,7 +246,6 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr TargetInfo, opts Conne readerDone: make(chan struct{}), writerDone: make(chan struct{}), goAway: make(chan struct{}), - awakenKeepalive: make(chan struct{}, 1), framer: newFramer(conn, writeBufSize, readBufSize, maxHeaderListSize), fc: &trInFlow{limit: uint32(icwz)}, scheme: scheme, @@ -264,9 +277,6 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr TargetInfo, opts Conne updateFlowControl: t.updateFlowControl, } } - // Make sure awakenKeepalive can't be written upon. - // keepalive routine will make it writable, if need be. - t.awakenKeepalive <- struct{}{} if t.statsHandler != nil { t.ctx = t.statsHandler.TagConn(t.ctx, &stats.ConnTagInfo{ RemoteAddr: t.remoteAddr, @@ -281,6 +291,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr TargetInfo, opts Conne t.channelzID = channelz.RegisterNormalSocket(t, opts.ChannelzParentID, fmt.Sprintf("%s -> %s", t.localAddr, t.remoteAddr)) } if t.keepaliveEnabled { + t.kpDormancyCond = sync.NewCond(&t.mu) go t.keepalive() } // Start the reader goroutine for incoming message. Each transport has @@ -325,6 +336,8 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr TargetInfo, opts Conne } } + t.connectionID = atomic.AddUint64(&clientConnectionCounter, 1) + if err := t.framer.writer.Flush(); err != nil { return nil, err } @@ -347,6 +360,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr TargetInfo, opts Conne func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *Stream { // TODO(zhaoq): Handle uint32 overflow of Stream.id. s := &Stream{ + ct: t, done: make(chan struct{}), method: callHdr.Method, sendCompress: callHdr.SendCompress, @@ -380,23 +394,24 @@ func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *Stream { } func (t *http2Client) getPeer() *peer.Peer { - pr := &peer.Peer{ - Addr: t.remoteAddr, + return &peer.Peer{ + Addr: t.remoteAddr, + AuthInfo: t.authInfo, } - // Attach Auth info if there is any. - if t.authInfo != nil { - pr.AuthInfo = t.authInfo - } - return pr } func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) ([]hpack.HeaderField, error) { aud := t.createAudience(callHdr) - authData, err := t.getTrAuthData(ctx, aud) + ri := credentials.RequestInfo{ + Method: callHdr.Method, + AuthInfo: t.authInfo, + } + ctxWithRequestInfo := internal.NewRequestInfoContext.(func(context.Context, credentials.RequestInfo) context.Context)(ctx, ri) + authData, err := t.getTrAuthData(ctxWithRequestInfo, aud) if err != nil { return nil, err } - callAuthData, err := t.getCallAuthData(ctx, aud, callHdr) + callAuthData, err := t.getCallAuthData(ctxWithRequestInfo, aud, callHdr) if err != nil { return nil, err } @@ -419,6 +434,7 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) if callHdr.SendCompress != "" { headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: callHdr.SendCompress}) + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-accept-encoding", Value: callHdr.SendCompress}) } if dl, ok := ctx.Deadline(); ok { // Send out timeout regardless its value. The server can detect timeout context by itself. @@ -564,7 +580,7 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea hdr := &headerFrame{ hf: headerFields, endStream: false, - initStream: func(id uint32) (bool, error) { + initStream: func(id uint32) error { t.mu.Lock() if state := t.state; state != reachable { t.mu.Unlock() @@ -574,29 +590,19 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea err = ErrConnClosing } cleanup(err) - return false, err + return err } t.activeStreams[id] = s if channelz.IsOn() { atomic.AddInt64(&t.czData.streamsStarted, 1) atomic.StoreInt64(&t.czData.lastStreamCreatedTime, time.Now().UnixNano()) } - var sendPing bool - // If the number of active streams change from 0 to 1, then check if keepalive - // has gone dormant. If so, wake it up. - if len(t.activeStreams) == 1 && t.keepaliveEnabled { - select { - case t.awakenKeepalive <- struct{}{}: - sendPing = true - // Fill the awakenKeepalive channel again as this channel must be - // kept non-writable except at the point that the keepalive() - // goroutine is waiting either to be awaken or shutdown. - t.awakenKeepalive <- struct{}{} - default: - } + // If the keepalive goroutine has gone dormant, wake it up. + if t.kpDormant { + t.kpDormancyCond.Signal() } t.mu.Unlock() - return sendPing, nil + return nil }, onOrphaned: cleanup, wq: s.wq, @@ -674,12 +680,14 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea } } if t.statsHandler != nil { + header, _, _ := metadata.FromOutgoingContextRaw(ctx) outHeader := &stats.OutHeader{ Client: true, FullMethod: callHdr.Method, RemoteAddr: t.remoteAddr, LocalAddr: t.localAddr, Compression: callHdr.SendCompress, + Header: header.Copy(), } t.statsHandler.HandleRPC(s.ctx, outHeader) } @@ -778,6 +786,11 @@ func (t *http2Client) Close() error { t.state = closing streams := t.activeStreams t.activeStreams = nil + if t.kpDormant { + // If the keepalive goroutine is blocked on this condition variable, we + // should unblock it so that the goroutine eventually exits. + t.kpDormancyCond.Signal() + } t.mu.Unlock() t.controlBuf.finish() t.cancel() @@ -853,11 +866,11 @@ func (t *http2Client) Write(s *Stream, hdr []byte, data []byte, opts *Options) e return t.controlBuf.put(df) } -func (t *http2Client) getStream(f http2.Frame) (*Stream, bool) { +func (t *http2Client) getStream(f http2.Frame) *Stream { t.mu.Lock() - defer t.mu.Unlock() - s, ok := t.activeStreams[f.Header().StreamID] - return s, ok + s := t.activeStreams[f.Header().StreamID] + t.mu.Unlock() + return s } // adjustWindow sends out extra window update over the initial window size @@ -937,8 +950,8 @@ func (t *http2Client) handleData(f *http2.DataFrame) { t.controlBuf.put(bdpPing) } // Select the right stream to dispatch. - s, ok := t.getStream(f) - if !ok { + s := t.getStream(f) + if s == nil { return } if size > 0 { @@ -969,8 +982,8 @@ func (t *http2Client) handleData(f *http2.DataFrame) { } func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) { - s, ok := t.getStream(f) - if !ok { + s := t.getStream(f) + if s == nil { return } if f.ErrCode == http2.ErrCodeRefusedStream { @@ -1147,8 +1160,8 @@ func (t *http2Client) handleWindowUpdate(f *http2.WindowUpdateFrame) { // operateHeaders takes action on the decoded headers. func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { - s, ok := t.getStream(frame) - if !ok { + s := t.getStream(frame) + if s == nil { return } endStream := frame.StreamEnded() @@ -1177,12 +1190,14 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { inHeader := &stats.InHeader{ Client: true, WireLength: int(frame.Header().Length), + Header: s.header.Copy(), } t.statsHandler.HandleRPC(s.ctx, inHeader) } else { inTrailer := &stats.InTrailer{ Client: true, WireLength: int(frame.Header().Length), + Trailer: s.trailer.Copy(), } t.statsHandler.HandleRPC(s.ctx, inTrailer) } @@ -1191,6 +1206,7 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { // If headerChan hasn't been closed yet if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { + s.headerValid = true if !endStream { // HEADERS frame block carries a Response-Headers. isHeader = true @@ -1233,7 +1249,7 @@ func (t *http2Client) reader() { } t.conn.SetReadDeadline(time.Time{}) // reset deadline once we get the settings frame (we didn't time out, yay!) if t.keepaliveEnabled { - atomic.CompareAndSwapUint32(&t.activity, 0, 1) + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) } sf, ok := frame.(*http2.SettingsFrame) if !ok { @@ -1248,7 +1264,7 @@ func (t *http2Client) reader() { t.controlBuf.throttle() frame, err := t.framer.fr.ReadFrame() if t.keepaliveEnabled { - atomic.CompareAndSwapUint32(&t.activity, 0, 1) + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) } if err != nil { // Abort an active stream if the http2.Framer returns a @@ -1292,56 +1308,83 @@ func (t *http2Client) reader() { } } +func minTime(a, b time.Duration) time.Duration { + if a < b { + return a + } + return b +} + // keepalive running in a separate goroutune makes sure the connection is alive by sending pings. func (t *http2Client) keepalive() { p := &ping{data: [8]byte{}} + // True iff a ping has been sent, and no data has been received since then. + outstandingPing := false + // Amount of time remaining before which we should receive an ACK for the + // last sent ping. + timeoutLeft := time.Duration(0) + // Records the last value of t.lastRead before we go block on the timer. + // This is required to check for read activity since then. + prevNano := time.Now().UnixNano() timer := time.NewTimer(t.kp.Time) for { select { case <-timer.C: - if atomic.CompareAndSwapUint32(&t.activity, 1, 0) { - timer.Reset(t.kp.Time) + lastRead := atomic.LoadInt64(&t.lastRead) + if lastRead > prevNano { + // There has been read activity since the last time we were here. + outstandingPing = false + // Next timer should fire at kp.Time seconds from lastRead time. + timer.Reset(time.Duration(lastRead) + t.kp.Time - time.Duration(time.Now().UnixNano())) + prevNano = lastRead continue } - // Check if keepalive should go dormant. + if outstandingPing && timeoutLeft <= 0 { + t.Close() + return + } t.mu.Lock() - if len(t.activeStreams) < 1 && !t.kp.PermitWithoutStream { - // Make awakenKeepalive writable. - <-t.awakenKeepalive - t.mu.Unlock() - select { - case <-t.awakenKeepalive: - // If the control gets here a ping has been sent - // need to reset the timer with keepalive.Timeout. - case <-t.ctx.Done(): - return - } - } else { + if t.state == closing { + // If the transport is closing, we should exit from the + // keepalive goroutine here. If not, we could have a race + // between the call to Signal() from Close() and the call to + // Wait() here, whereby the keepalive goroutine ends up + // blocking on the condition variable which will never be + // signalled again. t.mu.Unlock() + return + } + if len(t.activeStreams) < 1 && !t.kp.PermitWithoutStream { + // If a ping was sent out previously (because there were active + // streams at that point) which wasn't acked and its timeout + // hadn't fired, but we got here and are about to go dormant, + // we should make sure that we unconditionally send a ping once + // we awaken. + outstandingPing = false + t.kpDormant = true + t.kpDormancyCond.Wait() + } + t.kpDormant = false + t.mu.Unlock() + + // We get here either because we were dormant and a new stream was + // created which unblocked the Wait() call, or because the + // keepalive timer expired. In both cases, we need to send a ping. + if !outstandingPing { if channelz.IsOn() { atomic.AddInt64(&t.czData.kpCount, 1) } - // Send ping. t.controlBuf.put(p) + timeoutLeft = t.kp.Timeout + outstandingPing = true } - - // By the time control gets here a ping has been sent one way or the other. - timer.Reset(t.kp.Timeout) - select { - case <-timer.C: - if atomic.CompareAndSwapUint32(&t.activity, 1, 0) { - timer.Reset(t.kp.Time) - continue - } - infof("transport: closing client transport due to idleness.") - t.Close() - return - case <-t.ctx.Done(): - if !timer.Stop() { - <-timer.C - } - return - } + // The amount of time to sleep here is the minimum of kp.Time and + // timeoutLeft. This will ensure that we wait only for kp.Time + // before sending out the next ping (for cases where the ping is + // acked). + sleepDuration := minTime(t.kp.Time, timeoutLeft) + timeoutLeft -= sleepDuration + timer.Reset(sleepDuration) case <-t.ctx.Done(): if !timer.Stop() { <-timer.C diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 83439b562..8b04b0392 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -62,11 +62,15 @@ var ( statusRawProto = internal.StatusRawProto.(func(*status.Status) *spb.Status) ) +// serverConnectionCounter counts the number of connections a server has seen +// (equal to the number of http2Servers created). Must be accessed atomically. +var serverConnectionCounter uint64 + // http2Server implements the ServerTransport interface with HTTP2. type http2Server struct { + lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. ctx context.Context - ctxDone <-chan struct{} // Cache the context.Done() chan - cancel context.CancelFunc + done chan struct{} conn net.Conn loopy *loopyWriter readerDone chan struct{} // sync point to enable testing. @@ -84,12 +88,8 @@ type http2Server struct { controlBuf *controlBuffer fc *trInFlow stats stats.Handler - // Flag to keep track of reading activity on transport. - // 1 is true and 0 is false. - activity uint32 // Accessed atomically. // Keepalive and max-age parameters for the server. kp keepalive.ServerParameters - // Keepalive enforcement policy. kep keepalive.EnforcementPolicy // The time instance last ping was received. @@ -125,6 +125,8 @@ type http2Server struct { channelzID int64 // channelz unique identification number czData *channelzData bufferPool *bufferPool + + connectionID uint64 } // newHTTP2Server constructs a ServerTransport based on HTTP2. ConnectionError is @@ -138,7 +140,10 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err } framer := newFramer(conn, writeBufSize, readBufSize, maxHeaderListSize) // Send initial settings as connection preface to client. - var isettings []http2.Setting + isettings := []http2.Setting{{ + ID: http2.SettingMaxFrameSize, + Val: http2MaxFrameLen, + }} // TODO(zhaoq): Have a better way to signal "no limit" because 0 is // permitted in the HTTP2 spec. maxStreams := config.MaxStreams @@ -172,6 +177,12 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err Val: *config.MaxHeaderListSize, }) } + if config.HeaderTableSize != nil { + isettings = append(isettings, http2.Setting{ + ID: http2.SettingHeaderTableSize, + Val: *config.HeaderTableSize, + }) + } if err := framer.fr.WriteSettings(isettings...); err != nil { return nil, connectionErrorf(false, err, "transport: %v", err) } @@ -203,11 +214,10 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err if kep.MinTime == 0 { kep.MinTime = defaultKeepalivePolicyMinTime } - ctx, cancel := context.WithCancel(context.Background()) + done := make(chan struct{}) t := &http2Server{ - ctx: ctx, - cancel: cancel, - ctxDone: ctx.Done(), + ctx: context.Background(), + done: done, conn: conn, remoteAddr: conn.RemoteAddr(), localAddr: conn.LocalAddr(), @@ -228,7 +238,7 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err czData: new(channelzData), bufferPool: newBufferPool(), } - t.controlBuf = newControlBuffer(t.ctxDone) + t.controlBuf = newControlBuffer(t.done) if dynamicWindow { t.bdpEst = &bdpEstimator{ bdp: initialWindowSize, @@ -246,6 +256,9 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err if channelz.IsOn() { t.channelzID = channelz.RegisterNormalSocket(t, config.ChannelzParentID, fmt.Sprintf("%s -> %s", t.remoteAddr, t.localAddr)) } + + t.connectionID = atomic.AddUint64(&serverConnectionCounter, 1) + t.framer.writer.Flush() defer func() { @@ -270,7 +283,7 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err if err != nil { return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to read initial settings frame: %v", err) } - atomic.StoreUint32(&t.activity, 1) + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) sf, ok := frame.(*http2.SettingsFrame) if !ok { return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams saw invalid preface type %T from client", frame) @@ -359,12 +372,14 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( rstCode: http2.ErrCodeRefusedStream, onWrite: func() {}, }) + s.cancel() return false } } t.mu.Lock() if t.state != reachable { t.mu.Unlock() + s.cancel() return false } if uint32(len(t.activeStreams)) >= t.maxStreams { @@ -375,12 +390,14 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( rstCode: http2.ErrCodeRefusedStream, onWrite: func() {}, }) + s.cancel() return false } if streamID%2 != 1 || streamID <= t.maxStreamID { t.mu.Unlock() // illegal gRPC stream id. errorf("transport: http2Server.HandleStreams received an illegal stream id: %v", streamID) + s.cancel() return true } t.maxStreamID = streamID @@ -405,6 +422,7 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( LocalAddr: t.localAddr, Compression: s.recvCompress, WireLength: int(frame.Header().Length), + Header: metadata.MD(state.data.mdata).Copy(), } t.stats.HandleRPC(s.ctx, inHeader) } @@ -438,7 +456,7 @@ func (t *http2Server) HandleStreams(handle func(*Stream), traceCtx func(context. for { t.controlBuf.throttle() frame, err := t.framer.fr.ReadFrame() - atomic.StoreUint32(&t.activity, 1) + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) if err != nil { if se, ok := err.(http2.StreamError); ok { warningf("transport: http2Server.HandleStreams encountered http2.StreamError: %v", se) @@ -746,7 +764,7 @@ func (t *http2Server) checkForHeaderListSize(it interface{}) bool { return true } -// WriteHeader sends the header metedata md back to the client. +// WriteHeader sends the header metadata md back to the client. func (t *http2Server) WriteHeader(s *Stream, md metadata.MD) error { if s.updateHeaderSent() || s.getState() == streamDone { return ErrIllegalHeaderWrite @@ -797,7 +815,9 @@ func (t *http2Server) writeHeaderLocked(s *Stream) error { if t.stats != nil { // Note: WireLength is not set in outHeader. // TODO(mmukhi): Revisit this later, if needed. - outHeader := &stats.OutHeader{} + outHeader := &stats.OutHeader{ + Header: s.header.Copy(), + } t.stats.HandleRPC(s.Context(), outHeader) } return nil @@ -860,7 +880,9 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error { rst := s.getState() == streamActive t.finishStream(s, rst, http2.ErrCodeNo, trailingHeader, true) if t.stats != nil { - t.stats.HandleRPC(s.Context(), &stats.OutTrailer{}) + t.stats.HandleRPC(s.Context(), &stats.OutTrailer{ + Trailer: s.trailer.Copy(), + }) } return nil } @@ -882,7 +904,7 @@ func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) e // TODO(mmukhi, dfawley): Should the server write also return io.EOF? s.cancel() select { - case <-t.ctx.Done(): + case <-t.done: return ErrConnClosing default: } @@ -904,7 +926,7 @@ func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) e } if err := s.wq.get(int32(len(hdr) + len(data))); err != nil { select { - case <-t.ctx.Done(): + case <-t.done: return ErrConnClosing default: } @@ -921,32 +943,35 @@ func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) e // after an additional duration of keepalive.Timeout. func (t *http2Server) keepalive() { p := &ping{} - var pingSent bool - maxIdle := time.NewTimer(t.kp.MaxConnectionIdle) - maxAge := time.NewTimer(t.kp.MaxConnectionAge) - keepalive := time.NewTimer(t.kp.Time) - // NOTE: All exit paths of this function should reset their - // respective timers. A failure to do so will cause the - // following clean-up to deadlock and eventually leak. + // True iff a ping has been sent, and no data has been received since then. + outstandingPing := false + // Amount of time remaining before which we should receive an ACK for the + // last sent ping. + kpTimeoutLeft := time.Duration(0) + // Records the last value of t.lastRead before we go block on the timer. + // This is required to check for read activity since then. + prevNano := time.Now().UnixNano() + // Initialize the different timers to their default values. + idleTimer := time.NewTimer(t.kp.MaxConnectionIdle) + ageTimer := time.NewTimer(t.kp.MaxConnectionAge) + kpTimer := time.NewTimer(t.kp.Time) defer func() { - if !maxIdle.Stop() { - <-maxIdle.C - } - if !maxAge.Stop() { - <-maxAge.C - } - if !keepalive.Stop() { - <-keepalive.C - } + // We need to drain the underlying channel in these timers after a call + // to Stop(), only if we are interested in resetting them. Clearly we + // are not interested in resetting them here. + idleTimer.Stop() + ageTimer.Stop() + kpTimer.Stop() }() + for { select { - case <-maxIdle.C: + case <-idleTimer.C: t.mu.Lock() idle := t.idle if idle.IsZero() { // The connection is non-idle. t.mu.Unlock() - maxIdle.Reset(t.kp.MaxConnectionIdle) + idleTimer.Reset(t.kp.MaxConnectionIdle) continue } val := t.kp.MaxConnectionIdle - time.Since(idle) @@ -955,44 +980,52 @@ func (t *http2Server) keepalive() { // The connection has been idle for a duration of keepalive.MaxConnectionIdle or more. // Gracefully close the connection. t.drain(http2.ErrCodeNo, []byte{}) - // Resetting the timer so that the clean-up doesn't deadlock. - maxIdle.Reset(infinity) return } - maxIdle.Reset(val) - case <-maxAge.C: + idleTimer.Reset(val) + case <-ageTimer.C: t.drain(http2.ErrCodeNo, []byte{}) - maxAge.Reset(t.kp.MaxConnectionAgeGrace) + ageTimer.Reset(t.kp.MaxConnectionAgeGrace) select { - case <-maxAge.C: + case <-ageTimer.C: // Close the connection after grace period. infof("transport: closing server transport due to maximum connection age.") t.Close() - // Resetting the timer so that the clean-up doesn't deadlock. - maxAge.Reset(infinity) - case <-t.ctx.Done(): + case <-t.done: } return - case <-keepalive.C: - if atomic.CompareAndSwapUint32(&t.activity, 1, 0) { - pingSent = false - keepalive.Reset(t.kp.Time) + case <-kpTimer.C: + lastRead := atomic.LoadInt64(&t.lastRead) + if lastRead > prevNano { + // There has been read activity since the last time we were + // here. Setup the timer to fire at kp.Time seconds from + // lastRead time and continue. + outstandingPing = false + kpTimer.Reset(time.Duration(lastRead) + t.kp.Time - time.Duration(time.Now().UnixNano())) + prevNano = lastRead continue } - if pingSent { + if outstandingPing && kpTimeoutLeft <= 0 { infof("transport: closing server transport due to idleness.") t.Close() - // Resetting the timer so that the clean-up doesn't deadlock. - keepalive.Reset(infinity) return } - pingSent = true - if channelz.IsOn() { - atomic.AddInt64(&t.czData.kpCount, 1) + if !outstandingPing { + if channelz.IsOn() { + atomic.AddInt64(&t.czData.kpCount, 1) + } + t.controlBuf.put(p) + kpTimeoutLeft = t.kp.Timeout + outstandingPing = true } - t.controlBuf.put(p) - keepalive.Reset(t.kp.Timeout) - case <-t.ctx.Done(): + // The amount of time to sleep here is the minimum of kp.Time and + // timeoutLeft. This will ensure that we wait only for kp.Time + // before sending out the next ping (for cases where the ping is + // acked). + sleepDuration := minTime(t.kp.Time, kpTimeoutLeft) + kpTimeoutLeft -= sleepDuration + kpTimer.Reset(sleepDuration) + case <-t.done: return } } @@ -1012,7 +1045,7 @@ func (t *http2Server) Close() error { t.activeStreams = nil t.mu.Unlock() t.controlBuf.finish() - t.cancel() + close(t.done) err := t.conn.Close() if channelz.IsOn() { channelz.RemoveEntry(t.channelzID) @@ -1152,7 +1185,7 @@ func (t *http2Server) outgoingGoAwayHandler(g *goAway) (bool, error) { select { case <-t.drainChan: case <-timer.C: - case <-t.ctx.Done(): + case <-t.done: return } t.controlBuf.put(&goAway{code: g.code, debugData: g.debugData}) @@ -1202,7 +1235,7 @@ func (t *http2Server) getOutFlowWindow() int64 { select { case sz := <-resp: return int64(sz) - case <-t.ctxDone: + case <-t.done: return -1 case <-timer.C: return -2 diff --git a/vendor/google.golang.org/grpc/internal/transport/http_util.go b/vendor/google.golang.org/grpc/internal/transport/http_util.go index 9d212867c..8f5f3349d 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http_util.go +++ b/vendor/google.golang.org/grpc/internal/transport/http_util.go @@ -667,6 +667,7 @@ func newFramer(conn net.Conn, writeBufferSize, readBufferSize int, maxHeaderList writer: w, fr: http2.NewFramer(w, r), } + f.fr.SetMaxReadFrameSize(http2MaxFrameLen) // Opt-in to Frame reuse API on framer to reduce garbage. // Frames aren't safe to read from after a subsequent call to ReadFrame. f.fr.SetReuseFrames() diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 1c1d10670..a30da9eb3 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -73,10 +73,11 @@ type recvMsg struct { } // recvBuffer is an unbounded channel of recvMsg structs. -// Note recvBuffer differs from controlBuffer only in that recvBuffer -// holds a channel of only recvMsg structs instead of objects implementing "item" interface. -// recvBuffer is written to much more often than -// controlBuffer and using strict recvMsg structs helps avoid allocation in "recvBuffer.put" +// +// Note: recvBuffer differs from buffer.Unbounded only in the fact that it +// holds a channel of recvMsg structs instead of objects implementing "item" +// interface. recvBuffer is written to much more often and using strict recvMsg +// structs helps avoid allocation in "recvBuffer.put" type recvBuffer struct { c chan recvMsg mu sync.Mutex @@ -233,6 +234,7 @@ const ( type Stream struct { id uint32 st ServerTransport // nil for client side Stream + ct *http2Client // nil for server side Stream ctx context.Context // the associated context of the stream cancel context.CancelFunc // always nil for client side Stream done chan struct{} // closed at the end of stream to unblock writers. On the client side. @@ -251,6 +253,10 @@ type Stream struct { headerChan chan struct{} // closed to indicate the end of header metadata. headerChanClosed uint32 // set when headerChan is closed. Used to avoid closing headerChan multiple times. + // headerValid indicates whether a valid header was received. Only + // meaningful after headerChan is closed (always call waitOnHeader() before + // reading its value). Not valid on server side. + headerValid bool // hdrMu protects header and trailer metadata on the server-side. hdrMu sync.Mutex @@ -303,34 +309,28 @@ func (s *Stream) getState() streamState { return streamState(atomic.LoadUint32((*uint32)(&s.state))) } -func (s *Stream) waitOnHeader() error { +func (s *Stream) waitOnHeader() { if s.headerChan == nil { // On the server headerChan is always nil since a stream originates // only after having received headers. - return nil + return } select { case <-s.ctx.Done(): - // We prefer success over failure when reading messages because we delay - // context error in stream.Read(). To keep behavior consistent, we also - // prefer success here. - select { - case <-s.headerChan: - return nil - default: - } - return ContextErr(s.ctx.Err()) + // Close the stream to prevent headers/trailers from changing after + // this function returns. + s.ct.CloseStream(s, ContextErr(s.ctx.Err())) + // headerChan could possibly not be closed yet if closeStream raced + // with operateHeaders; wait until it is closed explicitly here. + <-s.headerChan case <-s.headerChan: - return nil } } // RecvCompress returns the compression algorithm applied to the inbound // message. It is empty string if there is no compression applied. func (s *Stream) RecvCompress() string { - if err := s.waitOnHeader(); err != nil { - return "" - } + s.waitOnHeader() return s.recvCompress } @@ -351,36 +351,27 @@ func (s *Stream) Done() <-chan struct{} { // available. It blocks until i) the metadata is ready or ii) there is no header // metadata or iii) the stream is canceled/expired. // -// On server side, it returns the out header after t.WriteHeader is called. +// On server side, it returns the out header after t.WriteHeader is called. It +// does not block and must not be called until after WriteHeader. func (s *Stream) Header() (metadata.MD, error) { - if s.headerChan == nil && s.header != nil { + if s.headerChan == nil { // On server side, return the header in stream. It will be the out // header after t.WriteHeader is called. return s.header.Copy(), nil } - err := s.waitOnHeader() - // Even if the stream is closed, header is returned if available. - select { - case <-s.headerChan: - if s.header == nil { - return nil, nil - } - return s.header.Copy(), nil - default: + s.waitOnHeader() + if !s.headerValid { + return nil, s.status.Err() } - return nil, err + return s.header.Copy(), nil } // TrailersOnly blocks until a header or trailers-only frame is received and // then returns true if the stream was trailers-only. If the stream ends -// before headers are received, returns true, nil. If a context error happens -// first, returns it as a status error. Client-side only. -func (s *Stream) TrailersOnly() (bool, error) { - err := s.waitOnHeader() - if err != nil { - return false, err - } - return s.noHeaders, nil +// before headers are received, returns true, nil. Client-side only. +func (s *Stream) TrailersOnly() bool { + s.waitOnHeader() + return s.noHeaders } // Trailer returns the cached trailer metedata. Note that if it is not called @@ -534,6 +525,7 @@ type ServerConfig struct { ReadBufferSize int ChannelzParentID int64 MaxHeaderListSize *uint32 + HeaderTableSize *uint32 } // NewServerTransport creates a ServerTransport with conn or non-nil error diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go index 45baa2ae1..00447894f 100644 --- a/vendor/google.golang.org/grpc/picker_wrapper.go +++ b/vendor/google.golang.org/grpc/picker_wrapper.go @@ -20,6 +20,7 @@ package grpc import ( "context" + "fmt" "io" "sync" @@ -31,49 +32,78 @@ import ( "google.golang.org/grpc/status" ) +// v2PickerWrapper wraps a balancer.Picker while providing the +// balancer.V2Picker API. It requires a pickerWrapper to generate errors +// including the latest connectionError. To be deleted when balancer.Picker is +// updated to the balancer.V2Picker API. +type v2PickerWrapper struct { + picker balancer.Picker + connErr *connErr +} + +func (v *v2PickerWrapper) Pick(info balancer.PickInfo) (balancer.PickResult, error) { + sc, done, err := v.picker.Pick(info.Ctx, info) + if err != nil { + if err == balancer.ErrTransientFailure { + return balancer.PickResult{}, balancer.TransientFailureError(fmt.Errorf("%v, latest connection error: %v", err, v.connErr.connectionError())) + } + return balancer.PickResult{}, err + } + return balancer.PickResult{SubConn: sc, Done: done}, nil +} + // pickerWrapper is a wrapper of balancer.Picker. It blocks on certain pick // actions and unblock when there's a picker update. type pickerWrapper struct { mu sync.Mutex done bool blockingCh chan struct{} - picker balancer.Picker + picker balancer.V2Picker - // The latest connection happened. - connErrMu sync.Mutex - connErr error + // The latest connection error. TODO: remove when V1 picker is deprecated; + // balancer should be responsible for providing the error. + *connErr } -func newPickerWrapper() *pickerWrapper { - bp := &pickerWrapper{blockingCh: make(chan struct{})} - return bp +type connErr struct { + mu sync.Mutex + err error } -func (bp *pickerWrapper) updateConnectionError(err error) { - bp.connErrMu.Lock() - bp.connErr = err - bp.connErrMu.Unlock() +func (c *connErr) updateConnectionError(err error) { + c.mu.Lock() + c.err = err + c.mu.Unlock() } -func (bp *pickerWrapper) connectionError() error { - bp.connErrMu.Lock() - err := bp.connErr - bp.connErrMu.Unlock() +func (c *connErr) connectionError() error { + c.mu.Lock() + err := c.err + c.mu.Unlock() return err } +func newPickerWrapper() *pickerWrapper { + return &pickerWrapper{blockingCh: make(chan struct{}), connErr: &connErr{}} +} + // updatePicker is called by UpdateBalancerState. It unblocks all blocked pick. -func (bp *pickerWrapper) updatePicker(p balancer.Picker) { - bp.mu.Lock() - if bp.done { - bp.mu.Unlock() +func (pw *pickerWrapper) updatePicker(p balancer.Picker) { + pw.updatePickerV2(&v2PickerWrapper{picker: p, connErr: pw.connErr}) +} + +// updatePicker is called by UpdateBalancerState. It unblocks all blocked pick. +func (pw *pickerWrapper) updatePickerV2(p balancer.V2Picker) { + pw.mu.Lock() + if pw.done { + pw.mu.Unlock() return } - bp.picker = p - // bp.blockingCh should never be nil. - close(bp.blockingCh) - bp.blockingCh = make(chan struct{}) - bp.mu.Unlock() + pw.picker = p + // pw.blockingCh should never be nil. + close(pw.blockingCh) + pw.blockingCh = make(chan struct{}) + pw.mu.Unlock() } func doneChannelzWrapper(acw *acBalancerWrapper, done func(balancer.DoneInfo)) func(balancer.DoneInfo) { @@ -100,83 +130,85 @@ func doneChannelzWrapper(acw *acBalancerWrapper, done func(balancer.DoneInfo)) f // - the current picker returns other errors and failfast is false. // - the subConn returned by the current picker is not READY // When one of these situations happens, pick blocks until the picker gets updated. -func (bp *pickerWrapper) pick(ctx context.Context, failfast bool, opts balancer.PickOptions) (transport.ClientTransport, func(balancer.DoneInfo), error) { +func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.PickInfo) (transport.ClientTransport, func(balancer.DoneInfo), error) { var ch chan struct{} + var lastPickErr error for { - bp.mu.Lock() - if bp.done { - bp.mu.Unlock() + pw.mu.Lock() + if pw.done { + pw.mu.Unlock() return nil, nil, ErrClientConnClosing } - if bp.picker == nil { - ch = bp.blockingCh + if pw.picker == nil { + ch = pw.blockingCh } - if ch == bp.blockingCh { + if ch == pw.blockingCh { // This could happen when either: - // - bp.picker is nil (the previous if condition), or + // - pw.picker is nil (the previous if condition), or // - has called pick on the current picker. - bp.mu.Unlock() + pw.mu.Unlock() select { case <-ctx.Done(): - if connectionErr := bp.connectionError(); connectionErr != nil { - switch ctx.Err() { - case context.DeadlineExceeded: - return nil, nil, status.Errorf(codes.DeadlineExceeded, "latest connection error: %v", connectionErr) - case context.Canceled: - return nil, nil, status.Errorf(codes.Canceled, "latest connection error: %v", connectionErr) - } + var errStr string + if lastPickErr != nil { + errStr = "latest balancer error: " + lastPickErr.Error() + } else if connectionErr := pw.connectionError(); connectionErr != nil { + errStr = "latest connection error: " + connectionErr.Error() + } else { + errStr = ctx.Err().Error() + } + switch ctx.Err() { + case context.DeadlineExceeded: + return nil, nil, status.Error(codes.DeadlineExceeded, errStr) + case context.Canceled: + return nil, nil, status.Error(codes.Canceled, errStr) } - return nil, nil, ctx.Err() case <-ch: } continue } - ch = bp.blockingCh - p := bp.picker - bp.mu.Unlock() + ch = pw.blockingCh + p := pw.picker + pw.mu.Unlock() - subConn, done, err := p.Pick(ctx, opts) + pickResult, err := p.Pick(info) if err != nil { - switch err { - case balancer.ErrNoSubConnAvailable: + if err == balancer.ErrNoSubConnAvailable { continue - case balancer.ErrTransientFailure: + } + if tfe, ok := err.(interface{ IsTransientFailure() bool }); ok && tfe.IsTransientFailure() { if !failfast { + lastPickErr = err continue } - return nil, nil, status.Errorf(codes.Unavailable, "%v, latest connection error: %v", err, bp.connectionError()) - case context.DeadlineExceeded: - return nil, nil, status.Error(codes.DeadlineExceeded, err.Error()) - case context.Canceled: - return nil, nil, status.Error(codes.Canceled, err.Error()) - default: - if _, ok := status.FromError(err); ok { - return nil, nil, err - } - // err is some other error. - return nil, nil, status.Error(codes.Unknown, err.Error()) + return nil, nil, status.Error(codes.Unavailable, err.Error()) } + if _, ok := status.FromError(err); ok { + return nil, nil, err + } + // err is some other error. + return nil, nil, status.Error(codes.Unknown, err.Error()) } - acw, ok := subConn.(*acBalancerWrapper) + acw, ok := pickResult.SubConn.(*acBalancerWrapper) if !ok { grpclog.Error("subconn returned from pick is not *acBalancerWrapper") continue } if t, ok := acw.getAddrConn().getReadyTransport(); ok { if channelz.IsOn() { - return t, doneChannelzWrapper(acw, done), nil + return t, doneChannelzWrapper(acw, pickResult.Done), nil } - return t, done, nil + return t, pickResult.Done, nil } - if done != nil { + if pickResult.Done != nil { // Calling done with nil error, no bytes sent and no bytes received. // DoneInfo with default value works. - done(balancer.DoneInfo{}) + pickResult.Done(balancer.DoneInfo{}) } grpclog.Infof("blockingPicker: the picked transport is not ready, loop back to repick") // If ok == false, ac.state is not READY. @@ -186,12 +218,12 @@ func (bp *pickerWrapper) pick(ctx context.Context, failfast bool, opts balancer. } } -func (bp *pickerWrapper) close() { - bp.mu.Lock() - defer bp.mu.Unlock() - if bp.done { +func (pw *pickerWrapper) close() { + pw.mu.Lock() + defer pw.mu.Unlock() + if pw.done { return } - bp.done = true - close(bp.blockingCh) + pw.done = true + close(pw.blockingCh) } diff --git a/vendor/google.golang.org/grpc/pickfirst.go b/vendor/google.golang.org/grpc/pickfirst.go index ed05b02ed..c43dac9ad 100644 --- a/vendor/google.golang.org/grpc/pickfirst.go +++ b/vendor/google.golang.org/grpc/pickfirst.go @@ -19,12 +19,14 @@ package grpc import ( - "context" + "errors" "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/status" ) // PickFirstBalancerName is the name of the pick_first balancer. @@ -45,35 +47,67 @@ func (*pickfirstBuilder) Name() string { } type pickfirstBalancer struct { - cc balancer.ClientConn - sc balancer.SubConn + state connectivity.State + cc balancer.ClientConn + sc balancer.SubConn } +var _ balancer.V2Balancer = &pickfirstBalancer{} // Assert we implement v2 + func (b *pickfirstBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { if err != nil { - if grpclog.V(2) { - grpclog.Infof("pickfirstBalancer: HandleResolvedAddrs called with error %v", err) - } + b.ResolverError(err) return } + b.UpdateClientConnState(balancer.ClientConnState{ResolverState: resolver.State{Addresses: addrs}}) // Ignore error +} + +func (b *pickfirstBalancer) HandleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { + b.UpdateSubConnState(sc, balancer.SubConnState{ConnectivityState: s}) +} + +func (b *pickfirstBalancer) ResolverError(err error) { + switch b.state { + case connectivity.TransientFailure, connectivity.Idle, connectivity.Connecting: + // Set a failing picker if we don't have a good picker. + b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.TransientFailure, + Picker: &picker{err: status.Errorf(codes.Unavailable, "name resolver error: %v", err)}}, + ) + } + if grpclog.V(2) { + grpclog.Infof("pickfirstBalancer: ResolverError called with error %v", err) + } +} + +func (b *pickfirstBalancer) UpdateClientConnState(cs balancer.ClientConnState) error { + if len(cs.ResolverState.Addresses) == 0 { + b.ResolverError(errors.New("produced zero addresses")) + return balancer.ErrBadResolverState + } if b.sc == nil { - b.sc, err = b.cc.NewSubConn(addrs, balancer.NewSubConnOptions{}) + var err error + b.sc, err = b.cc.NewSubConn(cs.ResolverState.Addresses, balancer.NewSubConnOptions{}) if err != nil { - //TODO(yuxuanli): why not change the cc state to Idle? if grpclog.V(2) { grpclog.Errorf("pickfirstBalancer: failed to NewSubConn: %v", err) } - return + b.state = connectivity.TransientFailure + b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.TransientFailure, + Picker: &picker{err: status.Errorf(codes.Unavailable, "error creating connection: %v", err)}}, + ) + return balancer.ErrBadResolverState } - b.cc.UpdateBalancerState(connectivity.Idle, &picker{sc: b.sc}) + b.state = connectivity.Idle + b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.Idle, Picker: &picker{result: balancer.PickResult{SubConn: b.sc}}}) b.sc.Connect() } else { - b.sc.UpdateAddresses(addrs) + b.sc.UpdateAddresses(cs.ResolverState.Addresses) b.sc.Connect() } + return nil } -func (b *pickfirstBalancer) HandleSubConnStateChange(sc balancer.SubConn, s connectivity.State) { +func (b *pickfirstBalancer) UpdateSubConnState(sc balancer.SubConn, s balancer.SubConnState) { if grpclog.V(2) { grpclog.Infof("pickfirstBalancer: HandleSubConnStateChange: %p, %v", sc, s) } @@ -83,18 +117,28 @@ func (b *pickfirstBalancer) HandleSubConnStateChange(sc balancer.SubConn, s conn } return } - if s == connectivity.Shutdown { + b.state = s.ConnectivityState + if s.ConnectivityState == connectivity.Shutdown { b.sc = nil return } - switch s { + switch s.ConnectivityState { case connectivity.Ready, connectivity.Idle: - b.cc.UpdateBalancerState(s, &picker{sc: sc}) + b.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: &picker{result: balancer.PickResult{SubConn: sc}}}) case connectivity.Connecting: - b.cc.UpdateBalancerState(s, &picker{err: balancer.ErrNoSubConnAvailable}) + b.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: &picker{err: balancer.ErrNoSubConnAvailable}}) case connectivity.TransientFailure: - b.cc.UpdateBalancerState(s, &picker{err: balancer.ErrTransientFailure}) + err := balancer.ErrTransientFailure + // TODO: this can be unconditional after the V1 API is removed, as + // SubConnState will always contain a connection error. + if s.ConnectionError != nil { + err = balancer.TransientFailureError(s.ConnectionError) + } + b.cc.UpdateState(balancer.State{ + ConnectivityState: s.ConnectivityState, + Picker: &picker{err: err}, + }) } } @@ -102,15 +146,12 @@ func (b *pickfirstBalancer) Close() { } type picker struct { - err error - sc balancer.SubConn + result balancer.PickResult + err error } -func (p *picker) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) { - if p.err != nil { - return nil, nil, p.err - } - return p.sc, nil, nil +func (p *picker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { + return p.result, p.err } func init() { diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index e83da346a..fe14b2fb9 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -21,6 +21,11 @@ package resolver import ( + "context" + "net" + + "google.golang.org/grpc/attributes" + "google.golang.org/grpc/credentials" "google.golang.org/grpc/serviceconfig" ) @@ -69,12 +74,18 @@ func GetDefaultScheme() string { } // AddressType indicates the address type returned by name resolution. +// +// Deprecated: use Attributes in Address instead. type AddressType uint8 const ( // Backend indicates the address is for a backend server. + // + // Deprecated: use Attributes in Address instead. Backend AddressType = iota // GRPCLB indicates the address is for a grpclb load balancer. + // + // Deprecated: use Attributes in Address instead. GRPCLB ) @@ -83,33 +94,75 @@ const ( type Address struct { // Addr is the server address on which a connection will be established. Addr string - // Type is the type of this address. - Type AddressType + // ServerName is the name of this address. + // If non-empty, the ServerName is used as the transport certification authority for + // the address, instead of the hostname from the Dial target string. In most cases, + // this should not be set. // - // e.g. if Type is GRPCLB, ServerName should be the name of the remote load + // If Type is GRPCLB, ServerName should be the name of the remote load // balancer, not the name of the backend. + // + // WARNING: ServerName must only be populated with trusted values. It + // is insecure to populate it with data from untrusted inputs since untrusted + // values could be used to bypass the authority checks performed by TLS. ServerName string + + // Attributes contains arbitrary data about this address intended for + // consumption by the load balancing policy. + Attributes *attributes.Attributes + + // Type is the type of this address. + // + // Deprecated: use Attributes instead. + Type AddressType + // Metadata is the information associated with Addr, which may be used // to make load balancing decision. + // + // Deprecated: use Attributes instead. Metadata interface{} } -// BuildOption includes additional information for the builder to create +// BuildOptions includes additional information for the builder to create // the resolver. -type BuildOption struct { - // DisableServiceConfig indicates whether resolver should fetch service config data. +type BuildOptions struct { + // DisableServiceConfig indicates whether a resolver implementation should + // fetch service config data. DisableServiceConfig bool + // DialCreds is the transport credentials used by the ClientConn for + // communicating with the target gRPC service (set via + // WithTransportCredentials). In cases where a name resolution service + // requires the same credentials, the resolver may use this field. In most + // cases though, it is not appropriate, and this field may be ignored. + DialCreds credentials.TransportCredentials + // CredsBundle is the credentials bundle used by the ClientConn for + // communicating with the target gRPC service (set via + // WithCredentialsBundle). In cases where a name resolution service + // requires the same credentials, the resolver may use this field. In most + // cases though, it is not appropriate, and this field may be ignored. + CredsBundle credentials.Bundle + // Dialer is the custom dialer used by the ClientConn for dialling the + // target gRPC service (set via WithDialer). In cases where a name + // resolution service requires the same dialer, the resolver may use this + // field. In most cases though, it is not appropriate, and this field may + // be ignored. + Dialer func(context.Context, string) (net.Conn, error) } // State contains the current Resolver state relevant to the ClientConn. type State struct { - Addresses []Address // Resolved addresses for the target - // ServiceConfig is the parsed service config; obtained from - // serviceconfig.Parse. - ServiceConfig serviceconfig.Config + // Addresses is the latest set of resolved addresses for the target. + Addresses []Address + + // ServiceConfig contains the result from parsing the latest service + // config. If it is nil, it indicates no service config is present or the + // resolver does not provide service configs. + ServiceConfig *serviceconfig.ParseResult - // TODO: add Err error + // Attributes contains arbitrary data about the resolver intended for + // consumption by the load balancing policy. + Attributes *attributes.Attributes } // ClientConn contains the callbacks for resolver to notify any updates @@ -122,6 +175,10 @@ type State struct { type ClientConn interface { // UpdateState updates the state of the ClientConn appropriately. UpdateState(State) + // ReportError notifies the ClientConn that the Resolver encountered an + // error. The ClientConn will notify the load balancer and begin calling + // ResolveNow on the Resolver with exponential backoff. + ReportError(error) // NewAddress is called by resolver to notify ClientConn a new list // of resolved addresses. // The address list should be the complete list of resolved addresses. @@ -133,6 +190,9 @@ type ClientConn interface { // // Deprecated: Use UpdateState instead. NewServiceConfig(serviceConfig string) + // ParseServiceConfig parses the provided service config and returns an + // object that provides the parsed config. + ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult } // Target represents a target for gRPC, as specified in: @@ -164,14 +224,14 @@ type Builder interface { // // gRPC dial calls Build synchronously, and fails if the returned error is // not nil. - Build(target Target, cc ClientConn, opts BuildOption) (Resolver, error) + Build(target Target, cc ClientConn, opts BuildOptions) (Resolver, error) // Scheme returns the scheme supported by this resolver. // Scheme is defined at https://github.com/grpc/grpc/blob/master/doc/naming.md. Scheme() string } -// ResolveNowOption includes additional information for ResolveNow. -type ResolveNowOption struct{} +// ResolveNowOptions includes additional information for ResolveNow. +type ResolveNowOptions struct{} // Resolver watches for the updates on the specified target. // Updates include address updates and service config updates. @@ -180,7 +240,7 @@ type Resolver interface { // again. It's just a hint, resolver can ignore this if it's not necessary. // // It could be called multiple times concurrently. - ResolveNow(ResolveNowOption) + ResolveNow(ResolveNowOptions) // Close closes the resolver. Close() } diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go index 6934905b0..3eaf724cd 100644 --- a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go +++ b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go @@ -21,22 +21,29 @@ package grpc import ( "fmt" "strings" - "sync/atomic" + "sync" + "time" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/serviceconfig" ) // ccResolverWrapper is a wrapper on top of cc for resolvers. -// It implements resolver.ClientConnection interface. +// It implements resolver.ClientConn interface. type ccResolverWrapper struct { - cc *ClientConn - resolver resolver.Resolver - addrCh chan []resolver.Address - scCh chan string - done uint32 // accessed atomically; set to 1 when closed. - curState resolver.State + cc *ClientConn + resolverMu sync.Mutex + resolver resolver.Resolver + done *grpcsync.Event + curState resolver.State + + pollingMu sync.Mutex + polling chan struct{} } // split2 returns the values from strings.SplitN(s, sep, 2). @@ -67,60 +74,126 @@ func parseTarget(target string) (ret resolver.Target) { return ret } -// newCCResolverWrapper parses cc.target for scheme and gets the resolver -// builder for this scheme and builds the resolver. The monitoring goroutine -// for it is not started yet and can be created by calling start(). -// -// If withResolverBuilder dial option is set, the specified resolver will be -// used instead. -func newCCResolverWrapper(cc *ClientConn) (*ccResolverWrapper, error) { - rb := cc.dopts.resolverBuilder - if rb == nil { - return nil, fmt.Errorf("could not get resolver for scheme: %q", cc.parsedTarget.Scheme) +// newCCResolverWrapper uses the resolver.Builder to build a Resolver and +// returns a ccResolverWrapper object which wraps the newly built resolver. +func newCCResolverWrapper(cc *ClientConn, rb resolver.Builder) (*ccResolverWrapper, error) { + ccr := &ccResolverWrapper{ + cc: cc, + done: grpcsync.NewEvent(), } - ccr := &ccResolverWrapper{ - cc: cc, - addrCh: make(chan []resolver.Address, 1), - scCh: make(chan string, 1), + var credsClone credentials.TransportCredentials + if creds := cc.dopts.copts.TransportCredentials; creds != nil { + credsClone = creds.Clone() + } + rbo := resolver.BuildOptions{ + DisableServiceConfig: cc.dopts.disableServiceConfig, + DialCreds: credsClone, + CredsBundle: cc.dopts.copts.CredsBundle, + Dialer: cc.dopts.copts.Dialer, } var err error - ccr.resolver, err = rb.Build(cc.parsedTarget, ccr, resolver.BuildOption{DisableServiceConfig: cc.dopts.disableServiceConfig}) + // We need to hold the lock here while we assign to the ccr.resolver field + // to guard against a data race caused by the following code path, + // rb.Build-->ccr.ReportError-->ccr.poll-->ccr.resolveNow, would end up + // accessing ccr.resolver which is being assigned here. + ccr.resolverMu.Lock() + defer ccr.resolverMu.Unlock() + ccr.resolver, err = rb.Build(cc.parsedTarget, ccr, rbo) if err != nil { return nil, err } return ccr, nil } -func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOption) { - ccr.resolver.ResolveNow(o) +func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOptions) { + ccr.resolverMu.Lock() + if !ccr.done.HasFired() { + ccr.resolver.ResolveNow(o) + } + ccr.resolverMu.Unlock() } func (ccr *ccResolverWrapper) close() { + ccr.resolverMu.Lock() ccr.resolver.Close() - atomic.StoreUint32(&ccr.done, 1) + ccr.done.Fire() + ccr.resolverMu.Unlock() } -func (ccr *ccResolverWrapper) isDone() bool { - return atomic.LoadUint32(&ccr.done) == 1 +// poll begins or ends asynchronous polling of the resolver based on whether +// err is ErrBadResolverState. +func (ccr *ccResolverWrapper) poll(err error) { + ccr.pollingMu.Lock() + defer ccr.pollingMu.Unlock() + if err != balancer.ErrBadResolverState { + // stop polling + if ccr.polling != nil { + close(ccr.polling) + ccr.polling = nil + } + return + } + if ccr.polling != nil { + // already polling + return + } + p := make(chan struct{}) + ccr.polling = p + go func() { + for i := 0; ; i++ { + ccr.resolveNow(resolver.ResolveNowOptions{}) + t := time.NewTimer(ccr.cc.dopts.resolveNowBackoff(i)) + select { + case <-p: + t.Stop() + return + case <-ccr.done.Done(): + // Resolver has been closed. + t.Stop() + return + case <-t.C: + select { + case <-p: + return + default: + } + // Timer expired; re-resolve. + } + } + }() } func (ccr *ccResolverWrapper) UpdateState(s resolver.State) { - if ccr.isDone() { + if ccr.done.HasFired() { return } grpclog.Infof("ccResolverWrapper: sending update to cc: %v", s) if channelz.IsOn() { ccr.addChannelzTraceEvent(s) } - ccr.cc.updateResolverState(s) ccr.curState = s + ccr.poll(ccr.cc.updateResolverState(ccr.curState, nil)) +} + +func (ccr *ccResolverWrapper) ReportError(err error) { + if ccr.done.HasFired() { + return + } + grpclog.Warningf("ccResolverWrapper: reporting error to cc: %v", err) + if channelz.IsOn() { + channelz.AddTraceEvent(ccr.cc.channelzID, &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Resolver reported error: %v", err), + Severity: channelz.CtWarning, + }) + } + ccr.poll(ccr.cc.updateResolverState(resolver.State{}, err)) } // NewAddress is called by the resolver implementation to send addresses to gRPC. func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { - if ccr.isDone() { + if ccr.done.HasFired() { return } grpclog.Infof("ccResolverWrapper: sending new addresses to cc: %v", addrs) @@ -128,31 +201,53 @@ func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { ccr.addChannelzTraceEvent(resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig}) } ccr.curState.Addresses = addrs - ccr.cc.updateResolverState(ccr.curState) + ccr.poll(ccr.cc.updateResolverState(ccr.curState, nil)) } // NewServiceConfig is called by the resolver implementation to send service // configs to gRPC. func (ccr *ccResolverWrapper) NewServiceConfig(sc string) { - if ccr.isDone() { + if ccr.done.HasFired() { return } grpclog.Infof("ccResolverWrapper: got new service config: %v", sc) - c, err := parseServiceConfig(sc) - if err != nil { + if ccr.cc.dopts.disableServiceConfig { + grpclog.Infof("Service config lookups disabled; ignoring config") + return + } + scpr := parseServiceConfig(sc) + if scpr.Err != nil { + grpclog.Warningf("ccResolverWrapper: error parsing service config: %v", scpr.Err) + if channelz.IsOn() { + channelz.AddTraceEvent(ccr.cc.channelzID, &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Error parsing service config: %v", scpr.Err), + Severity: channelz.CtWarning, + }) + } + ccr.poll(balancer.ErrBadResolverState) return } if channelz.IsOn() { - ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: c}) + ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: scpr}) } - ccr.curState.ServiceConfig = c - ccr.cc.updateResolverState(ccr.curState) + ccr.curState.ServiceConfig = scpr + ccr.poll(ccr.cc.updateResolverState(ccr.curState, nil)) +} + +func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult { + return parseServiceConfig(scJSON) } func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { var updates []string - oldSC, oldOK := ccr.curState.ServiceConfig.(*ServiceConfig) - newSC, newOK := s.ServiceConfig.(*ServiceConfig) + var oldSC, newSC *ServiceConfig + var oldOK, newOK bool + if ccr.curState.ServiceConfig != nil { + oldSC, oldOK = ccr.curState.ServiceConfig.Config.(*ServiceConfig) + } + if s.ServiceConfig != nil { + newSC, newOK = s.ServiceConfig.Config.(*ServiceConfig) + } if oldOK != newOK || (oldOK && newOK && oldSC.rawJSONString != newSC.rawJSONString) { updates = append(updates, "service config updated") } diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index 088c3f1b2..d3a4adc5e 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -648,35 +648,58 @@ func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxRecei return nil, st.Err() } + var size int if pf == compressionMade { // To match legacy behavior, if the decompressor is set by WithDecompressor or RPCDecompressor, // use this decompressor as the default. if dc != nil { d, err = dc.Do(bytes.NewReader(d)) - if err != nil { - return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) - } + size = len(d) } else { - dcReader, err := compressor.Decompress(bytes.NewReader(d)) - if err != nil { - return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) - } - // Read from LimitReader with limit max+1. So if the underlying - // reader is over limit, the result will be bigger than max. - d, err = ioutil.ReadAll(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) - if err != nil { - return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) - } + d, size, err = decompress(compressor, d, maxReceiveMessageSize) } + if err != nil { + return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) + } + } else { + size = len(d) } - if len(d) > maxReceiveMessageSize { + if size > maxReceiveMessageSize { // TODO: Revisit the error code. Currently keep it consistent with java // implementation. - return nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", len(d), maxReceiveMessageSize) + return nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", size, maxReceiveMessageSize) } return d, nil } +// Using compressor, decompress d, returning data and size. +// Optionally, if data will be over maxReceiveMessageSize, just return the size. +func decompress(compressor encoding.Compressor, d []byte, maxReceiveMessageSize int) ([]byte, int, error) { + dcReader, err := compressor.Decompress(bytes.NewReader(d)) + if err != nil { + return nil, 0, err + } + if sizer, ok := compressor.(interface { + DecompressedSize(compressedBytes []byte) int + }); ok { + if size := sizer.DecompressedSize(d); size >= 0 { + if size > maxReceiveMessageSize { + return nil, size, nil + } + // size is used as an estimate to size the buffer, but we + // will read more data if available. + // +MinRead so ReadFrom will not reallocate if size is correct. + buf := bytes.NewBuffer(make([]byte, 0, size+bytes.MinRead)) + bytesRead, err := buf.ReadFrom(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) + return buf.Bytes(), int(bytesRead), err + } + } + // Read from LimitReader with limit max+1. So if the underlying + // reader is over limit, the result will be bigger than max. + d, err = ioutil.ReadAll(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) + return d, len(d), err +} + // For the two compressor parameters, both should not be set, but if they are, // dc takes precedence over compressor. // TODO(dfawley): wrap the old compressor/decompressor using the new API? @@ -848,7 +871,7 @@ type channelzData struct { // The SupportPackageIsVersion variables are referenced from generated protocol // buffer files to ensure compatibility with the gRPC version used. The latest -// support package version is 5. +// support package version is 6. // // Older versions are kept for compatibility. They may be removed if // compatibility cannot be maintained. @@ -858,6 +881,7 @@ const ( SupportPackageIsVersion3 = true SupportPackageIsVersion4 = true SupportPackageIsVersion5 = true + SupportPackageIsVersion6 = true ) const grpcUA = "grpc-go/" + Version diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index f064b73e5..0d75cb109 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -130,6 +130,7 @@ type serverOptions struct { readBufferSize int connectionTimeout time.Duration maxHeaderListSize *uint32 + headerTableSize *uint32 } var defaultServerOptions = serverOptions{ @@ -343,8 +344,8 @@ func StatsHandler(h stats.Handler) ServerOption { // unknown service handler. The provided method is a bidi-streaming RPC service // handler that will be invoked instead of returning the "unimplemented" gRPC // error whenever a request is received for an unregistered service or method. -// The handling function has full access to the Context of the request and the -// stream, and the invocation bypasses interceptors. +// The handling function and stream interceptor (if set) have full access to +// the ServerStream, including its Context. func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.unknownStreamDesc = &StreamDesc{ @@ -377,6 +378,16 @@ func MaxHeaderListSize(s uint32) ServerOption { }) } +// HeaderTableSize returns a ServerOption that sets the size of dynamic +// header table for stream. +// +// This API is EXPERIMENTAL. +func HeaderTableSize(s uint32) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.headerTableSize = &s + }) +} + // NewServer creates a gRPC server which has no service registered and has not // started to accept requests yet. func NewServer(opt ...ServerOption) *Server { @@ -686,6 +697,7 @@ func (s *Server) newHTTP2Transport(c net.Conn, authInfo credentials.AuthInfo) tr ReadBufferSize: s.opts.readBufferSize, ChannelzParentID: s.channelzID, MaxHeaderListSize: s.opts.maxHeaderListSize, + HeaderTableSize: s.opts.headerTableSize, } st, err := transport.NewServerTransport("http2", c, config) if err != nil { @@ -853,41 +865,58 @@ func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Str } func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, md *MethodDesc, trInfo *traceInfo) (err error) { - if channelz.IsOn() { - s.incrCallsStarted() - defer func() { - if err != nil && err != io.EOF { - s.incrCallsFailed() - } else { - s.incrCallsSucceeded() - } - }() - } sh := s.opts.statsHandler - if sh != nil { - beginTime := time.Now() - begin := &stats.Begin{ - BeginTime: beginTime, + if sh != nil || trInfo != nil || channelz.IsOn() { + if channelz.IsOn() { + s.incrCallsStarted() } - sh.HandleRPC(stream.Context(), begin) - defer func() { - end := &stats.End{ + var statsBegin *stats.Begin + if sh != nil { + beginTime := time.Now() + statsBegin = &stats.Begin{ BeginTime: beginTime, - EndTime: time.Now(), - } - if err != nil && err != io.EOF { - end.Error = toRPCErr(err) } - sh.HandleRPC(stream.Context(), end) - }() - } - if trInfo != nil { - defer trInfo.tr.Finish() - trInfo.tr.LazyLog(&trInfo.firstLine, false) + sh.HandleRPC(stream.Context(), statsBegin) + } + if trInfo != nil { + trInfo.tr.LazyLog(&trInfo.firstLine, false) + } + // The deferred error handling for tracing, stats handler and channelz are + // combined into one function to reduce stack usage -- a defer takes ~56-64 + // bytes on the stack, so overflowing the stack will require a stack + // re-allocation, which is expensive. + // + // To maintain behavior similar to separate deferred statements, statements + // should be executed in the reverse order. That is, tracing first, stats + // handler second, and channelz last. Note that panics *within* defers will + // lead to different behavior, but that's an acceptable compromise; that + // would be undefined behavior territory anyway. defer func() { - if err != nil && err != io.EOF { - trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) - trInfo.tr.SetError() + if trInfo != nil { + if err != nil && err != io.EOF { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } + trInfo.tr.Finish() + } + + if sh != nil { + end := &stats.End{ + BeginTime: statsBegin.BeginTime, + EndTime: time.Now(), + } + if err != nil && err != io.EOF { + end.Error = toRPCErr(err) + } + sh.HandleRPC(stream.Context(), end) + } + + if channelz.IsOn() { + if err != nil && err != io.EOF { + s.incrCallsFailed() + } else { + s.incrCallsSucceeded() + } } }() } @@ -1087,31 +1116,15 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport. func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, sd *StreamDesc, trInfo *traceInfo) (err error) { if channelz.IsOn() { s.incrCallsStarted() - defer func() { - if err != nil && err != io.EOF { - s.incrCallsFailed() - } else { - s.incrCallsSucceeded() - } - }() } sh := s.opts.statsHandler + var statsBegin *stats.Begin if sh != nil { beginTime := time.Now() - begin := &stats.Begin{ + statsBegin = &stats.Begin{ BeginTime: beginTime, } - sh.HandleRPC(stream.Context(), begin) - defer func() { - end := &stats.End{ - BeginTime: beginTime, - EndTime: time.Now(), - } - if err != nil && err != io.EOF { - end.Error = toRPCErr(err) - } - sh.HandleRPC(stream.Context(), end) - }() + sh.HandleRPC(stream.Context(), statsBegin) } ctx := NewContextWithServerTransportStream(stream.Context(), stream) ss := &serverStream{ @@ -1126,6 +1139,41 @@ func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transp statsHandler: sh, } + if sh != nil || trInfo != nil || channelz.IsOn() { + // See comment in processUnaryRPC on defers. + defer func() { + if trInfo != nil { + ss.mu.Lock() + if err != nil && err != io.EOF { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } + ss.trInfo.tr.Finish() + ss.trInfo.tr = nil + ss.mu.Unlock() + } + + if sh != nil { + end := &stats.End{ + BeginTime: statsBegin.BeginTime, + EndTime: time.Now(), + } + if err != nil && err != io.EOF { + end.Error = toRPCErr(err) + } + sh.HandleRPC(stream.Context(), end) + } + + if channelz.IsOn() { + if err != nil && err != io.EOF { + s.incrCallsFailed() + } else { + s.incrCallsSucceeded() + } + } + }() + } + ss.binlog = binarylog.GetMethodLogger(stream.Method()) if ss.binlog != nil { md, _ := metadata.FromIncomingContext(ctx) @@ -1179,16 +1227,6 @@ func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transp if trInfo != nil { trInfo.tr.LazyLog(&trInfo.firstLine, false) - defer func() { - ss.mu.Lock() - if err != nil && err != io.EOF { - ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) - ss.trInfo.tr.SetError() - } - ss.trInfo.tr.Finish() - ss.trInfo.tr = nil - ss.mu.Unlock() - }() } var appErr error var server interface{} diff --git a/vendor/google.golang.org/grpc/service_config.go b/vendor/google.golang.org/grpc/service_config.go index d0787f1e2..5a80a575a 100644 --- a/vendor/google.golang.org/grpc/service_config.go +++ b/vendor/google.golang.org/grpc/service_config.go @@ -136,9 +136,9 @@ type retryPolicy struct { maxAttempts int // Exponential backoff parameters. The initial retry attempt will occur at - // random(0, initialBackoffMS). In general, the nth attempt will occur at + // random(0, initialBackoff). In general, the nth attempt will occur at // random(0, - // min(initialBackoffMS*backoffMultiplier**(n-1), maxBackoffMS)). + // min(initialBackoff*backoffMultiplier**(n-1), maxBackoff)). // // These fields are required and must be greater than zero. initialBackoff time.Duration @@ -261,20 +261,17 @@ type jsonSC struct { } func init() { - internal.ParseServiceConfig = func(sc string) (interface{}, error) { - return parseServiceConfig(sc) - } + internal.ParseServiceConfigForTesting = parseServiceConfig } - -func parseServiceConfig(js string) (*ServiceConfig, error) { +func parseServiceConfig(js string) *serviceconfig.ParseResult { if len(js) == 0 { - return nil, fmt.Errorf("no JSON service config provided") + return &serviceconfig.ParseResult{Err: fmt.Errorf("no JSON service config provided")} } var rsc jsonSC err := json.Unmarshal([]byte(js), &rsc) if err != nil { grpclog.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err) - return nil, err + return &serviceconfig.ParseResult{Err: err} } sc := ServiceConfig{ LB: rsc.LoadBalancingPolicy, @@ -288,7 +285,7 @@ func parseServiceConfig(js string) (*ServiceConfig, error) { if len(lbcfg) != 1 { err := fmt.Errorf("invalid loadBalancingConfig: entry %v does not contain exactly 1 policy/config pair: %q", i, lbcfg) grpclog.Warningf(err.Error()) - return nil, err + return &serviceconfig.ParseResult{Err: err} } var name string var jsonCfg json.RawMessage @@ -303,17 +300,25 @@ func parseServiceConfig(js string) (*ServiceConfig, error) { var err error sc.lbConfig.cfg, err = parser.ParseConfig(jsonCfg) if err != nil { - return nil, fmt.Errorf("error parsing loadBalancingConfig for policy %q: %v", name, err) + return &serviceconfig.ParseResult{Err: fmt.Errorf("error parsing loadBalancingConfig for policy %q: %v", name, err)} } } else if string(jsonCfg) != "{}" { grpclog.Warningf("non-empty balancer configuration %q, but balancer does not implement ParseConfig", string(jsonCfg)) } break } + if sc.lbConfig == nil { + // We had a loadBalancingConfig field but did not encounter a + // supported policy. The config is considered invalid in this + // case. + err := fmt.Errorf("invalid loadBalancingConfig: no supported policies found") + grpclog.Warningf(err.Error()) + return &serviceconfig.ParseResult{Err: err} + } } if rsc.MethodConfig == nil { - return &sc, nil + return &serviceconfig.ParseResult{Config: &sc} } for _, m := range *rsc.MethodConfig { if m.Name == nil { @@ -322,7 +327,7 @@ func parseServiceConfig(js string) (*ServiceConfig, error) { d, err := parseDuration(m.Timeout) if err != nil { grpclog.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err) - return nil, err + return &serviceconfig.ParseResult{Err: err} } mc := MethodConfig{ @@ -331,7 +336,7 @@ func parseServiceConfig(js string) (*ServiceConfig, error) { } if mc.retryPolicy, err = convertRetryPolicy(m.RetryPolicy); err != nil { grpclog.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err) - return nil, err + return &serviceconfig.ParseResult{Err: err} } if m.MaxRequestMessageBytes != nil { if *m.MaxRequestMessageBytes > int64(maxInt) { @@ -356,13 +361,13 @@ func parseServiceConfig(js string) (*ServiceConfig, error) { if sc.retryThrottling != nil { if mt := sc.retryThrottling.MaxTokens; mt <= 0 || mt > 1000 { - return nil, fmt.Errorf("invalid retry throttling config: maxTokens (%v) out of range (0, 1000]", mt) + return &serviceconfig.ParseResult{Err: fmt.Errorf("invalid retry throttling config: maxTokens (%v) out of range (0, 1000]", mt)} } if tr := sc.retryThrottling.TokenRatio; tr <= 0 { - return nil, fmt.Errorf("invalid retry throttling config: tokenRatio (%v) may not be negative", tr) + return &serviceconfig.ParseResult{Err: fmt.Errorf("invalid retry throttling config: tokenRatio (%v) may not be negative", tr)} } } - return &sc, nil + return &serviceconfig.ParseResult{Config: &sc} } func convertRetryPolicy(jrp *jsonRetryPolicy) (p *retryPolicy, err error) { diff --git a/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go b/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go index 53b27875a..187c30442 100644 --- a/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go +++ b/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go @@ -22,27 +22,20 @@ // This package is EXPERIMENTAL. package serviceconfig -import ( - "google.golang.org/grpc/internal" -) - // Config represents an opaque data structure holding a service config. type Config interface { - isConfig() + isServiceConfig() } // LoadBalancingConfig represents an opaque data structure holding a load -// balancer config. +// balancing config. type LoadBalancingConfig interface { isLoadBalancingConfig() } -// Parse parses the JSON service config provided into an internal form or -// returns an error if the config is invalid. -func Parse(ServiceConfigJSON string) (Config, error) { - c, err := internal.ParseServiceConfig(ServiceConfigJSON) - if err != nil { - return nil, err - } - return c.(Config), err +// ParseResult contains a service config or an error. Exactly one must be +// non-nil. +type ParseResult struct { + Config Config + Err error } diff --git a/vendor/google.golang.org/grpc/stats/stats.go b/vendor/google.golang.org/grpc/stats/stats.go index f3f593c84..9e22c393f 100644 --- a/vendor/google.golang.org/grpc/stats/stats.go +++ b/vendor/google.golang.org/grpc/stats/stats.go @@ -91,6 +91,8 @@ type InHeader struct { LocalAddr net.Addr // Compression is the compression algorithm used for the RPC. Compression string + // Header contains the header metadata received. + Header metadata.MD } // IsClient indicates if the stats information is from client side. @@ -104,6 +106,9 @@ type InTrailer struct { Client bool // WireLength is the wire length of trailer. WireLength int + // Trailer contains the trailer metadata received from the server. This + // field is only valid if this InTrailer is from the client side. + Trailer metadata.MD } // IsClient indicates if the stats information is from client side. @@ -146,6 +151,8 @@ type OutHeader struct { LocalAddr net.Addr // Compression is the compression algorithm used for the RPC. Compression string + // Header contains the header metadata sent. + Header metadata.MD } // IsClient indicates if this stats information is from client side. @@ -159,6 +166,9 @@ type OutTrailer struct { Client bool // WireLength is the wire length of trailer. WireLength int + // Trailer contains the trailer metadata sent to the client. This + // field is only valid if this OutTrailer is from the server side. + Trailer metadata.MD } // IsClient indicates if this stats information is from client side. @@ -176,6 +186,7 @@ type End struct { EndTime time.Time // Trailer contains the trailer metadata received from the server. This // field is only valid if this End is from the client side. + // Deprecated: use Trailer in InTrailer instead. Trailer metadata.MD // Error is the error the RPC ended with. It is an error generated from // status.Status and can be converted back to status.Status using diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 134a624a1..bb99940e3 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -488,7 +488,7 @@ func (cs *clientStream) shouldRetry(err error) error { pushback := 0 hasPushback := false if cs.attempt.s != nil { - if to, toErr := cs.attempt.s.TrailersOnly(); toErr != nil || !to { + if !cs.attempt.s.TrailersOnly() { return err } diff --git a/vendor/google.golang.org/grpc/test/bufconn/bufconn.go b/vendor/google.golang.org/grpc/test/bufconn/bufconn.go index 60ae770f5..168cdb857 100644 --- a/vendor/google.golang.org/grpc/test/bufconn/bufconn.go +++ b/vendor/google.golang.org/grpc/test/bufconn/bufconn.go @@ -37,7 +37,16 @@ type Listener struct { done chan struct{} } +// Implementation of net.Error providing timeout +type netErrorTimeout struct { + error +} + +func (e netErrorTimeout) Timeout() bool { return true } +func (e netErrorTimeout) Temporary() bool { return false } + var errClosed = fmt.Errorf("closed") +var errTimeout net.Error = netErrorTimeout{error: fmt.Errorf("i/o timeout")} // Listen returns a Listener that can only be contacted by its own Dialers and // creates buffered connections between the two. @@ -104,6 +113,13 @@ type pipe struct { wwait sync.Cond rwait sync.Cond + // Indicate that a write/read timeout has occurred + wtimedout bool + rtimedout bool + + wtimer *time.Timer + rtimer *time.Timer + closed bool writeClosed bool } @@ -112,6 +128,9 @@ func newPipe(sz int) *pipe { p := &pipe{buf: make([]byte, 0, sz)} p.wwait.L = &p.mu p.rwait.L = &p.mu + + p.wtimer = time.AfterFunc(0, func() {}) + p.rtimer = time.AfterFunc(0, func() {}) return p } @@ -137,6 +156,10 @@ func (p *pipe) Read(b []byte) (n int, err error) { if p.writeClosed { return 0, io.EOF } + if p.rtimedout { + return 0, errTimeout + } + p.rwait.Wait() } wasFull := p.full() @@ -171,6 +194,10 @@ func (p *pipe) Write(b []byte) (n int, err error) { if !p.full() { break } + if p.wtimedout { + return 0, errTimeout + } + p.wwait.Wait() } wasEmpty := p.empty() @@ -232,11 +259,48 @@ func (c *conn) Close() error { return err2 } -func (*conn) LocalAddr() net.Addr { return addr{} } -func (*conn) RemoteAddr() net.Addr { return addr{} } -func (c *conn) SetDeadline(t time.Time) error { return fmt.Errorf("unsupported") } -func (c *conn) SetReadDeadline(t time.Time) error { return fmt.Errorf("unsupported") } -func (c *conn) SetWriteDeadline(t time.Time) error { return fmt.Errorf("unsupported") } +func (c *conn) SetDeadline(t time.Time) error { + c.SetReadDeadline(t) + c.SetWriteDeadline(t) + return nil +} + +func (c *conn) SetReadDeadline(t time.Time) error { + p := c.Reader.(*pipe) + p.mu.Lock() + defer p.mu.Unlock() + p.rtimer.Stop() + p.rtimedout = false + if !t.IsZero() { + p.rtimer = time.AfterFunc(time.Until(t), func() { + p.mu.Lock() + defer p.mu.Unlock() + p.rtimedout = true + p.rwait.Broadcast() + }) + } + return nil +} + +func (c *conn) SetWriteDeadline(t time.Time) error { + p := c.Writer.(*pipe) + p.mu.Lock() + defer p.mu.Unlock() + p.wtimer.Stop() + p.wtimedout = false + if !t.IsZero() { + p.wtimer = time.AfterFunc(time.Until(t), func() { + p.mu.Lock() + defer p.mu.Unlock() + p.wtimedout = true + p.wwait.Broadcast() + }) + } + return nil +} + +func (*conn) LocalAddr() net.Addr { return addr{} } +func (*conn) RemoteAddr() net.Addr { return addr{} } type addr struct{} diff --git a/vendor/google.golang.org/grpc/trace.go b/vendor/google.golang.org/grpc/trace.go index 0a57b9994..07a2d26b3 100644 --- a/vendor/google.golang.org/grpc/trace.go +++ b/vendor/google.golang.org/grpc/trace.go @@ -41,9 +41,6 @@ func methodFamily(m string) string { if i := strings.Index(m, "/"); i >= 0 { m = m[:i] // remove everything from second slash } - if i := strings.LastIndex(m, "."); i >= 0 { - m = m[i+1:] // cut down to last dotted component - } return m } diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 5411a73a2..1a831b159 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.23.0" +const Version = "1.27.1" diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh index 661e1e1de..0e7370727 100644 --- a/vendor/google.golang.org/grpc/vet.sh +++ b/vendor/google.golang.org/grpc/vet.sh @@ -31,12 +31,15 @@ PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}" if [[ "$1" = "-install" ]]; then # Check for module support if go help mod >& /dev/null; then + # Install the pinned versions as defined in module tools. + pushd ./test/tools go install \ golang.org/x/lint/golint \ golang.org/x/tools/cmd/goimports \ honnef.co/go/tools/cmd/staticcheck \ github.com/client9/misspell/cmd/misspell \ github.com/golang/protobuf/protoc-gen-go + popd else # Ye olde `go get` incantation. # Note: this gets the latest version of all tools (vs. the pinned versions @@ -67,18 +70,21 @@ elif [[ "$#" -ne 0 ]]; then fi # - Ensure all source files contain a copyright message. -git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" 2>&1 | fail_on_output +(! git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" -- '*.go') # - Make sure all tests in grpc and grpc/test use leakcheck via Teardown. (! grep 'func Test[^(]' *_test.go) (! grep 'func Test[^(]' test/*.go) +# - Do not import x/net/context. +(! git grep -l 'x/net/context' -- "*.go") + # - Do not import math/rand for real library code. Use internal/grpcrand for # thread safety. -git ls-files "*.go" | xargs grep -l '"math/rand"' 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|wrr_test') +git grep -l '"math/rand"' -- "*.go" 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|^benchmark\|wrr_test') # - Ensure all ptypes proto packages are renamed when importing. -git ls-files "*.go" | (! xargs grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/") +(! git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go") # - Check imports that are illegal in appengine (until Go 1.11). # TODO: Remove when we drop Go 1.10 support @@ -86,10 +92,12 @@ go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go # - gofmt, goimports, golint (with exceptions for generated code), go vet. gofmt -s -d -l . 2>&1 | fail_on_output -goimports -l . 2>&1 | (! grep -vE "(_mock|\.pb)\.go:") | fail_on_output +goimports -l . 2>&1 | (! grep -vE "(_mock|\.pb)\.go") golint ./... 2>&1 | (! grep -vE "(_mock|\.pb)\.go:") go vet -all . +misspell -error . + # - Check that generated proto files are up to date. if [[ -z "${VET_SKIP_PROTO}" ]]; then PATH="/home/travis/bin:${PATH}" make proto && \ @@ -105,30 +113,47 @@ if go help mod >& /dev/null; then fi # - Collection of static analysis checks -# TODO(dfawley): don't use deprecated functions in examples. -staticcheck -go 1.9 -checks 'inherit,-ST1015' -ignore ' -google.golang.org/grpc/balancer.go:SA1019 -google.golang.org/grpc/balancer/grpclb/grpclb_remote_balancer.go:SA1019 -google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go:SA1019 -google.golang.org/grpc/xds/internal/balancer/edsbalancer/balancergroup.go:SA1019 -google.golang.org/grpc/xds/internal/balancer/xds.go:SA1019 -google.golang.org/grpc/xds/internal/balancer/xds_client.go:SA1019 -google.golang.org/grpc/balancer_conn_wrappers.go:SA1019 -google.golang.org/grpc/balancer_test.go:SA1019 -google.golang.org/grpc/benchmark/benchmain/main.go:SA1019 -google.golang.org/grpc/benchmark/worker/benchmark_client.go:SA1019 -google.golang.org/grpc/clientconn.go:S1024 -google.golang.org/grpc/clientconn_state_transition_test.go:SA1019 -google.golang.org/grpc/clientconn_test.go:SA1019 -google.golang.org/grpc/examples/features/debugging/client/main.go:SA1019 -google.golang.org/grpc/examples/features/load_balancing/client/main.go:SA1019 -google.golang.org/grpc/internal/transport/handler_server.go:SA1019 -google.golang.org/grpc/internal/transport/handler_server_test.go:SA1019 -google.golang.org/grpc/resolver/dns/dns_resolver.go:SA1019 -google.golang.org/grpc/stats/stats_test.go:SA1019 -google.golang.org/grpc/test/balancer_test.go:SA1019 -google.golang.org/grpc/test/channelz_test.go:SA1019 -google.golang.org/grpc/test/end2end_test.go:SA1019 -google.golang.org/grpc/test/healthcheck_test.go:SA1019 -' ./... -misspell -error . +# +# TODO(dfawley): don't use deprecated functions in examples or first-party +# plugins. +SC_OUT="$(mktemp)" +staticcheck -go 1.9 -checks 'inherit,-ST1015' ./... > "${SC_OUT}" || true +# Error if anything other than deprecation warnings are printed. +(! grep -v "is deprecated:.*SA1019" "${SC_OUT}") +# Only ignore the following deprecated types/fields/functions. +(! grep -Fv '.HandleResolvedAddrs +.HandleSubConnStateChange +.HeaderMap +.NewAddress +.NewServiceConfig +.Metadata is deprecated: use Attributes +.Type is deprecated: use Attributes +.UpdateBalancerState +balancer.Picker +grpc.CallCustomCodec +grpc.Code +grpc.Compressor +grpc.Decompressor +grpc.MaxMsgSize +grpc.MethodConfig +grpc.NewGZIPCompressor +grpc.NewGZIPDecompressor +grpc.RPCCompressor +grpc.RPCDecompressor +grpc.RoundRobin +grpc.ServiceConfig +grpc.WithBalancer +grpc.WithBalancerName +grpc.WithCompressor +grpc.WithDecompressor +grpc.WithDialer +grpc.WithMaxMsgSize +grpc.WithServiceConfig +grpc.WithTimeout +http.CloseNotifier +naming.Resolver +naming.Update +naming.Watcher +resolver.Backend +resolver.GRPCLB' "${SC_OUT}" +) diff --git a/vendor/modules.txt b/vendor/modules.txt index df5f87c6c..0c771d30d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -14,7 +14,7 @@ github.com/apparentlymart/go-cidr/cidr github.com/apparentlymart/go-textseg/textseg # github.com/armon/go-radix v1.0.0 github.com/armon/go-radix -# github.com/aws/aws-sdk-go v1.19.39 +# github.com/aws/aws-sdk-go v1.25.3 github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws/credentials github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds @@ -46,7 +46,9 @@ github.com/aws/aws-sdk-go/private/protocol/restxml github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil github.com/aws/aws-sdk-go/internal/sdkrand github.com/aws/aws-sdk-go/service/sts +github.com/aws/aws-sdk-go/service/sts/stsiface github.com/aws/aws-sdk-go/aws/credentials/endpointcreds +github.com/aws/aws-sdk-go/internal/sdkmath github.com/aws/aws-sdk-go/private/protocol/query github.com/aws/aws-sdk-go/private/protocol/json/jsonutil github.com/aws/aws-sdk-go/private/protocol/query/queryutil @@ -62,14 +64,14 @@ github.com/davecgh/go-spew/spew github.com/fatih/color # github.com/gibson042/canonicaljson-go v1.0.3 github.com/gibson042/canonicaljson-go -# github.com/golang/protobuf v1.3.2 +# github.com/golang/protobuf v1.3.4 github.com/golang/protobuf/proto github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp github.com/golang/protobuf/protoc-gen-go/descriptor -# github.com/google/go-cmp v0.3.0 +# github.com/google/go-cmp v0.3.1 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags @@ -111,24 +113,24 @@ github.com/hashicorp/hcl/hcl/scanner github.com/hashicorp/hcl/hcl/strconv github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/token -# github.com/hashicorp/hcl2 v0.0.0-20190821123243-0c888d1241f6 -github.com/hashicorp/hcl2/hcl -github.com/hashicorp/hcl2/hcl/hclsyntax -github.com/hashicorp/hcl2/hcldec -github.com/hashicorp/hcl2/ext/typeexpr -github.com/hashicorp/hcl2/gohcl -github.com/hashicorp/hcl2/hclparse -github.com/hashicorp/hcl2/ext/dynblock -github.com/hashicorp/hcl2/hcled -github.com/hashicorp/hcl2/hclwrite -github.com/hashicorp/hcl2/hcl/json -# github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 -github.com/hashicorp/hil/ast +# github.com/hashicorp/hcl/v2 v2.0.0 +github.com/hashicorp/hcl/v2 +github.com/hashicorp/hcl/v2/hcldec +github.com/hashicorp/hcl/v2/hclsyntax +github.com/hashicorp/hcl/v2/ext/typeexpr +github.com/hashicorp/hcl/v2/gohcl +github.com/hashicorp/hcl/v2/hclparse +github.com/hashicorp/hcl/v2/ext/dynblock +github.com/hashicorp/hcl/v2/hcled +github.com/hashicorp/hcl/v2/hclwrite +github.com/hashicorp/hcl/v2/json # github.com/hashicorp/logutils v1.0.0 github.com/hashicorp/logutils -# github.com/hashicorp/terraform-config-inspect v0.0.0-20190821133035-82a99dc22ef4 +# github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 github.com/hashicorp/terraform-config-inspect/tfconfig -# github.com/hashicorp/terraform-plugin-sdk v1.1.0 +# github.com/hashicorp/terraform-json v0.4.0 +github.com/hashicorp/terraform-json +# github.com/hashicorp/terraform-plugin-sdk v1.12.0 github.com/hashicorp/terraform-plugin-sdk/plugin github.com/hashicorp/terraform-plugin-sdk/terraform github.com/hashicorp/terraform-plugin-sdk/helper/hashcode @@ -155,6 +157,7 @@ github.com/hashicorp/terraform-plugin-sdk/internal/states github.com/hashicorp/terraform-plugin-sdk/internal/states/statefile github.com/hashicorp/terraform-plugin-sdk/internal/tfdiags github.com/hashicorp/terraform-plugin-sdk/internal/version +github.com/hashicorp/terraform-plugin-sdk/acctest github.com/hashicorp/terraform-plugin-sdk/helper/logging github.com/hashicorp/terraform-plugin-sdk/internal/command/format github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload @@ -165,21 +168,26 @@ github.com/hashicorp/terraform-plugin-sdk/internal/httpclient github.com/hashicorp/terraform-plugin-sdk/internal/registry github.com/hashicorp/terraform-plugin-sdk/internal/registry/regsrc github.com/hashicorp/terraform-plugin-sdk/internal/registry/response -github.com/hashicorp/terraform-plugin-sdk/internal/svchost/disco github.com/hashicorp/terraform-plugin-sdk/internal/lang/blocktoattr github.com/hashicorp/terraform-plugin-sdk/internal/lang/funcs github.com/hashicorp/terraform-plugin-sdk/internal/modsdir github.com/hashicorp/terraform-plugin-sdk/internal/flatmap github.com/hashicorp/terraform-plugin-sdk/internal/earlyconfig -github.com/hashicorp/terraform-plugin-sdk/internal/svchost -github.com/hashicorp/terraform-plugin-sdk/internal/svchost/auth +github.com/hashicorp/terraform-plugin-sdk/httpclient +github.com/hashicorp/terraform-plugin-sdk/meta +# github.com/hashicorp/terraform-plugin-test v1.3.0 +github.com/hashicorp/terraform-plugin-test +# github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 +github.com/hashicorp/terraform-svchost/disco +github.com/hashicorp/terraform-svchost +github.com/hashicorp/terraform-svchost/auth # github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hashicorp/yamux # github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af github.com/jmespath/go-jmespath -# github.com/mattn/go-colorable v0.0.9 +# github.com/mattn/go-colorable v0.1.1 github.com/mattn/go-colorable -# github.com/mattn/go-isatty v0.0.4 +# github.com/mattn/go-isatty v0.0.5 github.com/mattn/go-isatty # github.com/mitchellh/cli v1.0.0 github.com/mitchellh/cli @@ -212,7 +220,7 @@ github.com/ulikunitz/xz github.com/ulikunitz/xz/internal/xlog github.com/ulikunitz/xz/lzma github.com/ulikunitz/xz/internal/hash -# github.com/vmihailenco/msgpack v3.3.3+incompatible +# github.com/vmihailenco/msgpack v4.0.1+incompatible github.com/vmihailenco/msgpack github.com/vmihailenco/msgpack/codes # github.com/vmware/go-vmware-nsxt v0.0.0-20191219213550-f4221331f638 @@ -274,7 +282,17 @@ github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/tier_1s github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/tier_1s/locale_services github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/tier_1s/nat github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model -# github.com/zclconf/go-cty v1.1.0 +# github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm v0.2.0 +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/domains +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/realized_state +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/segments +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_0s +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/global_infra/tier_1s +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/model +github.com/vmware/vsphere-automation-sdk-go/services/nsxt-gm/search +# github.com/zclconf/go-cty v1.2.1 github.com/zclconf/go-cty/cty github.com/zclconf/go-cty/cty/msgpack github.com/zclconf/go-cty/cty/convert @@ -371,13 +389,13 @@ google.golang.org/appengine/datastore/internal/cloudpb google.golang.org/appengine/internal/base google.golang.org/appengine/internal/log google.golang.org/appengine/internal/remote_api -# google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 +# google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a google.golang.org/genproto/googleapis/rpc/status google.golang.org/genproto/googleapis/iam/v1 google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/type/expr -# google.golang.org/grpc v1.23.0 +# google.golang.org/grpc v1.27.1 google.golang.org/grpc google.golang.org/grpc/test/bufconn google.golang.org/grpc/credentials @@ -385,7 +403,9 @@ google.golang.org/grpc/health google.golang.org/grpc/health/grpc_health_v1 google.golang.org/grpc/codes google.golang.org/grpc/status +google.golang.org/grpc/backoff google.golang.org/grpc/balancer +google.golang.org/grpc/balancer/base google.golang.org/grpc/balancer/roundrobin google.golang.org/grpc/connectivity google.golang.org/grpc/encoding @@ -395,22 +415,23 @@ google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff google.golang.org/grpc/internal/balancerload google.golang.org/grpc/internal/binarylog +google.golang.org/grpc/internal/buffer google.golang.org/grpc/internal/channelz google.golang.org/grpc/internal/envconfig google.golang.org/grpc/internal/grpcrand google.golang.org/grpc/internal/grpcsync +google.golang.org/grpc/internal/resolver/dns +google.golang.org/grpc/internal/resolver/passthrough google.golang.org/grpc/internal/transport google.golang.org/grpc/keepalive google.golang.org/grpc/metadata google.golang.org/grpc/naming google.golang.org/grpc/peer google.golang.org/grpc/resolver -google.golang.org/grpc/resolver/dns -google.golang.org/grpc/resolver/passthrough google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/tap google.golang.org/grpc/credentials/internal -google.golang.org/grpc/balancer/base google.golang.org/grpc/binarylog/grpc_binarylog_v1 google.golang.org/grpc/internal/syscall +google.golang.org/grpc/attributes diff --git a/website/docs/d/policy_edge_cluster.html.markdown b/website/docs/d/policy_edge_cluster.html.markdown index 844b62c3d..c4984d168 100644 --- a/website/docs/d/policy_edge_cluster.html.markdown +++ b/website/docs/d/policy_edge_cluster.html.markdown @@ -17,12 +17,27 @@ data "nsxt_policy_edge_cluster" "ec" { } ``` +Note: This usage is for Global Manager only. +```hcl + +data "nsxt_policy_site" "paris" { + display_name = "Paris" +} + +data "nsxt_policy_edge_cluster" "gm_ec" { + display_name = "ec" + site_path = data.nsxt_policy_site.paris.path +} +``` + ## Argument Reference * `id` - (Optional) The ID of the edge cluster to retrieve. * `display_name` - (Optional) The Display Name prefix of the edge cluster to retrieve. +* `site_path` - (Optional) The path of the site which the Edge Cluster belongs to, this configuration is required for global manager only. `path` field of the existing `nsxt_policy_site` can be used here. + ## Attributes Reference In addition to arguments listed above, the following attributes are exported: diff --git a/website/docs/d/policy_realization_info.html.markdown b/website/docs/d/policy_realization_info.html.markdown index 9e0a63f22..a4ce235d0 100644 --- a/website/docs/d/policy_realization_info.html.markdown +++ b/website/docs/d/policy_realization_info.html.markdown @@ -22,12 +22,32 @@ data "nsxt_policy_realization_info" "info" { } ``` +## Global Manager Example + +```hcl +data "nsxt_policy_tier1_gateway" "tier1_gw" { + display_name = "tier1_gw" +} + +data "nsxt_policy_site" "site" { + display_name = "Paris" +} + +data "nsxt_policy_gm_realization_info" "info" { + path = data.nsxt_policy_tier1_gateway.tier1_gw.path + entity_type = "RealizedLogicalRouter" + site_path = data.nsxt_policy_site.site.path +} +``` + ## Argument Reference * `path` - (Required) The policy path of the resource. * `entity_type` - (Optional) The entity type of realized resource. If not set, on of the realized resources of the policy resource will be retrieved. +* `site_path` - (Optional) The path of the site which the resource belongs to, this configuration is required for global manager only. `path` field of the existing `nsxt_policy_site` can be used here. + ## Attributes Reference In addition to arguments listed above, the following attributes are exported: diff --git a/website/docs/d/policy_site.html.markdown b/website/docs/d/policy_site.html.markdown new file mode 100644 index 000000000..32c0949f9 --- /dev/null +++ b/website/docs/d/policy_site.html.markdown @@ -0,0 +1,33 @@ +--- +layout: "nsxt" +page_title: "NSXT: policy_site" +sidebar_current: "docs-nsxt-datasource-policy-site" +description: Policy Site data source. +--- + +# nsxt_policy_site + +This data source provides information about Site (or Region) configured in NSX Global Manager. This data source is applicable for Global Manager provider only. + +## Example Usage + +```hcl +data "nsxt_policy_site" "paris" { + display_name = "Paris" +} +``` + +## Argument Reference + +* `id` - (Optional) The ID of Site to retrieve. + +* `display_name` - (Optional) The Display Name prefix of the Site to retrieve. + + +## Attributes Reference + +In addition to arguments listed above, the following attributes are exported: + +* `description` - The description of the resource. + +* `path` - The NSX path of the policy resource. This attribute can serve as `site_path` field of `nsxt_policy_transport_zone` data source. diff --git a/website/docs/d/policy_transport_zone.html.markdown b/website/docs/d/policy_transport_zone.html.markdown index a0bed10e6..d7748a158 100644 --- a/website/docs/d/policy_transport_zone.html.markdown +++ b/website/docs/d/policy_transport_zone.html.markdown @@ -24,12 +24,25 @@ data "nsxt_policy_transport_zone" "vlan_transport_zone" { } ``` +Note: This usage is for Global Manager only. +```hcl +data "nsxt_policy_site" "paris" { + display_name = "Paris" +} + +data "nsxt_policy_transport_zone" "overlay_transport_zone" { + display_name = "1-transportzone-87" + site_path = data.nsxt_policy_site.paris.path +} +``` + ## Argument Reference * `id` - (Optional) The ID of Transport Zone to retrieve. * `display_name` - (Optional) The Display Name prefix of the Transport Zone to retrieve. * `transport_type` - (Optional) Transport type of requested Transport Zone, one of `OVERLAY_STANDARD`, `OVERLAY_ENS`, `VLAN_BACKED` and `UNKNOWN`. * `is_default` - (Optional) May be set together with `transport_type` in order to retrieve default Transport Zone for for this transport type. +* `site_path` - (Optional) The path of the site which the Transport Zone belongs to, this configuration is required for global manager only. `path` field of the existing `nsxt_policy_site` can be used here. ## Attributes Reference diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index d5ddfa451..6571aacff 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -123,6 +123,18 @@ provider "nsxt" { ``` +### Policy Global Manager Example + +```hcl +provider "nsxt" { + host = "192.168.110.41" + username = "admin" + password = "default" + global_manager = true +} + +``` + ## Argument Reference The following arguments are used to configure the VMware NSX-T Provider: @@ -177,6 +189,8 @@ The following arguments are used to configure the VMware NSX-T Provider: * `enforcement_point` - (Optional) Enforcement point, mostly relevant for policy data sources. For VMC environment, this should be set to `vmc-enforcementpoint`. For on-prem deployments, this setting should not be specified. +* `global_manager` - (Optional) True if this is a global manager endpoint. + False by default. ## NSX Logical Networking diff --git a/website/docs/r/policy_gateway_policy.html.markdown b/website/docs/r/policy_gateway_policy.html.markdown index a2e596553..df6592b0b 100644 --- a/website/docs/r/policy_gateway_policy.html.markdown +++ b/website/docs/r/policy_gateway_policy.html.markdown @@ -72,7 +72,6 @@ The following arguments are supported: * `tag` - (Optional) A list of scope + tag pairs to associate with this Rule. * `action` - (Optional) The action for the Rule. Must be one of: `ALLOW`, `DROP` or `REJECT`. Defaults to `ALLOW`. - ## Attributes Reference In addition to arguments listed above, the following attributes are exported: diff --git a/website/docs/r/policy_group.html.markdown b/website/docs/r/policy_group.html.markdown index 6d595b996..0f96a5bc0 100644 --- a/website/docs/r/policy_group.html.markdown +++ b/website/docs/r/policy_group.html.markdown @@ -43,13 +43,50 @@ resource "nsxt_policy_group" "group1" { } ``` +Note: This usage is for Global Manager only +```hcl +data "nsxt_policy_site" "paris" { + display_name = "Paris" +} +resource "nsxt_policy_group" "group1" { + display_name = "tf-group1" + description = "Terraform provisioned Group" + domain = data.nsxt_policy_site.paris.id + + criteria { + condition { + key = "Name" + member_type = "VirtualMachine" + operator = "STARTSWITH" + value = "public" + } + condition { + key = "OSName" + member_type = "VirtualMachine" + operator = "CONTAINS" + value = "Ubuntu" + } + } + + conjunction { + operator = "OR" + } + + criteria { + ipaddress_expression { + ip_addresses = ["211.1.1.1", "212.1.1.1", "192.168.1.1-192.168.1.100"] + } + } +} +``` + ## Argument Reference The following arguments are supported: * `display_name` - (Required) Display name of the resource. * `description` - (Optional) Description of the resource. -* `domain` - (Optional) The domain to use for the Group. This domain must already exist. For VMware Cloud on AWS use `cgw`. +* `domain` - (Optional) The domain to use for the Group. This domain must already exist. For VMware Cloud on AWS use `cgw`. For Global Manager, please use site id for this field. If not specified, this field is default to `default`. * `tag` - (Optional) A list of scope + tag pairs to associate with this Group. * `nsx_id` - (Optional) The NSX ID of this resource. If set, this ID will be used to create the group resource. * `criteria` - (Optional) A repeatable block to specify criteria for members of this Group. If more than 1 criteria block is specified, it must be separated by a `conjunction`. In a `criteria` block the following membership selection expressions can be used: diff --git a/website/docs/r/policy_security_policy.html.markdown b/website/docs/r/policy_security_policy.html.markdown index 68c97c585..d54bbc157 100644 --- a/website/docs/r/policy_security_policy.html.markdown +++ b/website/docs/r/policy_security_policy.html.markdown @@ -43,13 +43,49 @@ resource "nsxt_policy_security_policy" "policy1" { } ``` +Note: This usage is for Global Manager only +```hcl +data "nsxt_policy_site" "paris" { + display_name = "Paris" +} +resource "nsxt_policy_security_policy" "policy1" { + display_name = "policy1" + description = "Terraform provisioned Security Policy" + category = "Application" + locked = false + stateful = true + tcp_strict = false + scope = [nsxt_policy_group.pets.path] + domain = data.nsxt_policy_site.paris.id + + rule { + display_name = "block_icmp" + destination_groups = [nsxt_policy_group.cats.path, nsxt_policy_group.dogs.path] + action = "DROP" + services = [nsxt_policy_service.icmp.path] + logged = true + } + + rule { + display_name = "allow_udp" + source_groups = [nsxt_policy_group.fish.path] + sources_excluded = true + scope = [nsxt_policy_group.aquarium.path] + action = "ALLOW" + services = [nsxt_policy_service.udp.path] + logged = true + disabled = true + notes = "Disabled by starfish for debugging" + } +} + ## Argument Reference The following arguments are supported: * `display_name` - (Required) Display name of the resource. * `description` - (Optional) Description of the resource. -* `domain` - (Optional) The domain to use for the resource. This domain must already exist. For VMware Cloud on AWS use `cgw`. +* `domain` - (Optional) The domain to use for the resource. This domain must already exist. For VMware Cloud on AWS use `cgw`. For Global Manager, please use site id for this field. If not specified, this field is default to `default`. * `tag` - (Optional) A list of scope + tag pairs to associate with this policy. * `nsx_id` - (Optional) The NSX ID of this resource. If set, this ID will be used to create the resource. * `category` - (Required) Category of this policy, one of `Ethernet`, `Emergency`, `Infrastructure`, `Environment`, `Application`. diff --git a/website/docs/r/policy_tier0_gateway.html.markdown b/website/docs/r/policy_tier0_gateway.html.markdown index 552d79cee..050520299 100644 --- a/website/docs/r/policy_tier0_gateway.html.markdown +++ b/website/docs/r/policy_tier0_gateway.html.markdown @@ -56,6 +56,34 @@ resource "nsxt_policy_tier0_gateway" "tier0_gw" { } ``` +## Global manager example usage +```hcl +resource "nsxt_policy_tier0_gateway" "tier0_gw" { + description = "Tier-0 provisioned by Terraform" + display_name = "Tier0-gw1" + failover_mode = "PREEMPTIVE" + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.paris.path + } + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.london.path + preferred_edge_paths = [data.nsxt_policy_egde_node.edge1.path] + } + + intersite_config { + primary_site_path = data.nsxt_policy_site.paris.path + } + + tag { + scope = "color" + tag = "blue" + } +} +``` + + ## Argument Reference The following arguments are supported: @@ -64,7 +92,10 @@ The following arguments are supported: * `description` - (Optional) Description of the resource. * `tag` - (Optional) A list of scope + tag pairs to associate with this Tier-0 gateway. * `nsx_id` - (Optional) The NSX ID of this resource. If set, this ID will be used to create the policy resource. -* `edge_cluster_path` - (Optional) The path of the edge cluster where the Tier-0 is placed. Must be specified when `bgp_config` is enabled. +* `edge_cluster_path` - (Optional) The path of the edge cluster where the Tier-0 is placed. Must be specified when `bgp_config` is enabled. This argument is not applicable for NSX Global Manager - use locale-services clause instead. +* `locale_service` - (Optional) This argument is applicable for NSX Global Manager only. Multiple locale services can be specified for multiple locations. + * `edge_cluster_path` - (Required) The path of the edge cluster where the Tier-0 is placed. + * `preferred_edge_nodes` - (Optional) Policy paths to edge nodes. Specified edge is used as preferred edge cluster member when failover mode is set to `PREEMPTIVE`. * `failover_mode` - (Optional) This failover mode determines, whether the preferred service router instance for given logical router will preempt the peer. Accepted values are PREEMPTIVE/NON_PREEMPTIVE. * `default_rule_logging` - (Optional) Boolean flag indicating if the default rule logging will be enabled or not. The default value is false. * `enable_firewall` - (Optional) Boolean flag indicating if the edge firewall will be enabled or not. The default value is true. @@ -97,6 +128,11 @@ The following arguments are supported: * `address_family` - (Optional) Address family, currently only `L2VPN_EVPN` is supported, which is the default. * `import_targets` - (Optional) List of import route targets. Format: :. * `export_targets` - (Optional) List of export route targets. Format: :. +* `intersite_config` - (Optional) This clause is relevant for Global Manager only. + * `transit_subnet` - (Optional) IPv4 subnet for inter-site transit segment connecting service routers across sites for stretched gateway. For IPv6 link local subnet is auto configured. + * `primary_site_path` - (Optional) Primary egress site for gateway. + * `fallback_site_paths` - (Optional) Fallback sites to be used as new primary site on current primary site failure. + ## Attributes Reference diff --git a/website/docs/r/policy_tier1_gateway.html.markdown b/website/docs/r/policy_tier1_gateway.html.markdown index cf9f7286e..617fad4d4 100644 --- a/website/docs/r/policy_tier1_gateway.html.markdown +++ b/website/docs/r/policy_tier1_gateway.html.markdown @@ -49,6 +49,32 @@ resource "nsxt_policy_tier1_gateway" "tier1_gw" { } ``` +## Global manager example usage +```hcl +resource "nsxt_policy_tier1_gateway" "tier1_gw" { + description = "Tier-1 provisioned by Terraform" + display_name = "Tier1-gw1" + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.paris.path + } + + locale_service { + edge_cluster_path = data.nsxt_policy_edge_cluster.london.path + preferred_edge_paths = [data.nsxt_policy_egde_node.edge1.path] + } + + intersite_config { + primary_site_path = data.nsxt_policy_site.paris.path + } + + tag { + scope = "color" + tag = "blue" + } +} +``` + ## Argument Reference The following arguments are supported: @@ -58,6 +84,9 @@ The following arguments are supported: * `tag` - (Optional) A list of scope + tag pairs to associate with this Tier-1 gateway. * `nsx_id` - (Optional) The NSX ID of this resource. If set, this ID will be used to create the policy resource. * `edge_cluster_path` - (Optional) The path of the edge cluster where the Tier-1 is placed. +* `locale_service` - (Optional) This argument is applicable for NSX Global Manager only. Multiple locale services can be specified for multiple locations. + * `edge_cluster_path` - (Required) The path of the edge cluster where the Tier-0 is placed. + * `preferred_edge_nodes` - (Optional) Policy paths to edge nodes. Specified edge is used as preferred edge cluster member when failover mode is set to `PREEMPTIVE`. * `failover_mode` - (Optional) This failover mode determines, whether the preferred service router instance for given logical router will preempt the peer. Accepted values are PREEMPTIVE/NON_PREEMPTIVE. * `default_rule_logging` - (Optional) Boolean flag indicating if the default rule logging will be enabled or not. The default value is false. * `enable_firewall` - (Optional) Boolean flag indicating if the edge firewall will be enabled or not. The default value is true. @@ -77,6 +106,10 @@ The following arguments are supported: * `route_advertisement_types` - (Optional) List of desired types of route advertisements, supported values: `TIER1_STATIC_ROUTES`, `TIER1_CONNECTED`, `TIER1_NAT`, `TIER1_LB_VIP`, `TIER1_LB_SNAT`, `TIER1_DNS_FORWARDER_IP`, `TIER1_IPSEC_LOCAL_ENDPOINT`. * `ingress_qos_profile_path` - (Optional) QoS Profile path for ingress traffic on link connected to Tier0 gateway. * `egress_qos_profile_path` - (Optional) QoS Profile path for egress traffic on link connected to Tier0 gateway. +* `intersite_config` - (Optional) This clause is relevant for Global Manager only. + * `transit_subnet` - (Optional) IPv4 subnet for inter-site transit segment connecting service routers across sites for stretched gateway. For IPv6 link local subnet is auto configured. + * `primary_site_path` - (Optional) Primary egress site for gateway. + ## Attributes Reference diff --git a/website/nsxt.erb b/website/nsxt.erb index 8eaafcd99..a8df38851 100644 --- a/website/nsxt.erb +++ b/website/nsxt.erb @@ -85,6 +85,9 @@ > nsxt_policy_ip_pool + > + nsxt_policy_site +